From 6afa49a441de6ce4fc8871fdf9406d853bd2035b Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 18 Jul 2023 20:39:37 +0200 Subject: [PATCH] Migrate Crownstone to has entity name (#96566) --- homeassistant/components/crownstone/devices.py | 1 + homeassistant/components/crownstone/light.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/crownstone/devices.py b/homeassistant/components/crownstone/devices.py index 427f88a1fb9..83aaac95393 100644 --- a/homeassistant/components/crownstone/devices.py +++ b/homeassistant/components/crownstone/devices.py @@ -12,6 +12,7 @@ class CrownstoneBaseEntity(Entity): """Base entity class for Crownstone devices.""" _attr_should_poll = False + _attr_has_entity_name = True def __init__(self, device: Crownstone) -> None: """Initialize the device.""" diff --git a/homeassistant/components/crownstone/light.py b/homeassistant/components/crownstone/light.py index c9cbeff90d5..a140de59017 100644 --- a/homeassistant/components/crownstone/light.py +++ b/homeassistant/components/crownstone/light.py @@ -71,6 +71,7 @@ class CrownstoneEntity(CrownstoneBaseEntity, LightEntity): """ _attr_icon = "mdi:power-socket-de" + _attr_name = None def __init__( self, crownstone_data: Crownstone, usb: CrownstoneUart | None = None @@ -79,7 +80,6 @@ class CrownstoneEntity(CrownstoneBaseEntity, LightEntity): super().__init__(crownstone_data) self.usb = usb # Entity class attributes - self._attr_name = str(self.device.name) self._attr_unique_id = f"{self.cloud_id}-{CROWNSTONE_SUFFIX}" @property