From bc9f2d21c4b621471f4012847ec5b94c8f53fb02 Mon Sep 17 00:00:00 2001 From: Job Vermeulen Date: Sun, 5 Mar 2017 21:38:14 +0100 Subject: [PATCH] Tado device_tracker exception when mobile device has geofencing enabled but location is currently unknown. (#6401) --- homeassistant/components/device_tracker/tado.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/device_tracker/tado.py b/homeassistant/components/device_tracker/tado.py index ca6e5d5ef7c..ca0bec29706 100644 --- a/homeassistant/components/device_tracker/tado.py +++ b/homeassistant/components/device_tracker/tado.py @@ -142,7 +142,7 @@ class TadoDeviceScanner(DeviceScanner): # Find devices that have geofencing enabled, and are currently at home. for mobile_device in tado_json: - if 'location' in mobile_device: + if mobile_device.get('location'): if mobile_device['location']['atHome']: device_id = mobile_device['id'] device_name = mobile_device['name']