FIX is_device_active flag

This commit is contained in:
Jean-Marc Collin
2023-11-11 11:39:04 +00:00
parent 55a99054fa
commit 01e761aecd
2 changed files with 5 additions and 0 deletions

View File

@@ -172,6 +172,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
"power_sensor_entity_id", "power_sensor_entity_id",
"max_power_sensor_entity_id", "max_power_sensor_entity_id",
"temperature_unit", "temperature_unit",
"is_device_active",
} }
) )
) )
@@ -2178,6 +2179,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
"power_sensor_entity_id": self._power_sensor_entity_id, "power_sensor_entity_id": self._power_sensor_entity_id,
"max_power_sensor_entity_id": self._max_power_sensor_entity_id, "max_power_sensor_entity_id": self._max_power_sensor_entity_id,
"temperature_unit": self.temperature_unit, "temperature_unit": self.temperature_unit,
"is_device_active": self.is_device_active,
} }
@callback @callback

View File

@@ -30,6 +30,7 @@ class ThermostatOverSwitch(BaseThermostat):
frozenset( frozenset(
{ {
"is_over_switch", "is_over_switch",
"is_inversed",
"underlying_switch_0", "underlying_switch_0",
"underlying_switch_1", "underlying_switch_1",
"underlying_switch_2", "underlying_switch_2",
@@ -129,6 +130,7 @@ class ThermostatOverSwitch(BaseThermostat):
super().update_custom_attributes() super().update_custom_attributes()
self._attr_extra_state_attributes["is_over_switch"] = self.is_over_switch self._attr_extra_state_attributes["is_over_switch"] = self.is_over_switch
self._attr_extra_state_attributes["is_inversed"] = self.is_inversed
self._attr_extra_state_attributes["underlying_switch_0"] = self._underlyings[ self._attr_extra_state_attributes["underlying_switch_0"] = self._underlyings[
0 0
].entity_id ].entity_id
@@ -207,3 +209,4 @@ class ThermostatOverSwitch(BaseThermostat):
if old_state is None: if old_state is None:
self.hass.create_task(self._check_initial_state()) self.hass.create_task(self._check_initial_state())
self.async_write_ha_state() self.async_write_ha_state()
self.update_custom_attributes()