From f4ab3fe414914a93acff26da58fb2051e59f4a90 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 9 May 2024 07:38:20 +0000 Subject: [PATCH] fix: Invalid HVAC mode: None Fixes #187 --- .../dual_smart_thermostat/hvac_device/cooler_fan_device.py | 3 ++- .../dual_smart_thermostat/hvac_device/heater_cooler_device.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/dual_smart_thermostat/hvac_device/cooler_fan_device.py b/custom_components/dual_smart_thermostat/hvac_device/cooler_fan_device.py index 035ea43..d5d6424 100644 --- a/custom_components/dual_smart_thermostat/hvac_device/cooler_fan_device.py +++ b/custom_components/dual_smart_thermostat/hvac_device/cooler_fan_device.py @@ -160,7 +160,8 @@ async def async_control_hvac(self, time=None, force=False): await self.async_turn_off() self.HVACActionReason = HVACActionReason.NONE case _: - _LOGGER.warning("Invalid HVAC mode: %s", self._hvac_mode) + if self._hvac_mode is not None: + _LOGGER.warning("Invalid HVAC mode: %s", self._hvac_mode) async def async_turn_on(self): """self._control_hvac will handle the logic for turning on the heater and aux heater.""" diff --git a/custom_components/dual_smart_thermostat/hvac_device/heater_cooler_device.py b/custom_components/dual_smart_thermostat/hvac_device/heater_cooler_device.py index bcfa48f..2b57d85 100644 --- a/custom_components/dual_smart_thermostat/hvac_device/heater_cooler_device.py +++ b/custom_components/dual_smart_thermostat/hvac_device/heater_cooler_device.py @@ -122,7 +122,8 @@ async def async_control_hvac(self, time=None, force=False): case HVACMode.OFF: await self.async_turn_off() case _: - _LOGGER.warning("Invalid HVAC mode: %s", self._hvac_mode) + if self._hvac_mode is not None: + _LOGGER.warning("Invalid HVAC mode: %s", self._hvac_mode) def is_cold_or_hot(self) -> tuple[bool, bool, ToleranceDevice]: """Check if the floor is too cold or too hot."""