From 53ea926292664ea78e615b67b2dcb912470edb08 Mon Sep 17 00:00:00 2001 From: Bart274 Date: Tue, 25 Oct 2016 10:59:20 +0200 Subject: [PATCH] Fix for see service attributes (#4023) --- homeassistant/components/device_tracker/__init__.py | 3 +-- tests/components/device_tracker/test_init.py | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py index 87b628b050b..12735940916 100644 --- a/homeassistant/components/device_tracker/__init__.py +++ b/homeassistant/components/device_tracker/__init__.py @@ -103,8 +103,7 @@ def see(hass: HomeAssistantType, mac: str=None, dev_id: str=None, (ATTR_GPS_ACCURACY, gps_accuracy), (ATTR_BATTERY, battery)) if value is not None} if attributes: - for key, value in attributes: - data[key] = value + data[ATTR_ATTRIBUTES] = attributes hass.services.call(DOMAIN, SERVICE_SEE, data) diff --git a/tests/components/device_tracker/test_init.py b/tests/components/device_tracker/test_init.py index 34f89d450eb..cb2da4c3f98 100644 --- a/tests/components/device_tracker/test_init.py +++ b/tests/components/device_tracker/test_init.py @@ -283,7 +283,10 @@ class TestComponentsDeviceTracker(unittest.TestCase): 'dev_id': 'some_device', 'host_name': 'example.com', 'location_name': 'Work', - 'gps': [.3, .8] + 'gps': [.3, .8], + 'attributes': { + 'test': 'test' + } } device_tracker.see(self.hass, **params) self.hass.block_till_done()