mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Migrate Zerproc to has entity naming (#96837)
This commit is contained in:
parent
5c54fa1ce1
commit
d46a72e5ab
@ -82,6 +82,8 @@ class ZerprocLight(LightEntity):
|
|||||||
_attr_color_mode = ColorMode.HS
|
_attr_color_mode = ColorMode.HS
|
||||||
_attr_icon = "mdi:string-lights"
|
_attr_icon = "mdi:string-lights"
|
||||||
_attr_supported_color_modes = {ColorMode.HS}
|
_attr_supported_color_modes = {ColorMode.HS}
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(self, light) -> None:
|
def __init__(self, light) -> None:
|
||||||
"""Initialize a Zerproc light."""
|
"""Initialize a Zerproc light."""
|
||||||
@ -106,11 +108,6 @@ class ZerprocLight(LightEntity):
|
|||||||
"Exception disconnecting from %s", self._light.address, exc_info=True
|
"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
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
"""Return the ID of this light."""
|
"""Return the ID of this light."""
|
||||||
@ -122,7 +119,7 @@ class ZerprocLight(LightEntity):
|
|||||||
return DeviceInfo(
|
return DeviceInfo(
|
||||||
identifiers={(DOMAIN, self.unique_id)},
|
identifiers={(DOMAIN, self.unique_id)},
|
||||||
manufacturer="Zerproc",
|
manufacturer="Zerproc",
|
||||||
name=self.name,
|
name=self._light.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user