Handle repeated GPSD position packets

master v1.5.2
Mark Jessop 2023-01-08 10:31:20 +11:00
rodzic 3b02f751f2
commit 8aec30178c
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -8,4 +8,4 @@
# Now using Semantic Versioning (https://semver.org/) MAJOR.MINOR.PATCH # Now using Semantic Versioning (https://semver.org/) MAJOR.MINOR.PATCH
__version__ = "1.5.1" __version__ = "1.5.2"

Wyświetl plik

@ -366,6 +366,8 @@ class GPSDAdaptor(object):
_gpsd_socket.watch(gpsd_protocol="json") _gpsd_socket.watch(gpsd_protocol="json")
logging.info("GPSD - Connected to GPSD instance at %s" % self.hostname) logging.info("GPSD - Connected to GPSD instance at %s" % self.hostname)
_old_state = {}
while self.gpsd_thread_running: while self.gpsd_thread_running:
# We should be getting GPS data every second. # We should be getting GPS data every second.
# If this isn't the case, we should close the connection and re-connect. # If this isn't the case, we should close the connection and re-connect.
@ -403,7 +405,10 @@ class GPSDAdaptor(object):
"valid": True, "valid": True,
} }
self.send_to_callback(_gps_state) if _gps_state != _old_state:
self.send_to_callback(_gps_state)
_old_state = _gps_state
# Close the GPSD connection. # Close the GPSD connection.
try: try: