mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Update aioairzone to v0.1.0 (#68194)
This commit is contained in:
parent
984e30075b
commit
62c4fed549
@ -1,8 +1,10 @@
|
|||||||
"""The Airzone integration."""
|
"""The Airzone integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from aioairzone.common import ConnectionOptions
|
from aioairzone.common import ConnectionOptions
|
||||||
from aioairzone.const import AZD_ZONES
|
from aioairzone.const import AZD_ID, AZD_NAME, AZD_SYSTEM, AZD_ZONES
|
||||||
from aioairzone.localapi_device import AirzoneLocalApi
|
from aioairzone.localapi_device import AirzoneLocalApi
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -26,7 +28,7 @@ class AirzoneEntity(CoordinatorEntity):
|
|||||||
coordinator: AirzoneUpdateCoordinator,
|
coordinator: AirzoneUpdateCoordinator,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
system_zone_id: str,
|
system_zone_id: str,
|
||||||
zone_name: str,
|
zone_data: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
@ -34,9 +36,11 @@ class AirzoneEntity(CoordinatorEntity):
|
|||||||
self._attr_device_info: DeviceInfo = {
|
self._attr_device_info: DeviceInfo = {
|
||||||
"identifiers": {(DOMAIN, f"{entry.entry_id}_{system_zone_id}")},
|
"identifiers": {(DOMAIN, f"{entry.entry_id}_{system_zone_id}")},
|
||||||
"manufacturer": MANUFACTURER,
|
"manufacturer": MANUFACTURER,
|
||||||
"name": f"Airzone [{system_zone_id}] {zone_name}",
|
"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.system_zone_id = system_zone_id
|
||||||
|
self.zone_id = zone_data[AZD_ID]
|
||||||
|
|
||||||
def get_zone_value(self, key):
|
def get_zone_value(self, key):
|
||||||
"""Return zone value by key."""
|
"""Return zone value by key."""
|
||||||
|
@ -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.0.2"],
|
"requirements": ["aioairzone==0.1.0"],
|
||||||
"codeowners": ["@Noltari"],
|
"codeowners": ["@Noltari"],
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["aioairzone"]
|
"loggers": ["aioairzone"]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Support for the Airzone sensors."""
|
"""Support for the Airzone sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Final
|
from typing import Any, Final
|
||||||
|
|
||||||
from aioairzone.const import AZD_HUMIDITY, AZD_NAME, AZD_TEMP, AZD_TEMP_UNIT, AZD_ZONES
|
from aioairzone.const import AZD_HUMIDITY, AZD_NAME, AZD_TEMP, AZD_TEMP_UNIT, AZD_ZONES
|
||||||
|
|
||||||
@ -50,8 +50,6 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
sensors = []
|
sensors = []
|
||||||
for system_zone_id, zone_data in coordinator.data[AZD_ZONES].items():
|
for system_zone_id, zone_data in coordinator.data[AZD_ZONES].items():
|
||||||
zone_name = zone_data[AZD_NAME]
|
|
||||||
|
|
||||||
for description in SENSOR_TYPES:
|
for description in SENSOR_TYPES:
|
||||||
if description.key in zone_data:
|
if description.key in zone_data:
|
||||||
sensors.append(
|
sensors.append(
|
||||||
@ -60,7 +58,7 @@ async def async_setup_entry(
|
|||||||
description,
|
description,
|
||||||
entry,
|
entry,
|
||||||
system_zone_id,
|
system_zone_id,
|
||||||
zone_name,
|
zone_data,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -76,11 +74,11 @@ class AirzoneSensor(AirzoneEntity, SensorEntity):
|
|||||||
description: SensorEntityDescription,
|
description: SensorEntityDescription,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
system_zone_id: str,
|
system_zone_id: str,
|
||||||
zone_name: str,
|
zone_data: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
super().__init__(coordinator, entry, system_zone_id, zone_name)
|
super().__init__(coordinator, entry, system_zone_id, zone_data)
|
||||||
self._attr_name = f"{zone_name} {description.name}"
|
self._attr_name = f"{zone_data[AZD_NAME]} {description.name}"
|
||||||
self._attr_unique_id = f"{entry.entry_id}_{system_zone_id}_{description.key}"
|
self._attr_unique_id = f"{entry.entry_id}_{system_zone_id}_{description.key}"
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
|
|
||||||
|
@ -107,7 +107,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.0.2
|
aioairzone==0.1.0
|
||||||
|
|
||||||
# homeassistant.components.ambient_station
|
# homeassistant.components.ambient_station
|
||||||
aioambient==2021.11.0
|
aioambient==2021.11.0
|
||||||
|
@ -88,7 +88,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.0.2
|
aioairzone==0.1.0
|
||||||
|
|
||||||
# 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