Skip to content

Commit

Permalink
Move attributes to parent class
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Dec 14, 2024
1 parent 2ccd0bf commit 7499f90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions custom_components/bbox/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ def __init__(
"""Initialize."""
super().__init__(coordinator, description, device)

self._attr_name = self._device_name
self._attr_unique_id = f"{self._device_key}_device_tracker"

@property
def source_type(self) -> str:
"""Return the source type, eg gps or router, of the device."""
Expand Down
3 changes: 3 additions & 0 deletions custom_components/bbox/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def __init__(
self._device_name = device["hostname"]
else:
self._device_name = device["macaddress"]

self._attr_name = self._device_name
self._attr_unique_id = f"{self._device_key}_device_tracker"
self._attr_device_info = {
"name": self._device_name,
"identifiers": {(DOMAIN, self._device_key)},
Expand Down

0 comments on commit 7499f90

Please sign in to comment.