Skip to content

Commit

Permalink
Fix dual speed fan feature #1170
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Feb 16, 2024
1 parent 907c160 commit 5fcdfdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions custom_components/sonoff/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
DEVICE_CLASS = {
"binary_sensor": (XEntity, BinarySensorEntity),
"fan": (XToggleFan,), # using custom class for overriding is_on function
"dualfan": (XFanDualR3,),
"light": (XEntity, LightEntity),
"sensor": (XEntity, SensorEntity),
"switch": (XEntity, SwitchEntity),
Expand Down Expand Up @@ -424,7 +423,7 @@ def get_spec(device: dict) -> list:
# DualR3 in cover mode
if uiid in [126, 165] and device["params"].get("workMode") == 2:
classes = [cls for cls in classes if XSwitches not in cls.__bases__]
classes.insert(0, XCoverDualR3)
classes = [XCoverDualR3, XFanDualR3] + classes

# NSPanel Climate disable without switch configuration
if uiid in [133] and not device["params"].get("HMI_ATCDevice"):
Expand Down
1 change: 1 addition & 0 deletions custom_components/sonoff/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ async def async_set_percentage(self, percentage: int):
# noinspection PyAbstractClass
class XFanDualR3(XFan):
params = {"motorTurn"}
_attr_entity_registry_enabled_default = False
_attr_speed_count = 2
_attr_preset_modes = [SPEED_OFF, SPEED_LOW, SPEED_HIGH]

Expand Down

0 comments on commit 5fcdfdf

Please sign in to comment.