Skip to content

Commit

Permalink
Merge pull request #36 from mguyard/dev
Browse files Browse the repository at this point in the history
fix: Resolve issue with adaptive mode conditional for outdoor sensor
  • Loading branch information
mguyard authored Jun 9, 2024
2 parents 06acdbc + 9a462ff commit 99d446b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions apps/CoversManager/covers_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -428,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 (
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 99d446b

Please sign in to comment.