mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Automatic Device Tracker Bug Fix (#3330)
* Iterate over items * Pass display name as host name
This commit is contained in:
parent
7bce8bc33f
commit
d6ca930427
@ -338,7 +338,7 @@ class Device(Entity):
|
|||||||
attr[ATTR_BATTERY] = self.battery
|
attr[ATTR_BATTERY] = self.battery
|
||||||
|
|
||||||
if self.attributes:
|
if self.attributes:
|
||||||
for key, value in self.attributes:
|
for key, value in self.attributes.items():
|
||||||
attr[key] = value
|
attr[key] = value
|
||||||
|
|
||||||
return attr
|
return attr
|
||||||
|
@ -142,6 +142,7 @@ class AutomaticDeviceScanner(object):
|
|||||||
|
|
||||||
for vehicle in self.last_results:
|
for vehicle in self.last_results:
|
||||||
dev_id = vehicle.get('id')
|
dev_id = vehicle.get('id')
|
||||||
|
host_name = vehicle.get('display_name')
|
||||||
|
|
||||||
attrs = {
|
attrs = {
|
||||||
'fuel_level': vehicle.get('fuel_level_percent')
|
'fuel_level': vehicle.get('fuel_level_percent')
|
||||||
@ -149,6 +150,7 @@ class AutomaticDeviceScanner(object):
|
|||||||
|
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'dev_id': dev_id,
|
'dev_id': dev_id,
|
||||||
|
'host_name': host_name,
|
||||||
'mac': dev_id,
|
'mac': dev_id,
|
||||||
ATTR_ATTRIBUTES: attrs
|
ATTR_ATTRIBUTES: attrs
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user