Skip to content

Commit

Permalink
Migrate Dynalite to has entity name (home-assistant#96569)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Jul 18, 2023
1 parent 1097bde commit 65db77d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions homeassistant/components/dynalite/dynalitebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,15 @@ def async_add_entities_platform(devices):
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."""
Expand All @@ -68,7 +66,7 @@ def device_info(self) -> DeviceInfo:
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:
Expand Down

0 comments on commit 65db77d

Please sign in to comment.