hugobloem / stateful_scenes

Stateful Scenes in Home Assistant (Home Kit scene compatible)
MIT License
38 stars 6 forks source link

Restore on deactivate restore wrong state #88

Open Cheerpipe opened 2 weeks ago

Cheerpipe commented 2 weeks ago

"restore on deactivate" feature store states after a state change event causing problems with scenes where a entity do more than one state change resulting in integration restoring a "bad" state. (Example, a bulb that informs two state changes for turn on and color change).

A better approach could be grab and store state just before a scene is applied. This may need more tweaks like check what attributes may be changed by the scene and grab those attributes to further restore action.