From e0552ad89918efd95e5ab8f2e2373c8236955b00 Mon Sep 17 00:00:00 2001 From: Lewis Juggins Date: Sun, 11 Dec 2016 13:13:43 +0000 Subject: [PATCH] [device_tracker] Don't clear GPS coordinates if no GPS seen (#4848) --- homeassistant/components/device_tracker/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py index d497ea4c314..ba5e28ff48f 100644 --- a/homeassistant/components/device_tracker/__init__.py +++ b/homeassistant/components/device_tracker/__init__.py @@ -426,12 +426,11 @@ class Device(Entity): if attributes: self._attributes.update(attributes) - self.gps = None - if gps is not None: try: self.gps = float(gps[0]), float(gps[1]) except (ValueError, TypeError, IndexError): + self.gps = None _LOGGER.warning('Could not parse gps value for %s: %s', self.dev_id, gps)