From 616f23ae1d9f6f9f6cadb1ecb037db20f5651532 Mon Sep 17 00:00:00 2001 From: "Clifford W. Hansen" Date: Thu, 10 Jan 2019 22:55:17 +0200 Subject: [PATCH] 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 --- homeassistant/components/device_tracker/googlehome.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/device_tracker/googlehome.py b/homeassistant/components/device_tracker/googlehome.py index dabb92a0751..daa36d1d2c7 100644 --- a/homeassistant/components/device_tracker/googlehome.py +++ b/homeassistant/components/device_tracker/googlehome.py @@ -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