From 3f95ed74f49189f04e4bf65064b4665ca2704794 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Sun, 6 Oct 2024 09:04:47 +0000 Subject: [PATCH] FIX TypeError: '>' not supported between instances of 'float' and 'NoneType' error message --- .../versatile_thermostat/thermostat_climate.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/custom_components/versatile_thermostat/thermostat_climate.py b/custom_components/versatile_thermostat/thermostat_climate.py index 6675ad7..bc8abb6 100644 --- a/custom_components/versatile_thermostat/thermostat_climate.py +++ b/custom_components/versatile_thermostat/thermostat_climate.py @@ -145,6 +145,12 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]): _LOGGER.debug("%s - don't send regulated temperature cause VTherm is off ") return + if self.current_temperature is None or self.target_temperature is None: + _LOGGER.warning( + "%s - don't send regulated temperature cause VTherm current_temp (%s) or target_temp (%s) is None. This should be a temporary warning message." + ) + return + _LOGGER.info( "%s - Calling ThermostatClimate._send_regulated_temperature force=%s", self, @@ -172,7 +178,7 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]): _LOGGER.debug("%s - usage of regulation_step: %.2f ", self, regulation_step) - + new_regulated_temp = round_to_nearest( self._regulation_algo.calculate_regulated_temperature( self.current_temperature, self._cur_ext_temp