From b2844831a21e751348cf48a4a6df89b8dc276e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 21 Oct 2024 11:38:55 +0200 Subject: [PATCH] device: drop AUTO OperationMode without double_sp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- aioairzone_cloud/device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aioairzone_cloud/device.py b/aioairzone_cloud/device.py index 03d156f..972ec38 100644 --- a/aioairzone_cloud/device.py +++ b/aioairzone_cloud/device.py @@ -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: