Skip to content

Commit

Permalink
Update climate.py
Browse files Browse the repository at this point in the history
Rewrite hvac_action method
  • Loading branch information
andyxpert authored Dec 8, 2024
1 parent 3d541e8 commit d40709d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions custom_components/better_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d40709d

Please sign in to comment.