Skip to content

Commit

Permalink
Fix restore overpowering_state
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Marc Collin committed Jan 5, 2025
1 parent 81231f9 commit 8b58e69
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion custom_components/versatile_thermostat/base_thermostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class BaseThermostat(ClimateEntity, RestoreEntity, Generic[T]):
"comfort_away_temp",
"power_temp",
"ac_mode",
"current_max_power",
"saved_preset_mode",
"saved_target_temp",
"saved_hvac_mode",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ async def start_listening(self):
self._is_configured = True
# Try to restore _overpowering_state from previous state
old_state = await self._vtherm.async_get_last_state()
self._overpowering_state = (
old_state.attributes.get("overpowering_state", STATE_UNKNOWN)
if old_state and old_state.attributes and old_state.attributes in (STATE_OFF, STATE_ON)
else STATE_UNKNOWN
)
self._overpowering_state = STATE_ON if old_state and old_state.attributes and old_state.attributes.get("overpowering_state") == STATE_ON else STATE_UNKNOWN
else:
if self._use_power_feature:
if not central_power_configuration:
Expand Down

0 comments on commit 8b58e69

Please sign in to comment.