From ff9b76c9664d21a8ff9006695674a800d499a226 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Tue, 9 Sep 2025 12:08:59 -0700 Subject: [PATCH] Update locationdata.py --- modules/locationdata.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/locationdata.py b/modules/locationdata.py index 2c3c575..b98c35c 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -828,6 +828,9 @@ def distance(lat=0,lon=0,nodeID=0): howfarDB[nodeID] = [{'lat': lat, 'lon': lon, 'time': datetime.now()}] return "Starting Point Set" else: + #de-dupe points if same as last point + if howfarDB[nodeID][-1]['lat'] == lat and howfarDB[nodeID][-1]['lon'] == lon: + return "No movement detected" # calculate distance from last point in howfarDB last_point = howfarDB[nodeID][-1] lat1 = math.radians(last_point['lat'])