From 5fcdfdf8da252525884229e0f68afeb8a44a495a Mon Sep 17 00:00:00 2001 From: Alex X Date: Fri, 16 Feb 2024 13:50:35 +0300 Subject: [PATCH] Fix dual speed fan feature #1170 --- custom_components/sonoff/core/devices.py | 3 +-- custom_components/sonoff/fan.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/sonoff/core/devices.py b/custom_components/sonoff/core/devices.py index 3c7d16f7..94fb9a6c 100644 --- a/custom_components/sonoff/core/devices.py +++ b/custom_components/sonoff/core/devices.py @@ -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), @@ -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"): diff --git a/custom_components/sonoff/fan.py b/custom_components/sonoff/fan.py index fa43b204..a84c5d91 100644 --- a/custom_components/sonoff/fan.py +++ b/custom_components/sonoff/fan.py @@ -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]