From 2e3246fcca29771f71b9e0ab183ee2d08f9b4369 Mon Sep 17 00:00:00 2001 From: GUYARD Marc Date: Sun, 9 Jun 2024 16:19:51 +0200 Subject: [PATCH 1/2] fix: Update log message for state change callback to better understand which callback is trigger --- apps/CoversManager/covers_manager.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/CoversManager/covers_manager.py b/apps/CoversManager/covers_manager.py index c65bb79..6cb5030 100644 --- a/apps/CoversManager/covers_manager.py +++ b/apps/CoversManager/covers_manager.py @@ -354,7 +354,11 @@ def _callback_listenstate_covers(self, entity: str, attribute: str, old: str, ne None """ if not self._get_islocked(config=kwargs["config"], action=kwargs["action"]): - self.log(f"Callback triggered by state change of {entity} from {old} to {new}", level="DEBUG") + self.log( + f"Action {kwargs["action"].upper()} - " + f"Callback triggered by state change of {entity} from {old} to {new}", + level="DEBUG", + ) self._callback_move_covers(**kwargs) else: self.log( @@ -382,7 +386,10 @@ def _callback_listenstate_suninwindow( Returns: None """ - self.log(f"Callback triggered by state change of {entity}/{attribute} from {old} to {new}", level="DEBUG") + self.log( + f"SunInWindow - Callback triggered by state change of {entity}/{attribute} from {old} to {new}", + level="DEBUG", + ) # Check if the sun elevation is below or equal to horizon. If yes, disable adaptive mode if float(self.get_state(entity_id="sun.sun", attribute="elevation")) <= 0: @@ -560,7 +567,10 @@ def _callback_listenstate_sunleavewindow( Returns: None """ - self.log(f"Callback triggered by state change of {entity}/{attribute} from {old} to {new}", level="DEBUG") + self.log( + f"SunLeaveWindow - Callback triggered by state change of {entity}/{attribute} from {old} to {new}", + level="DEBUG", + ) # Check if the sun elevation is below or equal to horizon. If yes, disable adaptive mode if float(self.get_state(entity_id="sun.sun", attribute="elevation")) <= 0: From 9a462ff973eca04733198a6d5a2ccad02e07a126 Mon Sep 17 00:00:00 2001 From: GUYARD Marc Date: Sun, 9 Jun 2024 16:31:13 +0200 Subject: [PATCH 2/2] fix: Resolve issue with adaptive mode conditional for outdoor sensor --- apps/CoversManager/covers_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/CoversManager/covers_manager.py b/apps/CoversManager/covers_manager.py index 6cb5030..1f17a44 100644 --- a/apps/CoversManager/covers_manager.py +++ b/apps/CoversManager/covers_manager.py @@ -435,7 +435,7 @@ def _callback_listenstate_suninwindow( and kwargs["config"].common.temperature.outdoor.sensor is not None and ( outdoor_temperature >= int(kwargs["config"].common.temperature.outdoor.low_temperature) - and outdoor_temperature < int(kwargs["config"].common.temperature.outdoor.low_temperature) + and outdoor_temperature < int(kwargs["config"].common.temperature.outdoor.high_temperature) ) ): if (