Fix generic_thermostat too_hot/too_cold (#27860)

* fix for too_hot/too_cold

Closes #27802

* too_hot correction
This commit is contained in:
akasma74 2019-11-08 08:25:37 +00:00 committed by Martin Hjelmare
parent 4f56f4e7e9
commit e96b5ef2b0

View file

@ -412,8 +412,8 @@ class GenericThermostat(ClimateDevice, RestoreEntity):
if not long_enough:
return
too_cold = self._target_temp - self._cur_temp >= self._cold_tolerance
too_hot = self._cur_temp - self._target_temp >= self._hot_tolerance
too_cold = self._target_temp >= self._cur_temp + self._cold_tolerance
too_hot = self._cur_temp >= self._target_temp + self._hot_tolerance
if self._is_device_active:
if (self.ac_mode and too_cold) or (not self.ac_mode and too_hot):
_LOGGER.info("Turning off heater %s", self.heater_entity_id)