Migrate Crownstone to has entity name (#96566)
This commit is contained in:
parent
ac06905b1c
commit
6afa49a441
2 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@ class CrownstoneBaseEntity(Entity):
|
||||||
"""Base entity class for Crownstone devices."""
|
"""Base entity class for Crownstone devices."""
|
||||||
|
|
||||||
_attr_should_poll = False
|
_attr_should_poll = False
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(self, device: Crownstone) -> None:
|
def __init__(self, device: Crownstone) -> None:
|
||||||
"""Initialize the device."""
|
"""Initialize the device."""
|
||||||
|
|
|
@ -71,6 +71,7 @@ class CrownstoneEntity(CrownstoneBaseEntity, LightEntity):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_attr_icon = "mdi:power-socket-de"
|
_attr_icon = "mdi:power-socket-de"
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, crownstone_data: Crownstone, usb: CrownstoneUart | None = None
|
self, crownstone_data: Crownstone, usb: CrownstoneUart | None = None
|
||||||
|
@ -79,7 +80,6 @@ class CrownstoneEntity(CrownstoneBaseEntity, LightEntity):
|
||||||
super().__init__(crownstone_data)
|
super().__init__(crownstone_data)
|
||||||
self.usb = usb
|
self.usb = usb
|
||||||
# Entity class attributes
|
# Entity class attributes
|
||||||
self._attr_name = str(self.device.name)
|
|
||||||
self._attr_unique_id = f"{self.cloud_id}-{CROWNSTONE_SUFFIX}"
|
self._attr_unique_id = f"{self.cloud_id}-{CROWNSTONE_SUFFIX}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue