1
mirror of https://github.com/home-assistant/core synced 2024-08-06 09:34:49 +02:00

Improve Tuya integration fan controller support (#73062)

This commit is contained in:
Alex Groleau 2022-06-22 18:58:36 -04:00 committed by GitHub
parent b0f4b3030f
commit fe54db6eb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -223,6 +223,7 @@ class DPCode(StrEnum):
FAN_SPEED = "fan_speed"
FAN_SPEED_ENUM = "fan_speed_enum" # Speed mode
FAN_SPEED_PERCENT = "fan_speed_percent" # Stepless speed
FAN_SWITCH = "fan_switch"
FAN_MODE = "fan_mode"
FAN_VERTICAL = "fan_vertical" # Vertical swing flap angle
FAR_DETECTION = "far_detection"

View File

@ -74,7 +74,7 @@ class TuyaFanEntity(TuyaEntity, FanEntity):
super().__init__(device, device_manager)
self._switch = self.find_dpcode(
(DPCode.SWITCH_FAN, DPCode.SWITCH), prefer_function=True
(DPCode.SWITCH_FAN, DPCode.FAN_SWITCH, DPCode.SWITCH), prefer_function=True
)
self._attr_preset_modes = []
@ -177,7 +177,6 @@ class TuyaFanEntity(TuyaEntity, FanEntity):
"value": int(self._speed.remap_value_from(percentage, 1, 100)),
}
)
return
if percentage is not None and self._speeds is not None:
commands.append(