Fix fan is_on status in xiaomi_miio (#146592)

This commit is contained in:
epenet 2025-06-12 12:18:23 +02:00 committed by Franck Nijhof
parent c3e3a36b4c
commit e7a88e99f9
No known key found for this signature in database
GPG Key ID: AB33ADACE7101952

View File

@ -330,6 +330,12 @@ class XiaomiGenericDevice(
"""Return the percentage based speed of the fan."""
return None
@property
def is_on(self) -> bool | None:
"""Return true if device is on."""
# Base FanEntity uses percentage to determine if the device is on.
return self._attr_is_on
async def async_turn_on(
self,
percentage: int | None = None,