Skip to content

Commit

Permalink
hvac: set proper setpoint depending on mode
Browse files Browse the repository at this point in the history
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
  • Loading branch information
Noltari committed Oct 26, 2024
1 parent b70abf2 commit 8652bf2
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions aioairzone_cloud/hvac.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,18 +712,22 @@ def set_power(self, power: bool) -> None:

def set_setpoint(self, setpoint: float) -> None:
"""Set HVAC setpoint."""
if self.temp_set_auto_air is not None:
self.temp_set_auto_air = setpoint
if self.temp_set_cool_air is not None:
self.temp_set_cool_air = setpoint
if self.temp_set_dry_air is not None:
self.temp_set_dry_air = setpoint
if self.temp_set_hot_air is not None:
self.temp_set_hot_air = setpoint
if self.temp_set_stop_air is not None:
self.temp_set_stop_air = setpoint
if self.temp_set_vent_air is not None:
self.temp_set_vent_air = setpoint
mode = self.get_mode()
if mode is None:
return

if mode.is_auto():
self.set_setpoint_auto(setpoint)
elif mode.is_cool():
self.set_setpoint_cool(setpoint)
elif mode.is_dry():
self.set_setpoint_dry(setpoint)
elif mode.is_heat():
self.set_setpoint_heat(setpoint)
elif mode.is_vent():
self.set_setpoint_vent(setpoint)
elif mode.is_stop():
self.set_setpoint_stop(setpoint)

def set_setpoint_auto(self, setpoint: float) -> None:
"""Set HVAC auto setpoint."""
Expand Down

0 comments on commit 8652bf2

Please sign in to comment.