diff --git a/homeassistant/components/airzone/climate.py b/homeassistant/components/airzone/climate.py index c45f68d3d403..3be951acfb2a 100644 --- a/homeassistant/components/airzone/climate.py +++ b/homeassistant/components/airzone/climate.py @@ -25,6 +25,7 @@ from aioairzone.const import ( AZD_TEMP_MAX, AZD_TEMP_MIN, AZD_TEMP_SET, + AZD_TEMP_STEP, AZD_TEMP_UNIT, AZD_ZONES, ) @@ -48,7 +49,7 @@ from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback -from .const import API_TEMPERATURE_STEP, TEMP_UNIT_LIB_TO_HASS +from .const import TEMP_UNIT_LIB_TO_HASS from .coordinator import AirzoneConfigEntry, AirzoneUpdateCoordinator from .entity import AirzoneZoneEntity @@ -150,7 +151,7 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity): | ClimateEntityFeature.TURN_OFF | ClimateEntityFeature.TURN_ON ) - self._attr_target_temperature_step = API_TEMPERATURE_STEP + self._attr_target_temperature_step = self.get_airzone_value(AZD_TEMP_STEP) self._attr_temperature_unit = TEMP_UNIT_LIB_TO_HASS[ self.get_airzone_value(AZD_TEMP_UNIT) ] diff --git a/homeassistant/components/airzone/const.py b/homeassistant/components/airzone/const.py index 2263d5ab4a3a..6d6873f9e139 100644 --- a/homeassistant/components/airzone/const.py +++ b/homeassistant/components/airzone/const.py @@ -10,7 +10,6 @@ DOMAIN: Final = "airzone" MANUFACTURER: Final = "Airzone" AIOAIRZONE_DEVICE_TIMEOUT_SEC: Final = 10 -API_TEMPERATURE_STEP: Final = 0.5 TEMP_UNIT_LIB_TO_HASS: Final[dict[TemperatureUnit, str]] = { TemperatureUnit.CELSIUS: UnitOfTemperature.CELSIUS, diff --git a/tests/components/airzone/snapshots/test_diagnostics.ambr b/tests/components/airzone/snapshots/test_diagnostics.ambr index 19c05f52d8dc..316a6c01d458 100644 --- a/tests/components/airzone/snapshots/test_diagnostics.ambr +++ b/tests/components/airzone/snapshots/test_diagnostics.ambr @@ -36,6 +36,7 @@ 'speed': 0, 'speeds': 3, 'systemID': 1, + 'temp_step': 1, 'thermos_firmware': '3.51', 'thermos_radio': 0, 'thermos_type': 2, @@ -446,7 +447,7 @@ 'temp-max': 30.0, 'temp-min': 15.0, 'temp-set': 19.1, - 'temp-step': 0.5, + 'temp-step': 1.0, 'temp-unit': 0, 'thermostat-fw': '3.51', 'thermostat-model': 'Blueface Zero', diff --git a/tests/components/airzone/test_climate.py b/tests/components/airzone/test_climate.py index 12a73a6a268d..7c08a5bc92c4 100644 --- a/tests/components/airzone/test_climate.py +++ b/tests/components/airzone/test_climate.py @@ -19,7 +19,6 @@ from aioairzone.const import ( from aioairzone.exceptions import AirzoneError import pytest -from homeassistant.components.airzone.const import API_TEMPERATURE_STEP from homeassistant.components.airzone.coordinator import SCAN_INTERVAL from homeassistant.components.climate import ( ATTR_CURRENT_HUMIDITY, @@ -87,7 +86,7 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None: ] assert state.attributes.get(ATTR_MAX_TEMP) == 30 assert state.attributes.get(ATTR_MIN_TEMP) == 15 - assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP + assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 1.0 assert state.attributes.get(ATTR_TEMPERATURE) == 19.4 state = hass.states.get("climate.dorm_1") @@ -106,7 +105,7 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None: ] assert state.attributes.get(ATTR_MAX_TEMP) == 30 assert state.attributes.get(ATTR_MIN_TEMP) == 15 - assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP + assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5 assert state.attributes.get(ATTR_TEMPERATURE) == 19.3 state = hass.states.get("climate.dorm_2") @@ -125,7 +124,7 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None: ] assert state.attributes.get(ATTR_MAX_TEMP) == 30 assert state.attributes.get(ATTR_MIN_TEMP) == 15 - assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP + assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5 assert state.attributes.get(ATTR_TEMPERATURE) == 19.5 state = hass.states.get("climate.dorm_ppal") @@ -148,7 +147,7 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None: ] assert state.attributes.get(ATTR_MAX_TEMP) == 30 assert state.attributes.get(ATTR_MIN_TEMP) == 15 - assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP + assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5 assert state.attributes.get(ATTR_TEMPERATURE) == 19.2 state = hass.states.get("climate.salon") @@ -172,7 +171,7 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None: ] assert state.attributes.get(ATTR_MAX_TEMP) == 30 assert state.attributes.get(ATTR_MIN_TEMP) == 15 - assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP + assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 1.0 assert state.attributes.get(ATTR_TEMPERATURE) == 19.1 state = hass.states.get("climate.airzone_2_1") @@ -194,7 +193,7 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None: ] assert state.attributes.get(ATTR_MAX_TEMP) == 30 assert state.attributes.get(ATTR_MIN_TEMP) == 15 - assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP + assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5 assert state.attributes.get(ATTR_TEMPERATURE) == 19.0 state = hass.states.get("climate.dkn_plus") @@ -221,7 +220,7 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None: ] assert state.attributes.get(ATTR_MAX_TEMP) == 32.2 assert state.attributes.get(ATTR_MIN_TEMP) == 17.8 - assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP + assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 1.0 assert state.attributes.get(ATTR_TARGET_TEMP_HIGH) == 25.0 assert state.attributes.get(ATTR_TARGET_TEMP_LOW) == 22.8 @@ -239,7 +238,7 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None: ] assert state.attributes.get(ATTR_MAX_TEMP) == 30 assert state.attributes.get(ATTR_MIN_TEMP) == 15 - assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP + assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5 assert state.attributes.get(ATTR_TEMPERATURE) == 20.0 HVAC_MOCK_CHANGED = copy.deepcopy(HVAC_MOCK) diff --git a/tests/components/airzone/util.py b/tests/components/airzone/util.py index 7c35b39010a4..54982f66327a 100644 --- a/tests/components/airzone/util.py +++ b/tests/components/airzone/util.py @@ -48,6 +48,7 @@ from aioairzone.const import ( API_SYSTEM_ID, API_SYSTEM_TYPE, API_SYSTEMS, + API_TEMP_STEP, API_THERMOS_FIRMWARE, API_THERMOS_RADIO, API_THERMOS_TYPE, @@ -96,6 +97,7 @@ HVAC_MOCK = { API_ON: 0, API_MAX_TEMP: 30, API_MIN_TEMP: 15, + API_TEMP_STEP: 1, API_SET_POINT: 19.1, API_ROOM_TEMP: 19.6, API_SLEEP: 0,