diff --git a/custom_components/better_thermostat/climate.py b/custom_components/better_thermostat/climate.py index e32f4c98..bb440f95 100644 --- a/custom_components/better_thermostat/climate.py +++ b/custom_components/better_thermostat/climate.py @@ -1119,12 +1119,14 @@ def hvac_action(self): if self.bt_target_temp is not None and self.cur_temp is not None: if self.hvac_mode == HVACMode.OFF: self.attr_hvac_action = HVACAction.OFF - elif self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False: - self.attr_hvac_action = HVACAction.HEATING elif ( - self.bt_target_temp > self.cur_temp + self.tolerance + (self.attr_hvac_action == HVACAction.IDLE + and self.bt_target_temp >= self.cur_temp + self.tolerance + or + self.attr_hvac_action == HVACAction.HEATING + and self.bt_target_temp >= self.cur_temp + ) and self.window_open is False - and self.bt_hvac_mode is not HVACMode.OFF ): self.attr_hvac_action = HVACAction.HEATING else: