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 authored and Martin Hjelmare committed 2019-11-08 09:25:37 +01:00
1 parent 4f56f4e7e9
commit e96b5ef2b0
1 file changed
+2 -2
@@ -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)