Add attribute last_seen
This commit is contained in:
parent
9ba8f1dd76
commit
1e2b4c796c
1 changed files with 5 additions and 0 deletions
|
@ -110,4 +110,9 @@ class SmartThingsDeviceTracker(DeviceTrackerEntity):
|
||||||
if self.subDeviceName:
|
if self.subDeviceName:
|
||||||
used_op, used_loc = get_sub_location(tag_data['ops'], self.subDeviceName)
|
used_op, used_loc = get_sub_location(tag_data['ops'], self.subDeviceName)
|
||||||
tag_data = tag_data | used_op | used_loc
|
tag_data = tag_data | used_op | used_loc
|
||||||
|
used_loc = tag_data.get('used_loc', {})
|
||||||
|
if used_loc:
|
||||||
|
tag_data['last_seen'] = used_loc.get('gps_date', None)
|
||||||
|
else:
|
||||||
|
tag_data['last_seen'] = None
|
||||||
return tag_data | device_data
|
return tag_data | device_data
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue