Skip to content

Commit

Permalink
Fan: add turn_on/off to support flags
Browse files Browse the repository at this point in the history
Issue #2164
  • Loading branch information
make-all committed Aug 27, 2024
1 parent 44dfe89 commit 52816db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/tuya_local/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def __init__(self, device: TuyaLocalDevice, config: TuyaEntityConfig):
self._support_flags |= FanEntityFeature.OSCILLATE
if self._direction_dps:
self._support_flags |= FanEntityFeature.DIRECTION
if self._switch_dps:
self._support_flags |= FanEntityFeature.TURN_ON | FanEntityFeature.TURN_OFF
# Until the deprecation period ends (eexpected 2025.2)
self._enable_turn_on_off_backwards_compatibility = False

@property
def supported_features(self):
Expand Down

0 comments on commit 52816db

Please sign in to comment.