mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02:00
Fix KNX Fan features (#52732)
* Fan entity should return support features
* Revert "Fan entity should return support features"
This reverts commit 3ad0e87708
.
* Restore supported_features for KNX fan
This commit is contained in:
@@ -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."""
|
||||
|
Reference in New Issue
Block a user