Compare commits

..

2 Commits

Author SHA1 Message Date
Jean-Marc Collin 646ef47f6f Fix issue #485 (#544)
Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
2024-10-12 12:50:12 +02:00
Jean-Marc Collin c344c43185 FIX #518 (#543)
Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
2024-10-12 11:02:24 +02:00
5 changed files with 14 additions and 3 deletions
@@ -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()
@@ -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,
@@ -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,
@@ -622,6 +622,8 @@ class UnderlyingClimate(UnderlyingEntity):
ATTR_ENTITY_ID: self._entity_id,
"target_temp_high": target_temp,
"target_temp_low": target_temp,
# issue 518 - we should send also the target temperature, even in TARGET RANGE
"temperature": target_temp,
}
else:
data = {
+2
View File
@@ -1001,6 +1001,7 @@ async def test_bug_508(
# "temperature": 17.5,
"target_temp_high": 10,
"target_temp_low": 10,
"temperature": 10,
},
),
]
@@ -1021,6 +1022,7 @@ async def test_bug_508(
"entity_id": "climate.mock_climate",
"target_temp_high": 31,
"target_temp_low": 31,
"temperature": 31,
},
),
]