Use shorthand attributes in Nanoleaf (#99601)

This commit is contained in:
Joost Lekkerkerker 2023-09-04 15:18:48 +02:00 committed by GitHub
parent f1bb7c25db
commit 8dc05894a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,7 @@ class NanoleafLight(NanoleafEntity, LightEntity):
_attr_supported_color_modes = {ColorMode.COLOR_TEMP, ColorMode.HS}
_attr_supported_features = LightEntityFeature.EFFECT | LightEntityFeature.TRANSITION
_attr_name = None
_attr_icon = "mdi:triangle-outline"
def __init__(
self, nanoleaf: Nanoleaf, coordinator: DataUpdateCoordinator[None]
@ -83,11 +84,6 @@ class NanoleafLight(NanoleafEntity, LightEntity):
"""Return the list of supported effects."""
return self._nanoleaf.effects_list
@property
def icon(self) -> str:
"""Return the icon to use in the frontend, if any."""
return "mdi:triangle-outline"
@property
def is_on(self) -> bool:
"""Return true if light is on."""