add gps_accuracy and battery information to the see function

the see function from device_tracker doesn't pass the gps_accuracy and the battery information to the see service, so this information gets lost.
This commit is contained in:
Bart274 2016-03-11 14:10:04 +01:00
parent ce82bd7515
commit 284a1fd08e

View file

@ -57,6 +57,7 @@ ATTR_DEV_ID = 'dev_id'
ATTR_HOST_NAME = 'host_name'
ATTR_LOCATION_NAME = 'location_name'
ATTR_GPS = 'gps'
ATTR_GPS_ACCURACY = 'gps_accuracy'
ATTR_BATTERY = 'battery'
DISCOVERY_PLATFORMS = {
@ -82,7 +83,9 @@ def see(hass, mac=None, dev_id=None, host_name=None, location_name=None,
(ATTR_DEV_ID, dev_id),
(ATTR_HOST_NAME, host_name),
(ATTR_LOCATION_NAME, location_name),
(ATTR_GPS, gps)) if value is not None}
(ATTR_GPS, gps),
(ATTR_GPS_ACCURACY, gps_accuracy),
(ATTR_BATTERY, battery)) if value is not None}
hass.services.call(DOMAIN, SERVICE_SEE, data)