diff --git a/aioairzone/common.py b/aioairzone/common.py index 67dd452..1632d6a 100644 --- a/aioairzone/common.py +++ b/aioairzone/common.py @@ -5,6 +5,11 @@ from enum import Enum +def system_zone_id(system_id: int, zone_id: int) -> str: + """Combine System and Zone IDs into a single ID.""" + return f"{system_id}:{zone_id}" + + class AirzoneStages(int, Enum): """Airzone stages.""" diff --git a/aioairzone/localapi_device.py b/aioairzone/localapi_device.py index 8e784f0..ba86334 100644 --- a/aioairzone/localapi_device.py +++ b/aioairzone/localapi_device.py @@ -8,7 +8,13 @@ from aiohttp import ClientSession from aiohttp.client_reqrep import ClientResponse -from .common import AirzoneStages, ConnectionOptions, OperationMode, TemperatureUnit +from .common import ( + AirzoneStages, + ConnectionOptions, + OperationMode, + TemperatureUnit, + system_zone_id, +) from .const import ( API_AIR_DEMAND, API_COLD_STAGE, @@ -205,7 +211,7 @@ def data(self) -> dict[str, Any]: for system_id, system in self.systems.items(): systems[system_id] = system.data() for zone_id, zone in system.zones.items(): - zones[f"{system_id}:{zone_id}"] = zone.data() + zones[system_zone_id(system_id, zone_id)] = zone.data() data[AZD_SYSTEMS] = systems data[AZD_ZONES] = zones