diff --git a/homeassistant/components/airzone/__init__.py b/homeassistant/components/airzone/__init__.py index 0070d76cc39..f1862da387f 100644 --- a/homeassistant/components/airzone/__init__.py +++ b/homeassistant/components/airzone/__init__.py @@ -11,6 +11,7 @@ from aioairzone.const import ( AZD_THERMOSTAT_FW, AZD_THERMOSTAT_MODEL, AZD_ZONES, + DEFAULT_SYSTEM_ID, ) from aioairzone.localapi import AirzoneLocalApi @@ -21,7 +22,7 @@ from homeassistant.helpers import aiohttp_client from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity -from .const import DEFAULT_SYSTEM_ID, DOMAIN, MANUFACTURER +from .const import DOMAIN, MANUFACTURER from .coordinator import AirzoneUpdateCoordinator PLATFORMS: list[Platform] = [Platform.BINARY_SENSOR, Platform.CLIMATE, Platform.SENSOR] diff --git a/homeassistant/components/airzone/config_flow.py b/homeassistant/components/airzone/config_flow.py index 7fca83456ee..1a7e1b50169 100644 --- a/homeassistant/components/airzone/config_flow.py +++ b/homeassistant/components/airzone/config_flow.py @@ -4,6 +4,7 @@ from __future__ import annotations from typing import Any from aioairzone.common import ConnectionOptions +from aioairzone.const import DEFAULT_PORT, DEFAULT_SYSTEM_ID from aioairzone.exceptions import AirzoneError, InvalidSystem from aioairzone.localapi import AirzoneLocalApi import voluptuous as vol @@ -13,18 +14,18 @@ from homeassistant.const import CONF_HOST, CONF_ID, CONF_PORT from homeassistant.data_entry_flow import FlowResult from homeassistant.helpers import aiohttp_client -from .const import DEFAULT_LOCAL_API_PORT, DEFAULT_SYSTEM_ID, DOMAIN +from .const import DOMAIN CONFIG_SCHEMA = vol.Schema( { vol.Required(CONF_HOST): str, - vol.Required(CONF_PORT, default=DEFAULT_LOCAL_API_PORT): int, + vol.Required(CONF_PORT, default=DEFAULT_PORT): int, } ) SYSTEM_ID_SCHEMA = vol.Schema( { vol.Required(CONF_HOST): str, - vol.Required(CONF_PORT, default=DEFAULT_LOCAL_API_PORT): int, + vol.Required(CONF_PORT, default=DEFAULT_PORT): int, vol.Required(CONF_ID, default=1): int, } ) diff --git a/homeassistant/components/airzone/const.py b/homeassistant/components/airzone/const.py index a8fcae18cef..345a07692c5 100644 --- a/homeassistant/components/airzone/const.py +++ b/homeassistant/components/airzone/const.py @@ -11,8 +11,6 @@ MANUFACTURER: Final = "Airzone" AIOAIRZONE_DEVICE_TIMEOUT_SEC: Final = 10 API_TEMPERATURE_STEP: Final = 0.5 -DEFAULT_LOCAL_API_PORT: Final = 3000 -DEFAULT_SYSTEM_ID: Final = 0 TEMP_UNIT_LIB_TO_HASS: Final[dict[TemperatureUnit, str]] = { TemperatureUnit.CELSIUS: TEMP_CELSIUS, diff --git a/homeassistant/components/airzone/manifest.json b/homeassistant/components/airzone/manifest.json index eff6a5af90f..0fde6d9452e 100644 --- a/homeassistant/components/airzone/manifest.json +++ b/homeassistant/components/airzone/manifest.json @@ -3,7 +3,7 @@ "name": "Airzone", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/airzone", - "requirements": ["aioairzone==0.3.6"], + "requirements": ["aioairzone==0.3.8"], "codeowners": ["@Noltari"], "iot_class": "local_polling", "loggers": ["aioairzone"] diff --git a/requirements_all.txt b/requirements_all.txt index a04c99d6835..5d37a000bdb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -110,7 +110,7 @@ aio_geojson_nsw_rfs_incidents==0.4 aio_georss_gdacs==0.7 # homeassistant.components.airzone -aioairzone==0.3.6 +aioairzone==0.3.8 # homeassistant.components.ambient_station aioambient==2021.11.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 9271281e3b7..99d51ecacc6 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -94,7 +94,7 @@ aio_geojson_nsw_rfs_incidents==0.4 aio_georss_gdacs==0.7 # homeassistant.components.airzone -aioairzone==0.3.6 +aioairzone==0.3.8 # homeassistant.components.ambient_station aioambient==2021.11.0 diff --git a/tests/components/airzone/test_binary_sensor.py b/tests/components/airzone/test_binary_sensor.py index 13582a3c724..2dd9daa8af7 100644 --- a/tests/components/airzone/test_binary_sensor.py +++ b/tests/components/airzone/test_binary_sensor.py @@ -15,7 +15,7 @@ async def test_airzone_create_binary_sensors(hass: HomeAssistant) -> None: assert state.state == STATE_OFF state = hass.states.get("binary_sensor.despacho_floor_demand") - assert state.state == STATE_OFF + assert state is None state = hass.states.get("binary_sensor.despacho_problem") assert state.state == STATE_OFF @@ -33,7 +33,7 @@ async def test_airzone_create_binary_sensors(hass: HomeAssistant) -> None: assert state.state == STATE_OFF state = hass.states.get("binary_sensor.dorm_2_floor_demand") - assert state.state == STATE_OFF + assert state is None state = hass.states.get("binary_sensor.dorm_2_problem") assert state.state == STATE_OFF @@ -42,7 +42,7 @@ async def test_airzone_create_binary_sensors(hass: HomeAssistant) -> None: assert state.state == STATE_ON state = hass.states.get("binary_sensor.dorm_ppal_floor_demand") - assert state.state == STATE_OFF + assert state.state == STATE_ON state = hass.states.get("binary_sensor.dorm_ppal_problem") assert state.state == STATE_OFF @@ -51,7 +51,7 @@ async def test_airzone_create_binary_sensors(hass: HomeAssistant) -> None: assert state.state == STATE_OFF state = hass.states.get("binary_sensor.salon_floor_demand") - assert state.state == STATE_OFF + assert state is None state = hass.states.get("binary_sensor.salon_problem") assert state.state == STATE_OFF diff --git a/tests/components/airzone/util.py b/tests/components/airzone/util.py index 5ad569a397b..c8c18d0ab24 100644 --- a/tests/components/airzone/util.py +++ b/tests/components/airzone/util.py @@ -86,13 +86,13 @@ HVAC_MOCK = { API_MODE: 3, API_COLD_STAGES: 1, API_COLD_STAGE: 1, - API_HEAT_STAGES: 1, - API_HEAT_STAGE: 1, + API_HEAT_STAGES: 3, + API_HEAT_STAGE: 3, API_HUMIDITY: 39, API_UNITS: 0, API_ERRORS: [], API_AIR_DEMAND: 1, - API_FLOOR_DEMAND: 0, + API_FLOOR_DEMAND: 1, }, { API_SYSTEM_ID: 1, @@ -106,8 +106,8 @@ HVAC_MOCK = { API_MODE: 3, API_COLD_STAGES: 1, API_COLD_STAGE: 1, - API_HEAT_STAGES: 1, - API_HEAT_STAGE: 1, + API_HEAT_STAGES: 2, + API_HEAT_STAGE: 2, API_HUMIDITY: 35, API_UNITS: 0, API_ERRORS: [],