From 3be12c061137e8ed3f231e918d55d52157c55a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 16 Dec 2023 18:42:58 +0100 Subject: [PATCH] Fix Airzone temperature range on new climate card (#105830) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * airzone: climate: fix double setpoint Signed-off-by: Álvaro Fernández Rojas * tests: airzone: fix double setpoint temperature Signed-off-by: Álvaro Fernández Rojas * tests: airzone: fix swapped double setpoint Signed-off-by: Álvaro Fernández Rojas --------- Signed-off-by: Álvaro Fernández Rojas --- homeassistant/components/airzone/climate.py | 3 ++- .../airzone/snapshots/test_diagnostics.ambr | 8 ++++---- tests/components/airzone/test_climate.py | 11 ++++++----- tests/components/airzone/util.py | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/airzone/climate.py b/homeassistant/components/airzone/climate.py index 22172255b9b..f5a0e1b109e 100644 --- a/homeassistant/components/airzone/climate.py +++ b/homeassistant/components/airzone/climate.py @@ -248,7 +248,6 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity): self._attr_hvac_mode = HVACMode.OFF self._attr_max_temp = self.get_airzone_value(AZD_TEMP_MAX) self._attr_min_temp = self.get_airzone_value(AZD_TEMP_MIN) - self._attr_target_temperature = self.get_airzone_value(AZD_TEMP_SET) if self.supported_features & ClimateEntityFeature.FAN_MODE: self._attr_fan_mode = self._speeds.get(self.get_airzone_value(AZD_SPEED)) if self.supported_features & ClimateEntityFeature.TARGET_TEMPERATURE_RANGE: @@ -258,3 +257,5 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity): self._attr_target_temperature_low = self.get_airzone_value( AZD_HEAT_TEMP_SET ) + else: + self._attr_target_temperature = self.get_airzone_value(AZD_TEMP_SET) diff --git a/tests/components/airzone/snapshots/test_diagnostics.ambr b/tests/components/airzone/snapshots/test_diagnostics.ambr index 3dcdde52390..adf0176765c 100644 --- a/tests/components/airzone/snapshots/test_diagnostics.ambr +++ b/tests/components/airzone/snapshots/test_diagnostics.ambr @@ -188,7 +188,7 @@ 'coldStages': 0, 'coolmaxtemp': 90, 'coolmintemp': 64, - 'coolsetpoint': 73, + 'coolsetpoint': 77, 'errors': list([ ]), 'floor_demand': 0, @@ -196,7 +196,7 @@ 'heatStages': 0, 'heatmaxtemp': 86, 'heatmintemp': 50, - 'heatsetpoint': 77, + 'heatsetpoint': 73, 'humidity': 0, 'maxTemp': 90, 'minTemp': 64, @@ -645,7 +645,7 @@ 'cold-stage': 0, 'cool-temp-max': 90.0, 'cool-temp-min': 64.0, - 'cool-temp-set': 73.0, + 'cool-temp-set': 77.0, 'demand': True, 'double-set-point': True, 'floor-demand': False, @@ -653,7 +653,7 @@ 'heat-stage': 0, 'heat-temp-max': 86.0, 'heat-temp-min': 50.0, - 'heat-temp-set': 77.0, + 'heat-temp-set': 73.0, 'id': 1, 'master': True, 'mode': 7, diff --git a/tests/components/airzone/test_climate.py b/tests/components/airzone/test_climate.py index 34844e34370..f33d1a8b28a 100644 --- a/tests/components/airzone/test_climate.py +++ b/tests/components/airzone/test_climate.py @@ -221,7 +221,8 @@ 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_TEMPERATURE) == 22.8 + assert state.attributes.get(ATTR_TARGET_TEMP_HIGH) == 25.0 + assert state.attributes.get(ATTR_TARGET_TEMP_LOW) == 22.8 HVAC_MOCK_CHANGED = copy.deepcopy(HVAC_MOCK) HVAC_MOCK_CHANGED[API_SYSTEMS][0][API_DATA][0][API_MAX_TEMP] = 25 @@ -594,8 +595,8 @@ async def test_airzone_climate_set_temp_range(hass: HomeAssistant) -> None: { API_SYSTEM_ID: 3, API_ZONE_ID: 1, - API_COOL_SET_POINT: 68.0, - API_HEAT_SET_POINT: 77.0, + API_COOL_SET_POINT: 77.0, + API_HEAT_SET_POINT: 68.0, } ] } @@ -618,5 +619,5 @@ async def test_airzone_climate_set_temp_range(hass: HomeAssistant) -> None: ) state = hass.states.get("climate.dkn_plus") - assert state.attributes.get(ATTR_TARGET_TEMP_HIGH) == 20.0 - assert state.attributes.get(ATTR_TARGET_TEMP_LOW) == 25.0 + assert state.attributes.get(ATTR_TARGET_TEMP_HIGH) == 25.0 + assert state.attributes.get(ATTR_TARGET_TEMP_LOW) == 20.0 diff --git a/tests/components/airzone/util.py b/tests/components/airzone/util.py index a3454549e05..f83eceaae9c 100644 --- a/tests/components/airzone/util.py +++ b/tests/components/airzone/util.py @@ -245,10 +245,10 @@ HVAC_MOCK = { API_ZONE_ID: 1, API_NAME: "DKN Plus", API_ON: 1, - API_COOL_SET_POINT: 73, + API_COOL_SET_POINT: 77, API_COOL_MAX_TEMP: 90, API_COOL_MIN_TEMP: 64, - API_HEAT_SET_POINT: 77, + API_HEAT_SET_POINT: 73, API_HEAT_MAX_TEMP: 86, API_HEAT_MIN_TEMP: 50, API_MAX_TEMP: 90,