Skip to content

Commit

Permalink
FIX is_device_active flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Marc Collin committed Nov 11, 2023
1 parent 55a9905 commit 01e761a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/versatile_thermostat/base_thermostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
"power_sensor_entity_id",
"max_power_sensor_entity_id",
"temperature_unit",
"is_device_active",
}
)
)
Expand Down Expand Up @@ -2178,6 +2179,7 @@ def update_custom_attributes(self):
"power_sensor_entity_id": self._power_sensor_entity_id,
"max_power_sensor_entity_id": self._max_power_sensor_entity_id,
"temperature_unit": self.temperature_unit,
"is_device_active": self.is_device_active,
}

@callback
Expand Down
3 changes: 3 additions & 0 deletions custom_components/versatile_thermostat/thermostat_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ThermostatOverSwitch(BaseThermostat):
frozenset(
{
"is_over_switch",
"is_inversed",
"underlying_switch_0",
"underlying_switch_1",
"underlying_switch_2",
Expand Down Expand Up @@ -129,6 +130,7 @@ def update_custom_attributes(self):
super().update_custom_attributes()

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[
0
].entity_id
Expand Down Expand Up @@ -207,3 +209,4 @@ def _async_switch_changed(self, event):
if old_state is None:
self.hass.create_task(self._check_initial_state())
self.async_write_ha_state()
self.update_custom_attributes()

0 comments on commit 01e761a

Please sign in to comment.