From ff28877ccf72536dcfe436b5820ac78cb8c61ceb Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Mon, 31 Jul 2023 12:44:49 -0700 Subject: [PATCH] add todo --- custom_components/adaptive_lighting/switch.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 5f9bbf02..14986a8e 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1486,11 +1486,12 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): ) self.manager.mark_as_manual_control(entity_id) return - + # TODO: I believe I need to separate the concept of random turn ons and # noqa: TD002, FIX002, TD003 + # manual control because take_over_control can be False which means that + # manual control is ignored. Or deprecate take_over_contol and make it always True? if self._adapt_delay > 0: await asyncio.sleep(self._adapt_delay) - if self._take_over_control and self.manager.manual_control.get(entity_id): - return + await self._update_attrs_and_maybe_adapt_lights( context=self.create_context("light_event", parent=event.context), lights=[entity_id],