Skip to content

Commit 8a0fc47

Browse files
committed
Add required features
1 parent 4d6dbfe commit 8a0fc47

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

custom_components/zimi/fan.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def __init__(self, fan, debug=False) -> None:
5555

5656
self._attr_unique_id = fan.identifier
5757
self._attr_should_poll = False
58-
self._attr_supported_features = FanEntityFeature.SET_SPEED
58+
self._attr_supported_features = (
59+
FanEntityFeature.SET_SPEED
60+
| FanEntityFeature.TURN_OFF
61+
| FanEntityFeature.TURN_ON)
5962
self._fan = fan
6063
self._fan.subscribe(self)
6164
self._attr_device_info = DeviceInfo(
@@ -73,7 +76,8 @@ def __del__(self):
7376

7477
async def async_set_percentage(self, percentage: int) -> None:
7578
"""Set the desired speed for the fan."""
76-
_LOGGER.debug("Sending async_set_percentage() with percentage %s", percentage)
79+
_LOGGER.debug(
80+
"Sending async_set_percentage() with percentage %s", percentage)
7781

7882
if percentage == 0:
7983
await self.async_turn_off()

0 commit comments

Comments
 (0)