Skip to content

Commit

Permalink
fix: oly applies max_floor_temp old state if not set from config
Browse files Browse the repository at this point in the history
Fixes #297
  • Loading branch information
= authored and swingerman committed Oct 18, 2024
1 parent 0d75ec0 commit dc1ed5d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions custom_components/dual_smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ def __init__(

self._temp_lock = asyncio.Lock()

_LOGGER.name = __name__ + "." + self.unique_id if self.unique_id else __name__

async def async_added_to_hass(self) -> None:
"""Run when entity about to be added."""
await super().async_added_to_hass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async def async_control_device_when_on(
is_floor_cold = self._environment.is_floor_cold

_LOGGER.debug("_async_control_device_when_on, floor cold: %s", is_floor_cold)
_LOGGER.debug("_async_control_device_when_on, floor hot: %s", is_floor_hot)
_LOGGER.debug("_async_control_device_when_on, too_hot: %s", too_hot)

if ((too_hot or is_floor_hot) or any_opening_open) and not is_floor_cold:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ def apply_old_state(self, old_state: State) -> None:

self._target_temp = float(old_target)

# do we actually need this?
self._max_floor_temp = (
old_state.attributes.get("max_floor_temp") or DEFAULT_MAX_FLOOR_TEMP
(old_state.attributes.get("max_floor_temp") or DEFAULT_MAX_FLOOR_TEMP)
if self._max_floor_temp is None
else self._max_floor_temp
)

0 comments on commit dc1ed5d

Please sign in to comment.