Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: oly applies max_floor_temp old state if not set from config #305

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)