diff --git a/homeassistant/components/knx/climate.py b/homeassistant/components/knx/climate.py index 70d78ce8fe7..8bdbc8d41e1 100644 --- a/homeassistant/components/knx/climate.py +++ b/homeassistant/components/knx/climate.py @@ -299,8 +299,8 @@ def _create_climate_ui(xknx: XKNX, conf: ConfigExtractor, name: str) -> XknxClim group_address_active_state=conf.get_state_and_passive(CONF_GA_ACTIVE), group_address_command_value_state=conf.get_state_and_passive(CONF_GA_VALVE), sync_state=sync_state, - min_temp=conf.get(ClimateConf.MIN_TEMP), - max_temp=conf.get(ClimateConf.MAX_TEMP), + min_temp=conf.get(CONF_TARGET_TEMPERATURE, ClimateConf.MIN_TEMP), + max_temp=conf.get(CONF_TARGET_TEMPERATURE, ClimateConf.MAX_TEMP), mode=climate_mode, group_address_fan_speed=conf.get_write(CONF_GA_FAN_SPEED), group_address_fan_speed_state=conf.get_state_and_passive(CONF_GA_FAN_SPEED), @@ -486,7 +486,7 @@ class _KnxClimate(ClimateEntity, _KnxEntityBase): ha_controller_modes.append(self._last_hvac_mode) ha_controller_modes.append(HVACMode.OFF) - hvac_modes = list(set(filter(None, ha_controller_modes))) + hvac_modes = sorted(set(filter(None, ha_controller_modes))) return ( hvac_modes if hvac_modes diff --git a/tests/components/knx/test_climate.py b/tests/components/knx/test_climate.py index a825f8c402a..68f0cc8384e 100644 --- a/tests/components/knx/test_climate.py +++ b/tests/components/knx/test_climate.py @@ -1016,8 +1016,28 @@ async def test_climate_ui_load(knx: KNXTestKit) -> None: knx.assert_state( "climate.direct_indi_op_heat_cool", HVACMode.HEAT, + current_temperature=20.0, + command_value=None, + min_temp=10.0, + max_temp=24.0, + target_temp_step=0.1, + preset_modes=["comfort", "standby", "economy", "building_protection"], + preset_mode="comfort", + hvac_modes=["cool", "heat", "off"], + hvac_action="heating", + supported_features=401, ) knx.assert_state( "climate.sps_op_mode_contr_mode", HVACMode.COOL, + current_temperature=20.0, + command_value=13, + min_temp=14.0, + max_temp=30.0, + target_temp_step=0.5, + preset_modes=["comfort", "standby", "economy", "building_protection"], + preset_mode="comfort", + hvac_modes=["auto", "cool", "dry", "fan_only", "heat", "off"], + hvac_action="cooling", + supported_features=953, )