From 12d6032e3ae73c3109728b0209fc60c8d8e6c340 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 23 Jul 2024 18:21:14 -0700 Subject: [PATCH] Ignore 0, 0 fixes --- navpoint/usb.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/navpoint/usb.py b/navpoint/usb.py index ea4cb16..e60932f 100644 --- a/navpoint/usb.py +++ b/navpoint/usb.py @@ -29,14 +29,15 @@ def main(port, intercom): time = parsed_data.time date = parsed_data.date navpoint.content.content = f"""Navpoint1Position#icon{lon},{lat},0{date} {time} UTC""" - intercom.put( - "LocationUpdate", - { - "lat": lat, - "lon": lon, - "time": f"{date} {time} UTC", - }, - ) + if lat or lon: # ignore 0, 0 fixes + intercom.put( + "LocationUpdate", + { + "lat": lat, + "lon": lon, + "time": f"{date} {time} UTC", + }, + ) except AttributeError: pass