Skip to content

Commit 1d0eb97

Browse files
authored
Fix KNX climate loading min/max temp from UI config (#155682)
1 parent 57f1c26 commit 1d0eb97

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

homeassistant/components/knx/climate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ def _create_climate_ui(xknx: XKNX, conf: ConfigExtractor, name: str) -> XknxClim
299299
group_address_active_state=conf.get_state_and_passive(CONF_GA_ACTIVE),
300300
group_address_command_value_state=conf.get_state_and_passive(CONF_GA_VALVE),
301301
sync_state=sync_state,
302-
min_temp=conf.get(ClimateConf.MIN_TEMP),
303-
max_temp=conf.get(ClimateConf.MAX_TEMP),
302+
min_temp=conf.get(CONF_TARGET_TEMPERATURE, ClimateConf.MIN_TEMP),
303+
max_temp=conf.get(CONF_TARGET_TEMPERATURE, ClimateConf.MAX_TEMP),
304304
mode=climate_mode,
305305
group_address_fan_speed=conf.get_write(CONF_GA_FAN_SPEED),
306306
group_address_fan_speed_state=conf.get_state_and_passive(CONF_GA_FAN_SPEED),
@@ -486,7 +486,7 @@ def hvac_modes(self) -> list[HVACMode]:
486486
ha_controller_modes.append(self._last_hvac_mode)
487487
ha_controller_modes.append(HVACMode.OFF)
488488

489-
hvac_modes = list(set(filter(None, ha_controller_modes)))
489+
hvac_modes = sorted(set(filter(None, ha_controller_modes)))
490490
return (
491491
hvac_modes
492492
if hvac_modes

tests/components/knx/test_climate.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,28 @@ async def test_climate_ui_load(knx: KNXTestKit) -> None:
10161016
knx.assert_state(
10171017
"climate.direct_indi_op_heat_cool",
10181018
HVACMode.HEAT,
1019+
current_temperature=20.0,
1020+
command_value=None,
1021+
min_temp=10.0,
1022+
max_temp=24.0,
1023+
target_temp_step=0.1,
1024+
preset_modes=["comfort", "standby", "economy", "building_protection"],
1025+
preset_mode="comfort",
1026+
hvac_modes=["cool", "heat", "off"],
1027+
hvac_action="heating",
1028+
supported_features=401,
10191029
)
10201030
knx.assert_state(
10211031
"climate.sps_op_mode_contr_mode",
10221032
HVACMode.COOL,
1033+
current_temperature=20.0,
1034+
command_value=13,
1035+
min_temp=14.0,
1036+
max_temp=30.0,
1037+
target_temp_step=0.5,
1038+
preset_modes=["comfort", "standby", "economy", "building_protection"],
1039+
preset_mode="comfort",
1040+
hvac_modes=["auto", "cool", "dry", "fan_only", "heat", "off"],
1041+
hvac_action="cooling",
1042+
supported_features=953,
10231043
)

0 commit comments

Comments
 (0)