diff --git a/custom_components/versatile_thermostat/thermostat_climate.py b/custom_components/versatile_thermostat/thermostat_climate.py index ed146b4..1d26e83 100644 --- a/custom_components/versatile_thermostat/thermostat_climate.py +++ b/custom_components/versatile_thermostat/thermostat_climate.py @@ -625,7 +625,8 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]): async def end_climate_changed(changes: bool): """To end the event management""" if changes: - self.async_write_ha_state() + # already done by update_custom_attribute + # self.async_write_ha_state() self.update_custom_attributes() await self.async_control_heating() diff --git a/custom_components/versatile_thermostat/thermostat_switch.py b/custom_components/versatile_thermostat/thermostat_switch.py index 4f760bc..2e47737 100644 --- a/custom_components/versatile_thermostat/thermostat_switch.py +++ b/custom_components/versatile_thermostat/thermostat_switch.py @@ -186,7 +186,8 @@ class ThermostatOverSwitch(BaseThermostat[UnderlyingSwitch]): self._hvac_mode or HVACMode.OFF, ) self.update_custom_attributes() - self.async_write_ha_state() + # already done bu update_custom_attributes + # self.async_write_ha_state() @overrides def incremente_energy(self): @@ -203,6 +204,8 @@ class ThermostatOverSwitch(BaseThermostat[UnderlyingSwitch]): else: self._total_energy += added_energy + self.update_custom_attributes() + _LOGGER.debug( "%s - added energy is %.3f . Total energy is now: %.3f", self, diff --git a/custom_components/versatile_thermostat/thermostat_valve.py b/custom_components/versatile_thermostat/thermostat_valve.py index 3865851..d0fb322 100644 --- a/custom_components/versatile_thermostat/thermostat_valve.py +++ b/custom_components/versatile_thermostat/thermostat_valve.py @@ -270,7 +270,8 @@ class ThermostatOverValve(BaseThermostat[UnderlyingValve]): # pylint: disable=a self._last_calculation_timestamp = now self.update_custom_attributes() - self.async_write_ha_state() + # already done in update_custom_attributes + # self.async_write_ha_state() @overrides def incremente_energy(self): @@ -287,6 +288,8 @@ class ThermostatOverValve(BaseThermostat[UnderlyingValve]): # pylint: disable=a else: self._total_energy += added_energy + self.update_custom_attributes() + _LOGGER.debug( "%s - added energy is %.3f . Total energy is now: %.3f", self,