From e5c10104b8bb707f0b38868b72c273d2c3a47465 Mon Sep 17 00:00:00 2001 From: sirmrak Date: Thu, 9 Jul 2026 09:19:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20custom=5Fcomponents/motion=5Flight/coordinator.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/motion_light/coordinator.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/custom_components/motion_light/coordinator.py b/custom_components/motion_light/coordinator.py index 1d9e363..5edebe6 100644 --- a/custom_components/motion_light/coordinator.py +++ b/custom_components/motion_light/coordinator.py @@ -603,6 +603,11 @@ class MotionLightCoordinator(DataUpdateCoordinator): LUX_CHECK_INTERVAL, self._check_lux_periodically, ) + + self.async_set_updated_data({ + "state": self._state, + "attributes": self.attributes, + }) def _stop_lux_check_timer(self): """Stop periodic lux check timer.""" @@ -610,7 +615,10 @@ class MotionLightCoordinator(DataUpdateCoordinator): self.logger.debug("Stopping lux check timer") self._lux_check_timer() self._lux_check_timer = None - + self.async_set_updated_data({ + "state": self._state, + "attributes": self.attributes, + }) @callback def _check_lux_periodically(self, _=None): """Check lux periodically.""" @@ -795,7 +803,11 @@ class MotionLightCoordinator(DataUpdateCoordinator): self._lux_cooldown_active = False self._lux_cooldown_timer = None self.logger.info("Lux cooldown expired") - + self.async_set_updated_data({ + "state": self._state, + "attributes": self.attributes, + }) + def _cancel_all_timers(self): """Cancel all timers.""" if self._motion_detect_timer: