Try to fix issue #334 - loop when underlying is late to update

This commit is contained in:
Jean-Marc Collin
2024-01-13 11:28:26 +00:00
parent d7ec6770c4
commit e8bb465b43
8 changed files with 186 additions and 28 deletions

View File

@@ -1406,9 +1406,10 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
if new_state is None or new_state.state in (STATE_UNAVAILABLE, STATE_UNKNOWN):
return
await self._async_update_temp(new_state)
dearm_window_auto = await self._async_update_temp(new_state)
self.recalculate()
await self.async_control_heating(force=False)
return dearm_window_auto
async def _async_ext_temperature_changed(self, event: Event):
"""Handle external temperature opf the sensor changes."""
@@ -1646,7 +1647,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
await self.check_security()
# check window_auto
await self._async_manage_window_auto()
return await self._async_manage_window_auto()
except ValueError as ex:
_LOGGER.error("Unable to update temperature from sensor: %s", ex)