mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Fix KNX Fan features (#52732)
* Fan entity should return support features * Revert "Fan entity should return support features" This reverts commit 3ad0e87708fbf1847aaa26e3bc76fcac365a1640. * Restore supported_features for KNX fan
This commit is contained in:
parent
f069fbdb25
commit
293690e3d8
@ -66,9 +66,6 @@ class KNXFan(KnxEntity, FanEntity):
|
||||
# FanSpeedMode.STEP if max_step is set
|
||||
self._step_range: tuple[int, int] | None = (1, max_step) if max_step else None
|
||||
|
||||
self._attr_supported_features = SUPPORT_SET_SPEED
|
||||
if self._device.supports_oscillation:
|
||||
self._attr_supported_features |= SUPPORT_OSCILLATE
|
||||
self._attr_unique_id = str(self._device.speed.group_address)
|
||||
|
||||
async def async_set_percentage(self, percentage: int) -> None:
|
||||
@ -79,6 +76,16 @@ class KNXFan(KnxEntity, FanEntity):
|
||||
else:
|
||||
await self._device.set_speed(percentage)
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
flags = SUPPORT_SET_SPEED
|
||||
|
||||
if self._device.supports_oscillation:
|
||||
flags |= SUPPORT_OSCILLATE
|
||||
|
||||
return flags
|
||||
|
||||
@property
|
||||
def percentage(self) -> int | None:
|
||||
"""Return the current speed as a percentage."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user