Migrate Kulersky to has entity name (#96702)

This commit is contained in:
Joost Lekkerkerker 2023-07-17 09:12:07 +02:00 committed by GitHub
parent 088d04fe0f
commit f0fb09c2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,10 @@ async def async_setup_entry(
class KulerskyLight(LightEntity):
"""Representation of an Kuler Sky Light."""
"""Representation of a Kuler Sky Light."""
_attr_has_entity_name = True
_attr_name = None
def __init__(self, light: pykulersky.Light) -> None:
"""Initialize a Kuler Sky light."""
@ -88,11 +91,6 @@ class KulerskyLight(LightEntity):
"Exception disconnected from %s", self._light.address, exc_info=True
)
@property
def name(self):
"""Return the display name of this light."""
return self._light.name
@property
def unique_id(self):
"""Return the ID of this light."""
@ -104,7 +102,7 @@ class KulerskyLight(LightEntity):
return DeviceInfo(
identifiers={(DOMAIN, self.unique_id)},
manufacturer="Brightech",
name=self.name,
name=self._light.name,
)
@property