diff --git a/aioairzone/const.py b/aioairzone/const.py index ae53423..0c8c68c 100644 --- a/aioairzone/const.py +++ b/aioairzone/const.py @@ -47,6 +47,7 @@ API_THERMOS_TYPE = "thermos_type" API_UNITS = "units" API_V1 = "api/v1" +API_VERSION = "version" API_WEBSERVER = "webserver" API_WIFI = "wifi" API_WIFI_CHANNEL = "wifi_channel" @@ -159,6 +160,7 @@ RAW_HVAC = "hvac" RAW_SYSTEMS = "systems" +RAW_VERSION = "version" RAW_WEBSERVER = "webserver" THERMOSTAT_RADIO = "Radio" diff --git a/aioairzone/localapi.py b/aioairzone/localapi.py index f2b384f..aff9487 100644 --- a/aioairzone/localapi.py +++ b/aioairzone/localapi.py @@ -27,6 +27,7 @@ API_SYSTEM_PARAMS, API_SYSTEMS, API_V1, + API_VERSION, API_WEBSERVER, API_ZONE_ID, API_ZONE_PARAMS, @@ -41,6 +42,7 @@ HTTP_CALL_TIMEOUT, RAW_HVAC, RAW_SYSTEMS, + RAW_VERSION, RAW_WEBSERVER, ) from .device import System, Zone @@ -285,6 +287,15 @@ async def get_hvac(self, params: dict[str, Any] | None = None) -> dict[str, Any] self._api_raw_data[RAW_HVAC] = res return res + async def get_version(self) -> dict[str, Any]: + """Return Airzone Local API version.""" + res = await self.http_request( + "POST", + f"{API_V1}/{API_VERSION}", + ) + self._api_raw_data[RAW_VERSION] = res + return res + async def get_webserver(self) -> dict[str, Any]: """Return Airzone WebServer.""" res = await self.http_request( diff --git a/examples/raw.py b/examples/raw.py index d16fe25..a3f71e9 100644 --- a/examples/raw.py +++ b/examples/raw.py @@ -21,6 +21,7 @@ async def main(): print(f"Airzone WebServer: {airzone_mac}") print("***") + await airzone.get_version() await airzone.update() print(json.dumps(airzone.data(), indent=4, sort_keys=True)) print("***")