Migrate Zerproc to has entity naming (#96837)

pull/96820/head^2
Joost Lekkerkerker 2023-07-18 13:39:40 +02:00 committed by GitHub
parent 5c54fa1ce1
commit d46a72e5ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -82,6 +82,8 @@ class ZerprocLight(LightEntity):
_attr_color_mode = ColorMode.HS
_attr_icon = "mdi:string-lights"
_attr_supported_color_modes = {ColorMode.HS}
_attr_has_entity_name = True
_attr_name = None
def __init__(self, light) -> None:
"""Initialize a Zerproc light."""
@ -106,11 +108,6 @@ class ZerprocLight(LightEntity):
"Exception disconnecting 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."""
@ -122,7 +119,7 @@ class ZerprocLight(LightEntity):
return DeviceInfo(
identifiers={(DOMAIN, self.unique_id)},
manufacturer="Zerproc",
name=self.name,
name=self._light.name,
)
async def async_turn_on(self, **kwargs: Any) -> None: