Fix for see service attributes (#4023)

This commit is contained in:
Bart274 2016-10-25 10:59:20 +02:00 committed by Johann Kellerman
parent 89e8fb4066
commit 53ea926292
2 changed files with 5 additions and 3 deletions

View File

@ -103,8 +103,7 @@ def see(hass: HomeAssistantType, mac: str=None, dev_id: str=None,
(ATTR_GPS_ACCURACY, gps_accuracy), (ATTR_GPS_ACCURACY, gps_accuracy),
(ATTR_BATTERY, battery)) if value is not None} (ATTR_BATTERY, battery)) if value is not None}
if attributes: if attributes:
for key, value in attributes: data[ATTR_ATTRIBUTES] = attributes
data[key] = value
hass.services.call(DOMAIN, SERVICE_SEE, data) hass.services.call(DOMAIN, SERVICE_SEE, data)

View File

@ -283,7 +283,10 @@ class TestComponentsDeviceTracker(unittest.TestCase):
'dev_id': 'some_device', 'dev_id': 'some_device',
'host_name': 'example.com', 'host_name': 'example.com',
'location_name': 'Work', 'location_name': 'Work',
'gps': [.3, .8] 'gps': [.3, .8],
'attributes': {
'test': 'test'
}
} }
device_tracker.see(self.hass, **params) device_tracker.see(self.hass, **params)
self.hass.block_till_done() self.hass.block_till_done()