mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 13:45:12 +02:00
[device_tracker] Don't clear GPS coordinates if no GPS seen (#4848)
This commit is contained in:
committed by
Johann Kellerman
parent
5c99dd0e3d
commit
e0552ad899
@@ -426,12 +426,11 @@ class Device(Entity):
|
|||||||
if attributes:
|
if attributes:
|
||||||
self._attributes.update(attributes)
|
self._attributes.update(attributes)
|
||||||
|
|
||||||
self.gps = None
|
|
||||||
|
|
||||||
if gps is not None:
|
if gps is not None:
|
||||||
try:
|
try:
|
||||||
self.gps = float(gps[0]), float(gps[1])
|
self.gps = float(gps[0]), float(gps[1])
|
||||||
except (ValueError, TypeError, IndexError):
|
except (ValueError, TypeError, IndexError):
|
||||||
|
self.gps = None
|
||||||
_LOGGER.warning('Could not parse gps value for %s: %s',
|
_LOGGER.warning('Could not parse gps value for %s: %s',
|
||||||
self.dev_id, gps)
|
self.dev_id, gps)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user