From a5c548bbeeb4c9b707436ec08d798f69fb964b01 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Fri, 17 Nov 2023 17:24:11 +0000 Subject: [PATCH] Fix issue #195 - Presence management don't work for person --- custom_components/versatile_thermostat/base_thermostat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/versatile_thermostat/base_thermostat.py b/custom_components/versatile_thermostat/base_thermostat.py index 9aae012..795b1aa 100644 --- a/custom_components/versatile_thermostat/base_thermostat.py +++ b/custom_components/versatile_thermostat/base_thermostat.py @@ -1578,7 +1578,9 @@ class BaseThermostat(ClimateEntity, RestoreEntity): async def _async_update_presence(self, new_state): _LOGGER.info("%s - Updating presence. New state is %s", self, new_state) - self._presence_state = new_state + self._presence_state = ( + STATE_ON if new_state in (STATE_ON, STATE_HOME) else STATE_OFF + ) if self._attr_preset_mode in HIDDEN_PRESETS or self._presence_on is False: _LOGGER.info( "%s - Ignoring presence change cause in Power or Security preset or presence not configured",