Move shorthand attributes out of Snooz constructor (#99842)

This commit is contained in:
Joost Lekkerkerker 2023-09-07 19:49:18 +02:00 committed by GitHub
parent dcd00546ba
commit a00cbe2677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,15 +74,15 @@ class SnoozFan(FanEntity, RestoreEntity):
_attr_has_entity_name = True
_attr_name = None
_attr_supported_features = FanEntityFeature.SET_SPEED
_attr_should_poll = False
_is_on: bool | None = None
_percentage: int | None = None
def __init__(self, data: SnoozConfigurationData) -> None:
"""Initialize a Snooz fan entity."""
self._device = data.device
self._attr_unique_id = data.device.address
self._attr_supported_features = FanEntityFeature.SET_SPEED
self._attr_should_poll = False
self._is_on: bool | None = None
self._percentage: int | None = None
self._attr_device_info = DeviceInfo(identifiers={(DOMAIN, data.device.address)})
@callback