Don't manipulate hvac modes based on device active mode in AVM Fritz!SmartHome (#145513)

This commit is contained in:
Michael 2025-05-23 16:12:13 +02:00 committed by GitHub
parent fc2fe32f34
commit 4747de4703
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -111,11 +111,9 @@ class FritzboxThermostat(FritzBoxDeviceEntity, ClimateEntity):
"""Write the state to the HASS state machine."""
if self.data.holiday_active:
self._attr_supported_features = ClimateEntityFeature.PRESET_MODE
self._attr_hvac_modes = [HVACMode.HEAT]
self._attr_preset_modes = [PRESET_HOLIDAY]
elif self.data.summer_active:
self._attr_supported_features = ClimateEntityFeature.PRESET_MODE
self._attr_hvac_modes = [HVACMode.OFF]
self._attr_preset_modes = [PRESET_SUMMER]
else:
self._attr_supported_features = SUPPORTED_FEATURES

View File

@ -609,7 +609,7 @@ async def test_holidy_summer_mode(
assert state
assert state.attributes[ATTR_STATE_HOLIDAY_MODE]
assert state.attributes[ATTR_STATE_SUMMER_MODE] is False
assert state.attributes[ATTR_HVAC_MODES] == [HVACMode.HEAT]
assert state.attributes[ATTR_HVAC_MODES] == [HVACMode.HEAT, HVACMode.OFF]
assert state.attributes[ATTR_PRESET_MODE] == PRESET_HOLIDAY
assert state.attributes[ATTR_PRESET_MODES] == [PRESET_HOLIDAY]
@ -645,7 +645,7 @@ async def test_holidy_summer_mode(
assert state
assert state.attributes[ATTR_STATE_HOLIDAY_MODE] is False
assert state.attributes[ATTR_STATE_SUMMER_MODE]
assert state.attributes[ATTR_HVAC_MODES] == [HVACMode.OFF]
assert state.attributes[ATTR_HVAC_MODES] == [HVACMode.HEAT, HVACMode.OFF]
assert state.attributes[ATTR_PRESET_MODE] == PRESET_SUMMER
assert state.attributes[ATTR_PRESET_MODES] == [PRESET_SUMMER]