diff --git a/aioairzone/const.py b/aioairzone/const.py index e11e1f3..5169e49 100644 --- a/aioairzone/const.py +++ b/aioairzone/const.py @@ -29,6 +29,8 @@ API_POWER = "power" API_ROOM_TEMP = "roomTemp" API_SET_POINT = "setpoint" +API_SPEED = "speed" +API_SPEEDS = "speeds" API_SYSTEM_FIRMWARE = "system_firmware" API_SYSTEM_ID = "systemID" API_SYSTEM_TYPE = "system_type" @@ -50,7 +52,10 @@ API_ERROR_ZONE_ID_NOT_AVAILABLE = "zoneid not avaiable" API_ERROR_ZONE_ID_OUT_RANGE = "zoneid out of range" -API_SYSTEM_PARAMS = [API_MODE] +API_SYSTEM_PARAMS = [ + API_MODE, + API_SPEED, +] API_ZONE_PARAMS = [ API_COOL_SET_POINT, API_COLD_STAGE, @@ -90,6 +95,8 @@ AZD_ON = "on" AZD_POWER = "power" AZD_PROBLEMS = "problems" +AZD_SPEED = "speed" +AZD_SPEEDS = "speeds" AZD_SYSTEM = "system" AZD_SYSTEMS = "systems" AZD_SYSTEMS_NUM = "num_systems" diff --git a/aioairzone/localapi.py b/aioairzone/localapi.py index 37e5269..af1db80 100644 --- a/aioairzone/localapi.py +++ b/aioairzone/localapi.py @@ -50,6 +50,8 @@ API_POWER, API_ROOM_TEMP, API_SET_POINT, + API_SPEED, + API_SPEEDS, API_SYSTEM_FIRMWARE, API_SYSTEM_ID, API_SYSTEM_PARAMS, @@ -96,6 +98,8 @@ AZD_ON, AZD_POWER, AZD_PROBLEMS, + AZD_SPEED, + AZD_SPEEDS, AZD_SYSTEM, AZD_SYSTEMS, AZD_SYSTEMS_NUM, @@ -582,6 +586,8 @@ def __init__(self, system: System, zone: dict[str, Any]): self.modes: list[OperationMode] = [] self.name = str(zone[API_NAME]) self.on = bool(zone[API_ON]) + self.speed: int | None = None + self.speeds: int | None = None self.temp = float(zone[API_ROOM_TEMP]) self.temp_max = float(zone[API_MAX_TEMP]) self.temp_min = float(zone[API_MIN_TEMP]) @@ -622,6 +628,11 @@ def __init__(self, system: System, zone: dict[str, Any]): for key, val in error.items(): self.add_error(key, val) + if API_SPEED in zone: + self.speed = int(zone[API_SPEED]) + if API_SPEEDS in zone: + self.speeds = int(zone[API_SPEEDS]) + if self.master: for mode in zone[API_MODES]: self.modes.append(OperationMode(mode)) @@ -671,6 +682,11 @@ def data(self) -> dict[str, Any]: if self.heat_stages: data[AZD_HEAT_STAGES] = self.get_heat_stages() + if self.speed: + data[AZD_SPEED] = self.speed + if self.speeds: + data[AZD_SPEEDS] = self.speeds + if len(self.errors) > 0: data[AZD_ERRORS] = self.get_errors() @@ -812,6 +828,14 @@ def get_problems(self) -> bool: """Return zone problems.""" return bool(self.errors) + def get_speed(self) -> int | None: + """Return zone speed.""" + return self.speed + + def get_speeds(self) -> int | None: + """Return zone speedS.""" + return self.speeds + def get_system_id(self) -> int: """Return system ID.""" return self.system.get_id()