From d46a72e5abf00ac7f4831564b251d0aaa1cd34be Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 18 Jul 2023 13:39:40 +0200 Subject: [PATCH] Migrate Zerproc to has entity naming (#96837) --- homeassistant/components/zerproc/light.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/zerproc/light.py b/homeassistant/components/zerproc/light.py index 5a32ca23332..41ecb751b86 100644 --- a/homeassistant/components/zerproc/light.py +++ b/homeassistant/components/zerproc/light.py @@ -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: