Add GPSLogger device_info and unique_id (#24231)
This commit is contained in:
1 parent
0cdea28e2a
commit
dc8d4ac8e4
2 files changed
+47
No files matched your search
@@ -45,6 +45,7 @@ class GPSLoggerEntity(DeviceTrackerEntity):
|
||||
self._battery = battery
|
||||
self._location = location
|
||||
self._unsub_dispatcher = None
|
||||
self._unique_id = device
|
||||
|
||||
@property
|
||||
def battery_level(self):
|
||||
@@ -81,6 +82,19 @@ class GPSLoggerEntity(DeviceTrackerEntity):
|
||||
"""No polling needed."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Return the unique ID."""
|
||||
return self._unique_id
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return the device info."""
|
||||
return {
|
||||
'name': self._name,
|
||||
'identifiers': {(GPL_DOMAIN, self._unique_id)},
|
||||
}
|
||||
|
||||
@property
|
||||
def source_type(self):
|
||||
"""Return the source type, eg gps or router, of the device."""
|
||||
|
||||
Reference in new issue
Block a user