mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Update aioairzone-cloud to v0.6.0 (#122647)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
parent
72fdcd1cb1
commit
850703824b
@ -13,9 +13,12 @@ from aioairzone_cloud.const import (
|
|||||||
AZD_GROUPS,
|
AZD_GROUPS,
|
||||||
AZD_HOT_WATERS,
|
AZD_HOT_WATERS,
|
||||||
AZD_INSTALLATIONS,
|
AZD_INSTALLATIONS,
|
||||||
|
AZD_MODEL,
|
||||||
AZD_NAME,
|
AZD_NAME,
|
||||||
AZD_SYSTEM_ID,
|
AZD_SYSTEM_ID,
|
||||||
AZD_SYSTEMS,
|
AZD_SYSTEMS,
|
||||||
|
AZD_THERMOSTAT_FW,
|
||||||
|
AZD_THERMOSTAT_MODEL,
|
||||||
AZD_WEBSERVER,
|
AZD_WEBSERVER,
|
||||||
AZD_WEBSERVERS,
|
AZD_WEBSERVERS,
|
||||||
AZD_ZONES,
|
AZD_ZONES,
|
||||||
@ -69,6 +72,7 @@ class AirzoneAidooEntity(AirzoneEntity):
|
|||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, aidoo_id)},
|
identifiers={(DOMAIN, aidoo_id)},
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
|
model=aidoo_data[AZD_MODEL],
|
||||||
name=aidoo_data[AZD_NAME],
|
name=aidoo_data[AZD_NAME],
|
||||||
via_device=(DOMAIN, aidoo_data[AZD_WEBSERVER]),
|
via_device=(DOMAIN, aidoo_data[AZD_WEBSERVER]),
|
||||||
)
|
)
|
||||||
@ -111,6 +115,7 @@ class AirzoneGroupEntity(AirzoneEntity):
|
|||||||
|
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, group_id)},
|
identifiers={(DOMAIN, group_id)},
|
||||||
|
model="Group",
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
name=group_data[AZD_NAME],
|
name=group_data[AZD_NAME],
|
||||||
)
|
)
|
||||||
@ -154,6 +159,7 @@ class AirzoneHotWaterEntity(AirzoneEntity):
|
|||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, dhw_id)},
|
identifiers={(DOMAIN, dhw_id)},
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
|
model="Hot Water",
|
||||||
name=dhw_data[AZD_NAME],
|
name=dhw_data[AZD_NAME],
|
||||||
via_device=(DOMAIN, dhw_data[AZD_WEBSERVER]),
|
via_device=(DOMAIN, dhw_data[AZD_WEBSERVER]),
|
||||||
)
|
)
|
||||||
@ -195,6 +201,7 @@ class AirzoneInstallationEntity(AirzoneEntity):
|
|||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, inst_id)},
|
identifiers={(DOMAIN, inst_id)},
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
|
model="Installation",
|
||||||
name=inst_data[AZD_NAME],
|
name=inst_data[AZD_NAME],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -240,9 +247,11 @@ class AirzoneSystemEntity(AirzoneEntity):
|
|||||||
|
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, system_id)},
|
identifiers={(DOMAIN, system_id)},
|
||||||
|
model=system_data.get(AZD_MODEL),
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
name=system_data[AZD_NAME],
|
name=system_data[AZD_NAME],
|
||||||
via_device=(DOMAIN, system_data[AZD_WEBSERVER]),
|
via_device=(DOMAIN, system_data[AZD_WEBSERVER]),
|
||||||
|
sw_version=system_data.get(AZD_FIRMWARE),
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_airzone_value(self, key: str) -> Any:
|
def get_airzone_value(self, key: str) -> Any:
|
||||||
@ -270,6 +279,7 @@ class AirzoneWebServerEntity(AirzoneEntity):
|
|||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
connections={(dr.CONNECTION_NETWORK_MAC, ws_id)},
|
connections={(dr.CONNECTION_NETWORK_MAC, ws_id)},
|
||||||
identifiers={(DOMAIN, ws_id)},
|
identifiers={(DOMAIN, ws_id)},
|
||||||
|
model="WebServer",
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
name=ws_data[AZD_NAME],
|
name=ws_data[AZD_NAME],
|
||||||
sw_version=ws_data[AZD_FIRMWARE],
|
sw_version=ws_data[AZD_FIRMWARE],
|
||||||
@ -300,9 +310,11 @@ class AirzoneZoneEntity(AirzoneEntity):
|
|||||||
|
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, zone_id)},
|
identifiers={(DOMAIN, zone_id)},
|
||||||
|
model=zone_data.get(AZD_THERMOSTAT_MODEL),
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
name=zone_data[AZD_NAME],
|
name=zone_data[AZD_NAME],
|
||||||
via_device=(DOMAIN, self.system_id),
|
via_device=(DOMAIN, self.system_id),
|
||||||
|
sw_version=zone_data.get(AZD_THERMOSTAT_FW),
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_airzone_value(self, key: str) -> Any:
|
def get_airzone_value(self, key: str) -> Any:
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/airzone_cloud",
|
"documentation": "https://www.home-assistant.io/integrations/airzone_cloud",
|
||||||
"iot_class": "cloud_push",
|
"iot_class": "cloud_push",
|
||||||
"loggers": ["aioairzone_cloud"],
|
"loggers": ["aioairzone_cloud"],
|
||||||
"requirements": ["aioairzone-cloud==0.5.5"]
|
"requirements": ["aioairzone-cloud==0.6.0"]
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ aio-georss-gdacs==0.9
|
|||||||
aioairq==0.3.2
|
aioairq==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.airzone_cloud
|
# homeassistant.components.airzone_cloud
|
||||||
aioairzone-cloud==0.5.5
|
aioairzone-cloud==0.6.0
|
||||||
|
|
||||||
# homeassistant.components.airzone
|
# homeassistant.components.airzone
|
||||||
aioairzone==0.8.1
|
aioairzone==0.8.1
|
||||||
|
@ -161,7 +161,7 @@ aio-georss-gdacs==0.9
|
|||||||
aioairq==0.3.2
|
aioairq==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.airzone_cloud
|
# homeassistant.components.airzone_cloud
|
||||||
aioairzone-cloud==0.5.5
|
aioairzone-cloud==0.6.0
|
||||||
|
|
||||||
# homeassistant.components.airzone
|
# homeassistant.components.airzone
|
||||||
aioairzone==0.8.1
|
aioairzone==0.8.1
|
||||||
|
@ -114,6 +114,7 @@
|
|||||||
'installation': 'installation1',
|
'installation': 'installation1',
|
||||||
'is-connected': True,
|
'is-connected': True,
|
||||||
'mode': 3,
|
'mode': 3,
|
||||||
|
'model': 'Aidoo',
|
||||||
'modes': list([
|
'modes': list([
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
@ -156,6 +157,7 @@
|
|||||||
'installation': 'installation1',
|
'installation': 'installation1',
|
||||||
'is-connected': True,
|
'is-connected': True,
|
||||||
'mode': 2,
|
'mode': 2,
|
||||||
|
'model': 'Aidoo Pro',
|
||||||
'modes': list([
|
'modes': list([
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
@ -345,6 +347,7 @@
|
|||||||
'temperature-setpoint-max': 30.0,
|
'temperature-setpoint-max': 30.0,
|
||||||
'temperature-setpoint-min': 15.0,
|
'temperature-setpoint-min': 15.0,
|
||||||
'temperature-step': 0.5,
|
'temperature-step': 0.5,
|
||||||
|
'user-access': 'admin',
|
||||||
'web-servers': list([
|
'web-servers': list([
|
||||||
'webserver1',
|
'webserver1',
|
||||||
'webserver2',
|
'webserver2',
|
||||||
@ -370,10 +373,12 @@
|
|||||||
'_id': 'error-id',
|
'_id': 'error-id',
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
|
'firmware': '3.35',
|
||||||
'id': 'system1',
|
'id': 'system1',
|
||||||
'installation': 'installation1',
|
'installation': 'installation1',
|
||||||
'is-connected': True,
|
'is-connected': True,
|
||||||
'mode': 2,
|
'mode': 2,
|
||||||
|
'model': 'c6',
|
||||||
'modes': list([
|
'modes': list([
|
||||||
2,
|
2,
|
||||||
3,
|
3,
|
||||||
@ -494,6 +499,8 @@
|
|||||||
'temperature-setpoint-stop-air': 24.0,
|
'temperature-setpoint-stop-air': 24.0,
|
||||||
'temperature-setpoint-vent-air': 24.0,
|
'temperature-setpoint-vent-air': 24.0,
|
||||||
'temperature-step': 0.5,
|
'temperature-step': 0.5,
|
||||||
|
'thermostat-fw': '3.52',
|
||||||
|
'thermostat-model': 'blueface',
|
||||||
'web-server': 'webserver1',
|
'web-server': 'webserver1',
|
||||||
'ws-connected': True,
|
'ws-connected': True,
|
||||||
'zone': 1,
|
'zone': 1,
|
||||||
@ -557,6 +564,10 @@
|
|||||||
'temperature-setpoint-stop-air': 24.0,
|
'temperature-setpoint-stop-air': 24.0,
|
||||||
'temperature-setpoint-vent-air': 24.0,
|
'temperature-setpoint-vent-air': 24.0,
|
||||||
'temperature-step': 0.5,
|
'temperature-step': 0.5,
|
||||||
|
'thermostat-battery': 54,
|
||||||
|
'thermostat-coverage': 76,
|
||||||
|
'thermostat-fw': '3.33',
|
||||||
|
'thermostat-model': 'thinkradio',
|
||||||
'web-server': 'webserver1',
|
'web-server': 'webserver1',
|
||||||
'ws-connected': True,
|
'ws-connected': True,
|
||||||
'zone': 2,
|
'zone': 2,
|
||||||
|
@ -15,6 +15,7 @@ from .util import (
|
|||||||
GET_INSTALLATION_MOCK,
|
GET_INSTALLATION_MOCK,
|
||||||
GET_INSTALLATIONS_MOCK,
|
GET_INSTALLATIONS_MOCK,
|
||||||
WS_ID,
|
WS_ID,
|
||||||
|
mock_get_device_config,
|
||||||
mock_get_device_status,
|
mock_get_device_status,
|
||||||
mock_get_webserver,
|
mock_get_webserver,
|
||||||
)
|
)
|
||||||
@ -28,6 +29,10 @@ async def test_form(hass: HomeAssistant) -> None:
|
|||||||
"homeassistant.components.airzone_cloud.async_setup_entry",
|
"homeassistant.components.airzone_cloud.async_setup_entry",
|
||||||
return_value=True,
|
return_value=True,
|
||||||
) as mock_setup_entry,
|
) as mock_setup_entry,
|
||||||
|
patch(
|
||||||
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_config",
|
||||||
|
side_effect=mock_get_device_config,
|
||||||
|
),
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_status",
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_status",
|
||||||
side_effect=mock_get_device_status,
|
side_effect=mock_get_device_status,
|
||||||
@ -99,6 +104,10 @@ async def test_installations_list_error(hass: HomeAssistant) -> None:
|
|||||||
"homeassistant.components.airzone_cloud.async_setup_entry",
|
"homeassistant.components.airzone_cloud.async_setup_entry",
|
||||||
return_value=True,
|
return_value=True,
|
||||||
),
|
),
|
||||||
|
patch(
|
||||||
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_config",
|
||||||
|
side_effect=mock_get_device_config,
|
||||||
|
),
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_status",
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_status",
|
||||||
side_effect=mock_get_device_status,
|
side_effect=mock_get_device_status,
|
||||||
|
@ -14,6 +14,7 @@ from .util import (
|
|||||||
CONFIG,
|
CONFIG,
|
||||||
GET_INSTALLATION_MOCK,
|
GET_INSTALLATION_MOCK,
|
||||||
GET_INSTALLATIONS_MOCK,
|
GET_INSTALLATIONS_MOCK,
|
||||||
|
mock_get_device_config,
|
||||||
mock_get_device_status,
|
mock_get_device_status,
|
||||||
mock_get_webserver,
|
mock_get_webserver,
|
||||||
)
|
)
|
||||||
@ -32,6 +33,10 @@ async def test_coordinator_client_connector_error(hass: HomeAssistant) -> None:
|
|||||||
config_entry.add_to_hass(hass)
|
config_entry.add_to_hass(hass)
|
||||||
|
|
||||||
with (
|
with (
|
||||||
|
patch(
|
||||||
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_config",
|
||||||
|
side_effect=mock_get_device_config,
|
||||||
|
) as mock_device_config,
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_status",
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_status",
|
||||||
side_effect=mock_get_device_status,
|
side_effect=mock_get_device_status,
|
||||||
@ -56,11 +61,13 @@ async def test_coordinator_client_connector_error(hass: HomeAssistant) -> None:
|
|||||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
mock_device_config.assert_called()
|
||||||
mock_device_status.assert_called()
|
mock_device_status.assert_called()
|
||||||
mock_installation.assert_awaited_once()
|
mock_installation.assert_awaited_once()
|
||||||
mock_installations.assert_called_once()
|
mock_installations.assert_called_once()
|
||||||
mock_webserver.assert_called()
|
mock_webserver.assert_called()
|
||||||
|
|
||||||
|
mock_device_config.reset_mock()
|
||||||
mock_device_status.reset_mock()
|
mock_device_status.reset_mock()
|
||||||
mock_installation.reset_mock()
|
mock_installation.reset_mock()
|
||||||
mock_installations.reset_mock()
|
mock_installations.reset_mock()
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from aioairzone_cloud.common import OperationMode
|
from aioairzone_cloud.common import OperationMode, UserAccessType
|
||||||
from aioairzone_cloud.const import (
|
from aioairzone_cloud.const import (
|
||||||
|
API_ACCESS_TYPE,
|
||||||
API_ACTIVE,
|
API_ACTIVE,
|
||||||
API_AIR_ACTIVE,
|
API_AIR_ACTIVE,
|
||||||
API_AQ_ACTIVE,
|
API_AQ_ACTIVE,
|
||||||
@ -44,6 +45,8 @@ from aioairzone_cloud.const import (
|
|||||||
API_POWER,
|
API_POWER,
|
||||||
API_POWERFUL_MODE,
|
API_POWERFUL_MODE,
|
||||||
API_RAD_ACTIVE,
|
API_RAD_ACTIVE,
|
||||||
|
API_RADIO_BATTERY_PERCENT,
|
||||||
|
API_RADIO_COVERAGE_PERCENT,
|
||||||
API_RANGE_MAX_AIR,
|
API_RANGE_MAX_AIR,
|
||||||
API_RANGE_MIN_AIR,
|
API_RANGE_MIN_AIR,
|
||||||
API_RANGE_SP_MAX_ACS,
|
API_RANGE_SP_MAX_ACS,
|
||||||
@ -79,8 +82,12 @@ from aioairzone_cloud.const import (
|
|||||||
API_STAT_SSID,
|
API_STAT_SSID,
|
||||||
API_STATUS,
|
API_STATUS,
|
||||||
API_STEP,
|
API_STEP,
|
||||||
|
API_SYSTEM_FW,
|
||||||
API_SYSTEM_NUMBER,
|
API_SYSTEM_NUMBER,
|
||||||
|
API_SYSTEM_TYPE,
|
||||||
API_TANK_TEMP,
|
API_TANK_TEMP,
|
||||||
|
API_THERMOSTAT_FW,
|
||||||
|
API_THERMOSTAT_TYPE,
|
||||||
API_TYPE,
|
API_TYPE,
|
||||||
API_WARNINGS,
|
API_WARNINGS,
|
||||||
API_WS_CONNECTED,
|
API_WS_CONNECTED,
|
||||||
@ -184,6 +191,7 @@ GET_INSTALLATIONS_MOCK = {
|
|||||||
{
|
{
|
||||||
API_INSTALLATION_ID: CONFIG[CONF_ID],
|
API_INSTALLATION_ID: CONFIG[CONF_ID],
|
||||||
API_NAME: "House",
|
API_NAME: "House",
|
||||||
|
API_ACCESS_TYPE: UserAccessType.ADMIN,
|
||||||
API_WS_IDS: [
|
API_WS_IDS: [
|
||||||
WS_ID,
|
WS_ID,
|
||||||
WS_ID_AIDOO,
|
WS_ID_AIDOO,
|
||||||
@ -245,6 +253,30 @@ GET_WEBSERVER_MOCK_AIDOO_PRO = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def mock_get_device_config(device: Device) -> dict[str, Any]:
|
||||||
|
"""Mock API device config."""
|
||||||
|
|
||||||
|
if device.get_id() == "system1":
|
||||||
|
return {
|
||||||
|
API_SYSTEM_FW: "3.35",
|
||||||
|
API_SYSTEM_TYPE: "c6",
|
||||||
|
}
|
||||||
|
if device.get_id() == "zone1":
|
||||||
|
return {
|
||||||
|
API_THERMOSTAT_FW: "3.52",
|
||||||
|
API_THERMOSTAT_TYPE: "blueface",
|
||||||
|
}
|
||||||
|
if device.get_id() == "zone2":
|
||||||
|
return {
|
||||||
|
API_THERMOSTAT_FW: "3.33",
|
||||||
|
API_THERMOSTAT_TYPE: "thinkradio",
|
||||||
|
API_RADIO_BATTERY_PERCENT: 54,
|
||||||
|
API_RADIO_COVERAGE_PERCENT: 76,
|
||||||
|
}
|
||||||
|
|
||||||
|
return {}
|
||||||
|
|
||||||
|
|
||||||
def mock_get_device_status(device: Device) -> dict[str, Any]:
|
def mock_get_device_status(device: Device) -> dict[str, Any]:
|
||||||
"""Mock API device status."""
|
"""Mock API device status."""
|
||||||
|
|
||||||
@ -470,6 +502,10 @@ async def async_init_integration(
|
|||||||
config_entry.add_to_hass(hass)
|
config_entry.add_to_hass(hass)
|
||||||
|
|
||||||
with (
|
with (
|
||||||
|
patch(
|
||||||
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_config",
|
||||||
|
side_effect=mock_get_device_config,
|
||||||
|
),
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_status",
|
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_get_device_status",
|
||||||
side_effect=mock_get_device_status,
|
side_effect=mock_get_device_status,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user