Skip to content

Commit

Permalink
device: drop AUTO OperationMode without double_sp
Browse files Browse the repository at this point in the history
The API exposes the AUTO OperationMode when double setpoint is disabled, which
doesn't make sense, so let's remove it from the modes.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
  • Loading branch information
Noltari committed Oct 21, 2024
1 parent ad41427 commit b284483
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aioairzone_cloud/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ def get_mode_auto(self) -> OperationMode | None:
def get_modes(self) -> list[OperationMode] | None:
"""Return Device modes."""
if len(self.modes) > 0:
return self.modes
modes = self.modes.copy()
if OperationMode.AUTO in modes and not self.get_double_set_point():
modes.pop(OperationMode.AUTO)
return modes
return None

def get_name(self) -> str:
Expand Down

0 comments on commit b284483

Please sign in to comment.