diff --git a/custom_components/xiaomi_miot/fan.py b/custom_components/xiaomi_miot/fan.py index c4b7b02bf..de11cfad7 100644 --- a/custom_components/xiaomi_miot/fan.py +++ b/custom_components/xiaomi_miot/fan.py @@ -79,6 +79,12 @@ def __init__(self, config: dict, miot_service: MiotService, **kwargs): self._prop_direction = miot_service.get_property('horizontal_angle', 'vertical_angle') self._prop_oscillate = miot_service.get_property('horizontal_swing', 'vertical_swing') + if self._prop_power: + if hasattr(FanEntityFeature, 'TURN_ON'): # v2024.8 + self._supported_features |= FanEntityFeature.TURN_ON + if hasattr(FanEntityFeature, 'TURN_OFF'): + self._supported_features |= FanEntityFeature.TURN_OFF + self._fan_control = miot_service.spec.get_service('fan_control') if self._fan_control: if not self._prop_speed: