Migrate OwnTracks to has entity name (#96743)
* Migrate OwnTracks to has entity name * Fix test * Fix tests
This commit is contained in:
parent
8937884e33
commit
005e45edcc
1 changed files with 3 additions and 5 deletions
|
@ -59,6 +59,9 @@ async def async_setup_entry(
|
|||
class OwnTracksEntity(TrackerEntity, RestoreEntity):
|
||||
"""Represent a tracked device."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None
|
||||
|
||||
def __init__(self, dev_id, data=None):
|
||||
"""Set up OwnTracks entity."""
|
||||
self._dev_id = dev_id
|
||||
|
@ -108,11 +111,6 @@ class OwnTracksEntity(TrackerEntity, RestoreEntity):
|
|||
"""Return a location name for the current location of the device."""
|
||||
return self._data.get("location_name")
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the device."""
|
||||
return self._data.get("host_name")
|
||||
|
||||
@property
|
||||
def source_type(self) -> SourceType:
|
||||
"""Return the source type, eg gps or router, of the device."""
|
||||
|
|
Loading…
Add table
Reference in a new issue