Fix restore overpowering_state

This commit is contained in:
Jean-Marc Collin
2025-01-05 10:53:28 +00:00
parent 81231f977c
commit 8b58e69755
2 changed files with 1 additions and 6 deletions

View File

@@ -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",

View File

@@ -71,11 +71,7 @@ class FeaturePowerManager(BaseFeatureManager):
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: