mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Fix google maps device_tracker same last seen timestamp (#99963)
* Update device_tracker.py This fix the google_maps does not show current location when HA started/restarted and also fix unnecessary update when last_seen timestamp is the same. Unnecessary update is causing proximity sensor switching from between stationary and certain direction. * Remove elif * Fix Black check * fix black check * Update device_tracker.py Better patch * Update device_tracker.py * Update device_tracker.py Fix Black * Update device_tracker.py change warning to debug
This commit is contained in:
parent
e1771ae01e
commit
d70cb8caa5
@ -112,12 +112,22 @@ class GoogleMapsScanner:
|
||||
|
||||
last_seen = dt_util.as_utc(person.datetime)
|
||||
if last_seen < self._prev_seen.get(dev_id, last_seen):
|
||||
_LOGGER.warning(
|
||||
_LOGGER.debug(
|
||||
"Ignoring %s update because timestamp is older than last timestamp",
|
||||
person.nickname,
|
||||
)
|
||||
_LOGGER.debug("%s < %s", last_seen, self._prev_seen[dev_id])
|
||||
continue
|
||||
if last_seen == self._prev_seen.get(dev_id, last_seen) and hasattr(
|
||||
self, "success_init"
|
||||
):
|
||||
_LOGGER.debug(
|
||||
"Ignoring %s update because timestamp "
|
||||
"is the same as the last timestamp %s",
|
||||
person.nickname,
|
||||
last_seen,
|
||||
)
|
||||
continue
|
||||
self._prev_seen[dev_id] = last_seen
|
||||
|
||||
attrs = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user