From 1e559905bc1c5154fda726647af48a33064264e8 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Mon, 31 Jul 2023 18:30:54 -0700 Subject: [PATCH] add assert --- custom_components/adaptive_lighting/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 63eb4a6e..0a062fd6 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1473,9 +1473,9 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): await self._adapt_light(light, context, transition) 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 - and not self.manager.is_proactively_adapting(event.context.id) and not self.manager._off_to_on_state_event_is_from_turn_on( entity_id, event,