GeoFency unique ID and device info (#24232)
This commit is contained in:
1 parent
3edc58a04e
commit
e6a54013dc
2 files changed
+20
No files matched your search
@@ -43,6 +43,7 @@ class GeofencyEntity(DeviceTrackerEntity):
|
||||
self._location_name = location_name
|
||||
self._gps = gps
|
||||
self._unsub_dispatcher = None
|
||||
self._unique_id = device
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
@@ -74,6 +75,19 @@ class GeofencyEntity(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': {(GF_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