From 807f7109d49898b2bbebcec3057eb1017bf21099 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Wed, 2 Aug 2023 17:59:44 -0700 Subject: [PATCH] Require take_over_control for to ignore non-turn_on state off -> on event (#695) --- custom_components/adaptive_lighting/switch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 772aa1e0..86f430bc 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1465,7 +1465,8 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): async def _respond_to_off_to_on_event(self, entity_id: str, event: Event) -> None: assert not self.manager.is_proactively_adapting(event.context.id) if ( - not self._detect_non_ha_changes + self._take_over_control + and not self._detect_non_ha_changes and not self.manager._off_to_on_state_event_is_from_turn_on( entity_id, event,