Add btle_name attribute to devices (#19915)

* Update googlehome.py

Added name from bluetooth device to attributes

* Update homeassistant/components/device_tracker/googlehome.py

Check if key exists before assigning name

Co-Authored-By: cliffordwhansen <clifford@nighthawk.co.za>
This commit is contained in:
Clifford W. Hansen 2019-01-10 22:55:17 +02:00 committed by Joakim Sørensen
parent d859c3fa86
commit 616f23ae1d

View File

@ -89,5 +89,7 @@ class GoogleHomeDeviceScanner(DeviceScanner):
devices[uuid]['btle_mac_address'] = device['mac_address']
devices[uuid]['ghname'] = ghname
devices[uuid]['source_type'] = 'bluetooth'
if device['name']:
devices[uuid]['btle_name'] = device['name']
await self.scanner.clear_scan_result()
self.last_results = devices