Skip to content

Commit

Permalink
🔧 fix for hass v2024.11 and older
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Feb 25, 2025
1 parent cd4bb77 commit fe92704
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/xiaomi_miot/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ def on_init(self):
self._attr_swing_modes = [SWING_ON, SWING_OFF]
self._attr_supported_features |= ClimateEntityFeature.SWING_MODE
elif prop.in_list(['horizontal_swing']):
self._conv_swing_h = conv
self._attr_swing_horizontal_modes = [SWING_ON, SWING_OFF]
self._attr_supported_features |= ClimateEntityFeature.SWING_HORIZONTAL_MODE
if hasattr(ClimateEntityFeature, 'SWING_HORIZONTAL_MODE'): # v2024.12
self._conv_swing_h = conv
self._attr_swing_horizontal_modes = [SWING_ON, SWING_OFF]
self._attr_supported_features |= ClimateEntityFeature.SWING_HORIZONTAL_MODE
elif prop.in_list(['target_temperature']):
self._conv_target_temp = conv
self._attr_min_temp = prop.range_min()
Expand Down

0 comments on commit fe92704

Please sign in to comment.