2828 PRESET_MODES_TO_NAME ,
2929 SPEED_OFF ,
3030 SPEED_RANGE ,
31- SUPPORT_SET_SPEED ,
3231 FanEntityFeature ,
3332)
3433from zha .application .platforms .fan .helpers import (
@@ -65,7 +64,7 @@ class FanEntityInfo(BaseEntityInfo):
6564 """Fan entity info."""
6665
6766 preset_modes : list [str ]
68- supported_features : int
67+ supported_features : FanEntityFeature
6968 speed_count : int
7069 speed_list : list [str ]
7170
@@ -75,7 +74,11 @@ class BaseFan(BaseEntity):
7574
7675 PLATFORM = Platform .FAN
7776
78- _attr_supported_features = FanEntityFeature .SET_SPEED
77+ _attr_supported_features : FanEntityFeature = (
78+ FanEntityFeature .SET_SPEED
79+ | FanEntityFeature .TURN_OFF
80+ | FanEntityFeature .TURN_ON
81+ )
7982 _attr_translation_key : str = "fan"
8083
8184 @functools .cached_property
@@ -109,9 +112,9 @@ def speed_count(self) -> int:
109112 return int_states_in_range (self .speed_range )
110113
111114 @functools .cached_property
112- def supported_features (self ) -> int :
115+ def supported_features (self ) -> FanEntityFeature :
113116 """Flag supported features."""
114- return SUPPORT_SET_SPEED
117+ return self . _attr_supported_features
115118
116119 @property
117120 def is_on (self ) -> bool :
@@ -440,7 +443,12 @@ def default_on_percentage(self) -> int:
440443class KofFan (Fan ):
441444 """Representation of a fan made by King Of Fans."""
442445
443- _attr_supported_features = FanEntityFeature .SET_SPEED | FanEntityFeature .PRESET_MODE
446+ _attr_supported_features = (
447+ FanEntityFeature .SET_SPEED
448+ | FanEntityFeature .PRESET_MODE
449+ | FanEntityFeature .TURN_OFF
450+ | FanEntityFeature .TURN_ON
451+ )
444452
445453 @functools .cached_property
446454 def speed_range (self ) -> tuple [int , int ]:
0 commit comments