mirror of
https://github.com/home-assistant/core.git
synced 2025-06-02 12:17:07 +00:00
Migrate Dynalite to has entity name (#96569)
This commit is contained in:
parent
1097bde71b
commit
65db77dd8a
@ -41,17 +41,15 @@ def async_setup_entry_base(
|
||||
class DynaliteBase(RestoreEntity, ABC):
|
||||
"""Base class for the Dynalite entities."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None
|
||||
|
||||
def __init__(self, device: Any, bridge: DynaliteBridge) -> None:
|
||||
"""Initialize the base class."""
|
||||
self._device = device
|
||||
self._bridge = bridge
|
||||
self._unsub_dispatchers: list[Callable[[], None]] = []
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Return the name of the entity."""
|
||||
return self._device.name
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return the unique ID of the entity."""
|
||||
@ -68,7 +66,7 @@ class DynaliteBase(RestoreEntity, ABC):
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, self._device.unique_id)},
|
||||
manufacturer="Dynalite",
|
||||
name=self.name,
|
||||
name=self._device.name,
|
||||
)
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user