From a6ad8e79272af37de11f558fb19644ed50b6c9c7 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Sat, 14 Oct 2023 09:29:42 +0200 Subject: [PATCH] +1 --- custom_components/versatile_thermostat/climate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/versatile_thermostat/climate.py b/custom_components/versatile_thermostat/climate.py index 01cd308..07ed55c 100644 --- a/custom_components/versatile_thermostat/climate.py +++ b/custom_components/versatile_thermostat/climate.py @@ -1619,10 +1619,10 @@ class VersatileThermostat(ClimateEntity, RestoreEntity): else None ) - old_state_date_changed = old_state.last_changed if old_state.last_changed else None - old_state_date_updated = old_state.last_updated if old_state.last_updated else None - new_state_date_changed = new_state.last_changed if new_state.last_changed else None - new_state_date_updated = new_state.last_updated if new_state.last_updated else None + old_state_date_changed = old_state.last_changed if old_state and old_state.last_changed else None + old_state_date_updated = old_state.last_updated if old_state and old_state.last_updated else None + new_state_date_changed = new_state.last_changed if new_state and new_state.last_changed else None + new_state_date_updated = new_state.last_updated if new_state and new_state.last_updated else None # Issue 99 - some AC turn hvac_mode=cool and hvac_action=idle when sending a HVACMode_OFF command # Issue 114 - Remove this because hvac_mode is now managed by local _hvac_mode and use idle action as is