diff --git a/homeassistant/components/knx/fan.py b/homeassistant/components/knx/fan.py index f787795e1e8..21ede700fdd 100644 --- a/homeassistant/components/knx/fan.py +++ b/homeassistant/components/knx/fan.py @@ -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."""