Skip to content

Commit

Permalink
localapi: add integration
Browse files Browse the repository at this point in the history
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
  • Loading branch information
Noltari committed Nov 17, 2022
1 parent 726add4 commit cace188
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aioairzone/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
API_HEAT_STAGES = "heatStages"
API_HUMIDITY = "humidity"
API_HVAC = "hvac"
API_INTEGRATION = "integration"
API_INTERFACE = "interface"
API_MAC = "mac"
API_MANUFACTURER = "manufacturer"
Expand Down Expand Up @@ -159,6 +160,7 @@
HTTP_CALL_TIMEOUT = 10

RAW_HVAC = "hvac"
RAW_INTEGRATION = "integration"
RAW_SYSTEMS = "systems"
RAW_VERSION = "version"
RAW_WEBSERVER = "webserver"
Expand Down
11 changes: 11 additions & 0 deletions aioairzone/localapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
API_ERROR_ZONE_ID_OUT_RANGE,
API_ERRORS,
API_HVAC,
API_INTEGRATION,
API_MAC,
API_SYSTEM_ID,
API_SYSTEM_PARAMS,
Expand All @@ -41,6 +42,7 @@
DEFAULT_SYSTEM_ID,
HTTP_CALL_TIMEOUT,
RAW_HVAC,
RAW_INTEGRATION,
RAW_SYSTEMS,
RAW_VERSION,
RAW_WEBSERVER,
Expand Down Expand Up @@ -287,6 +289,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_integration(self) -> dict[str, Any]:
"""Return Airzone integration."""
res = await self.http_request(
"POST",
f"{API_V1}/{API_INTEGRATION}",
)
self._api_raw_data[RAW_INTEGRATION] = res
return res

async def get_version(self) -> dict[str, Any]:
"""Return Airzone Local API version."""
res = await self.http_request(
Expand Down
1 change: 1 addition & 0 deletions examples/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async def main():
print(f"Airzone WebServer: {airzone_mac}")
print("***")

await airzone.get_integration()
await airzone.get_version()
await airzone.update()
print(json.dumps(airzone.data(), indent=4, sort_keys=True))
Expand Down

0 comments on commit cace188

Please sign in to comment.