Automatic Device Tracker Bug Fix (#3330)

* Iterate over items

* Pass display name as host name
This commit is contained in:
Teagan Glenn authored and Paulus Schoutsen committed 2016-09-21 08:34:22 -07:00
1 parent 784cf0c4bd
commit a6673f6741
2 files changed
+3 -1

No files matched your search

@@ -338,7 +338,7 @@ class Device(Entity):
attr[ATTR_BATTERY] = self.battery
if self.attributes:
for key, value in self.attributes:
for key, value in self.attributes.items():
attr[key] = value
return attr
@@ -142,6 +142,7 @@ class AutomaticDeviceScanner(object):
for vehicle in self.last_results:
dev_id = vehicle.get('id')
host_name = vehicle.get('display_name')
attrs = {
'fuel_level': vehicle.get('fuel_level_percent')
@@ -149,6 +150,7 @@ class AutomaticDeviceScanner(object):
kwargs = {
'dev_id': dev_id,
'host_name': host_name,
'mac': dev_id,
ATTR_ATTRIBUTES: attrs
}