mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
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
@ -4,8 +4,15 @@ from __future__ import annotations
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from aioairzone.common import ConnectionOptions
|
from aioairzone.common import ConnectionOptions
|
||||||
from aioairzone.const import AZD_ID, AZD_NAME, AZD_SYSTEM, AZD_ZONES
|
from aioairzone.const import (
|
||||||
from aioairzone.localapi_device import AirzoneLocalApi
|
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.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_HOST, CONF_PORT, Platform
|
from homeassistant.const import CONF_HOST, CONF_PORT, Platform
|
||||||
@ -33,15 +40,18 @@ class AirzoneEntity(CoordinatorEntity[AirzoneUpdateCoordinator]):
|
|||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
super().__init__(coordinator)
|
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_id = zone_data[AZD_SYSTEM]
|
||||||
self.system_zone_id = system_zone_id
|
self.system_zone_id = system_zone_id
|
||||||
self.zone_id = zone_data[AZD_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):
|
def get_zone_value(self, key):
|
||||||
"""Return zone value by key."""
|
"""Return zone value by key."""
|
||||||
value = None
|
value = None
|
||||||
|
@ -13,6 +13,7 @@ from aioairzone.const import (
|
|||||||
API_ZONE_ID,
|
API_ZONE_ID,
|
||||||
AZD_DEMAND,
|
AZD_DEMAND,
|
||||||
AZD_HUMIDITY,
|
AZD_HUMIDITY,
|
||||||
|
AZD_MASTER,
|
||||||
AZD_MODE,
|
AZD_MODE,
|
||||||
AZD_MODES,
|
AZD_MODES,
|
||||||
AZD_NAME,
|
AZD_NAME,
|
||||||
@ -119,12 +120,8 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity):
|
|||||||
self.get_zone_value(AZD_TEMP_UNIT)
|
self.get_zone_value(AZD_TEMP_UNIT)
|
||||||
]
|
]
|
||||||
self._attr_hvac_modes = [
|
self._attr_hvac_modes = [
|
||||||
HVAC_MODE_LIB_TO_HASS[mode]
|
HVAC_MODE_LIB_TO_HASS[mode] for mode in self.get_zone_value(AZD_MODES)
|
||||||
for mode in self.get_zone_value(AZD_MODES)
|
|
||||||
or [self.get_zone_value(AZD_MODE)]
|
|
||||||
]
|
]
|
||||||
if HVAC_MODE_OFF not in self._attr_hvac_modes:
|
|
||||||
self._attr_hvac_modes.append(HVAC_MODE_OFF)
|
|
||||||
self._async_update_attrs()
|
self._async_update_attrs()
|
||||||
|
|
||||||
async def _async_update_hvac_params(self, params) -> None:
|
async def _async_update_hvac_params(self, params) -> None:
|
||||||
@ -147,7 +144,7 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity):
|
|||||||
if hvac_mode == HVAC_MODE_OFF:
|
if hvac_mode == HVAC_MODE_OFF:
|
||||||
params[API_ON] = 0
|
params[API_ON] = 0
|
||||||
else:
|
else:
|
||||||
if self.get_zone_value(AZD_MODES):
|
if self.get_zone_value(AZD_MASTER):
|
||||||
mode = HVAC_MODE_HASS_TO_LIB[hvac_mode]
|
mode = HVAC_MODE_HASS_TO_LIB[hvac_mode]
|
||||||
if mode != self.get_zone_value(AZD_MODE):
|
if mode != self.get_zone_value(AZD_MODE):
|
||||||
params[API_MODE] = mode
|
params[API_MODE] = mode
|
||||||
|
@ -5,7 +5,7 @@ from typing import Any
|
|||||||
|
|
||||||
from aioairzone.common import ConnectionOptions
|
from aioairzone.common import ConnectionOptions
|
||||||
from aioairzone.exceptions import InvalidHost
|
from aioairzone.exceptions import InvalidHost
|
||||||
from aioairzone.localapi_device import AirzoneLocalApi
|
from aioairzone.localapi import AirzoneLocalApi
|
||||||
from aiohttp.client_exceptions import ClientConnectorError
|
from aiohttp.client_exceptions import ClientConnectorError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from aioairzone.localapi_device import AirzoneLocalApi
|
from aioairzone.localapi import AirzoneLocalApi
|
||||||
from aiohttp.client_exceptions import ClientConnectorError
|
from aiohttp.client_exceptions import ClientConnectorError
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Airzone",
|
"name": "Airzone",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/airzone",
|
"documentation": "https://www.home-assistant.io/integrations/airzone",
|
||||||
"requirements": ["aioairzone==0.1.0"],
|
"requirements": ["aioairzone==0.2.1"],
|
||||||
"codeowners": ["@Noltari"],
|
"codeowners": ["@Noltari"],
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["aioairzone"]
|
"loggers": ["aioairzone"]
|
||||||
|
@ -110,7 +110,7 @@ aio_geojson_nsw_rfs_incidents==0.4
|
|||||||
aio_georss_gdacs==0.5
|
aio_georss_gdacs==0.5
|
||||||
|
|
||||||
# homeassistant.components.airzone
|
# homeassistant.components.airzone
|
||||||
aioairzone==0.1.0
|
aioairzone==0.2.1
|
||||||
|
|
||||||
# homeassistant.components.ambient_station
|
# homeassistant.components.ambient_station
|
||||||
aioambient==2021.11.0
|
aioambient==2021.11.0
|
||||||
|
@ -91,7 +91,7 @@ aio_geojson_nsw_rfs_incidents==0.4
|
|||||||
aio_georss_gdacs==0.5
|
aio_georss_gdacs==0.5
|
||||||
|
|
||||||
# homeassistant.components.airzone
|
# homeassistant.components.airzone
|
||||||
aioairzone==0.1.0
|
aioairzone==0.2.1
|
||||||
|
|
||||||
# homeassistant.components.ambient_station
|
# homeassistant.components.ambient_station
|
||||||
aioambient==2021.11.0
|
aioambient==2021.11.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user