Skip to content

Commit

Permalink
Fix disabling fan preset modes feature
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Feb 17, 2024
1 parent 54a6263 commit ceafb28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/sonoff/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class XFan(XEntity, FanEntity):
params = {"switches", "fan"}
_attr_speed_count = 3
_attr_supported_features = FanEntityFeature.SET_SPEED
_attr_preset_modes = [SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH]

def __init__(self, ewelink: XRegistry, device: XDevice) -> None:
super().__init__(ewelink, device)

if device.get("preset_mode", True):
self._attr_preset_modes = [SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH]
self._attr_supported_features |= FanEntityFeature.PRESET_MODE

def set_state(self, params: dict):
Expand Down

0 comments on commit ceafb28

Please sign in to comment.