From 2ea5cf471b499dd37a8aae2f0ae6e608e2b98800 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Mon, 14 Oct 2024 16:58:18 +0000 Subject: [PATCH] Cleaning --- .../versatile_thermostat/underlyings.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/custom_components/versatile_thermostat/underlyings.py b/custom_components/versatile_thermostat/underlyings.py index 4307c8a..437b15e 100644 --- a/custom_components/versatile_thermostat/underlyings.py +++ b/custom_components/versatile_thermostat/underlyings.py @@ -550,14 +550,11 @@ class UnderlyingClimate(UnderlyingEntity): def is_device_active(self): """If the toggleable device is currently active.""" if self.is_initialized: - return ( - self._underlying_climate.hvac_mode != HVACMode.OFF - and self.hvac_action - not in [ - HVACAction.IDLE, - HVACAction.OFF, - ] - ) + return self.hvac_mode != HVACMode.OFF and self.hvac_action not in [ + HVACAction.IDLE, + HVACAction.OFF, + None, + ] else: return None