My Home Assistant logs were full of the following warning messages (printed about every 30 seconds) even though Versatile Thermostat was turned off (self._hvac_mode is HVACMode.OFF):
2024-02-04 17:02:53.951 WARNING (MainThread) [custom_components.versatile_thermostat.prop_algorithm] Proportional algorithm: calculation is not possible cause target_temp or current_temp is null. Heating/cooling will be disabled
2024-02-04 17:03:23.946 WARNING (MainThread) [custom_components.versatile_thermostat.prop_algorithm] Proportional algorithm: calculation is not possible cause target_temp or current_temp is null. Heating/cooling will be disabled
2024-02-04 17:03:53.978 WARNING (MainThread) [custom_components.versatile_thermostat.prop_algorithm] Proportional algorithm: calculation is not possible cause target_temp or current_temp is null. Heating/cooling will be disabled
...
current_temp was indeed None, because I had unplugged a MQTT heater + temperature sensor from the wall socket while it was not being used.
It is a useful warning message while Versatile Thermostat is turned on (HVACMode.HEAT, HVACMode.COOL), but I think it is counterproductive while Versatile Thermostat is turned off (HVACMode.OFF). Warning that “Heating/cooling will be disabled” when the user has already turned heating/cooling off is redundant. The warning that target_temp or current_temp are null is interesting but not in a loop while HVACMode is OFF, in a scenario like mine where the controlled heater + temperature sensors were unplugged.
This PR proposes dynamically amending the log level of that message depending on the on/off state of Versatile Thermostat.
My Home Assistant logs were full of the following warning messages (printed about every 30 seconds) even though Versatile Thermostat was turned off (
self._hvac_mode is HVACMode.OFF
):current_temp
was indeedNone
, because I had unplugged a MQTT heater + temperature sensor from the wall socket while it was not being used.It is a useful warning message while Versatile Thermostat is turned on (
HVACMode.HEAT
,HVACMode.COOL
), but I think it is counterproductive while Versatile Thermostat is turned off (HVACMode.OFF
). Warning that “Heating/cooling will be disabled” when the user has already turned heating/cooling off is redundant. The warning thattarget_temp
orcurrent_temp
are null is interesting but not in a loop whileHVACMode
isOFF
, in a scenario like mine where the controlled heater + temperature sensors were unplugged.This PR proposes dynamically amending the log level of that message depending on the on/off state of Versatile Thermostat.