Update aioairzone to v0.2.1 (#68798)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
98ca9754d7
commit
fefd6a1d1a
7 changed files with 25 additions and 18 deletions
|
@ -4,8 +4,15 @@ from __future__ import annotations
|
|||
from typing import Any
|
||||
|
||||
from aioairzone.common import ConnectionOptions
|
||||
from aioairzone.const import AZD_ID, AZD_NAME, AZD_SYSTEM, AZD_ZONES
|
||||
from aioairzone.localapi_device import AirzoneLocalApi
|
||||
from aioairzone.const import (
|
||||
AZD_ID,
|
||||
AZD_NAME,
|
||||
AZD_SYSTEM,
|
||||
AZD_THERMOSTAT_FW,
|
||||
AZD_THERMOSTAT_MODEL,
|
||||
AZD_ZONES,
|
||||
)
|
||||
from aioairzone.localapi import AirzoneLocalApi
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT, Platform
|
||||
|
@ -33,15 +40,18 @@ class AirzoneEntity(CoordinatorEntity[AirzoneUpdateCoordinator]):
|
|||
"""Initialize."""
|
||||
super().__init__(coordinator)
|
||||
|
||||
self._attr_device_info: DeviceInfo = {
|
||||
"identifiers": {(DOMAIN, f"{entry.entry_id}_{system_zone_id}")},
|
||||
"manufacturer": MANUFACTURER,
|
||||
"name": f"Airzone [{system_zone_id}] {zone_data[AZD_NAME]}",
|
||||
}
|
||||
self.system_id = zone_data[AZD_SYSTEM]
|
||||
self.system_zone_id = system_zone_id
|
||||
self.zone_id = zone_data[AZD_ID]
|
||||
|
||||
self._attr_device_info: DeviceInfo = {
|
||||
"identifiers": {(DOMAIN, f"{entry.entry_id}_{system_zone_id}")},
|
||||
"manufacturer": MANUFACTURER,
|
||||
"model": self.get_zone_value(AZD_THERMOSTAT_MODEL),
|
||||
"name": f"Airzone [{system_zone_id}] {zone_data[AZD_NAME]}",
|
||||
"sw_version": self.get_zone_value(AZD_THERMOSTAT_FW),
|
||||
}
|
||||
|
||||
def get_zone_value(self, key):
|
||||
"""Return zone value by key."""
|
||||
value = None
|
||||
|
|
|
@ -13,6 +13,7 @@ from aioairzone.const import (
|
|||
API_ZONE_ID,
|
||||
AZD_DEMAND,
|
||||
AZD_HUMIDITY,
|
||||
AZD_MASTER,
|
||||
AZD_MODE,
|
||||
AZD_MODES,
|
||||
AZD_NAME,
|
||||
|
@ -119,12 +120,8 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity):
|
|||
self.get_zone_value(AZD_TEMP_UNIT)
|
||||
]
|
||||
self._attr_hvac_modes = [
|
||||
HVAC_MODE_LIB_TO_HASS[mode]
|
||||
for mode in self.get_zone_value(AZD_MODES)
|
||||
or [self.get_zone_value(AZD_MODE)]
|
||||
HVAC_MODE_LIB_TO_HASS[mode] for mode in self.get_zone_value(AZD_MODES)
|
||||
]
|
||||
if HVAC_MODE_OFF not in self._attr_hvac_modes:
|
||||
self._attr_hvac_modes.append(HVAC_MODE_OFF)
|
||||
self._async_update_attrs()
|
||||
|
||||
async def _async_update_hvac_params(self, params) -> None:
|
||||
|
@ -147,7 +144,7 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity):
|
|||
if hvac_mode == HVAC_MODE_OFF:
|
||||
params[API_ON] = 0
|
||||
else:
|
||||
if self.get_zone_value(AZD_MODES):
|
||||
if self.get_zone_value(AZD_MASTER):
|
||||
mode = HVAC_MODE_HASS_TO_LIB[hvac_mode]
|
||||
if mode != self.get_zone_value(AZD_MODE):
|
||||
params[API_MODE] = mode
|
||||
|
|
|
@ -5,7 +5,7 @@ from typing import Any
|
|||
|
||||
from aioairzone.common import ConnectionOptions
|
||||
from aioairzone.exceptions import InvalidHost
|
||||
from aioairzone.localapi_device import AirzoneLocalApi
|
||||
from aioairzone.localapi import AirzoneLocalApi
|
||||
from aiohttp.client_exceptions import ClientConnectorError
|
||||
import voluptuous as vol
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from aioairzone.localapi_device import AirzoneLocalApi
|
||||
from aioairzone.localapi import AirzoneLocalApi
|
||||
from aiohttp.client_exceptions import ClientConnectorError
|
||||
import async_timeout
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "Airzone",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/airzone",
|
||||
"requirements": ["aioairzone==0.1.0"],
|
||||
"requirements": ["aioairzone==0.2.1"],
|
||||
"codeowners": ["@Noltari"],
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["aioairzone"]
|
||||
|
|
|
@ -110,7 +110,7 @@ aio_geojson_nsw_rfs_incidents==0.4
|
|||
aio_georss_gdacs==0.5
|
||||
|
||||
# homeassistant.components.airzone
|
||||
aioairzone==0.1.0
|
||||
aioairzone==0.2.1
|
||||
|
||||
# homeassistant.components.ambient_station
|
||||
aioambient==2021.11.0
|
||||
|
|
|
@ -91,7 +91,7 @@ aio_geojson_nsw_rfs_incidents==0.4
|
|||
aio_georss_gdacs==0.5
|
||||
|
||||
# homeassistant.components.airzone
|
||||
aioairzone==0.1.0
|
||||
aioairzone==0.2.1
|
||||
|
||||
# homeassistant.components.ambient_station
|
||||
aioambient==2021.11.0
|
||||
|
|
Loading…
Add table
Reference in a new issue