diff --git a/custom_components/stateful_scenes/StatefulScenes.py b/custom_components/stateful_scenes/StatefulScenes.py index 6b537fc..f1f9454 100644 --- a/custom_components/stateful_scenes/StatefulScenes.py +++ b/custom_components/stateful_scenes/StatefulScenes.py @@ -259,6 +259,9 @@ def turn_on(self): def turn_off(self): """Turn off all entities in the scene.""" + if not self._is_on: # already off + return + if self.restore_on_deactivate: self.restore() else: @@ -267,6 +270,7 @@ def turn_off(self): service="turn_off", target={"entity_id": list(self.entities.keys())}, ) + self._is_on = False @property