mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix for see service attributes (#4023)
This commit is contained in:
parent
89e8fb4066
commit
53ea926292
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user