From dc3d234eb90528a1d6c36806a4780fa8a9012e88 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Fri, 26 Jul 2024 10:39:36 -0700 Subject: [PATCH] Update locationdata.py --- modules/locationdata.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/locationdata.py b/modules/locationdata.py index 8aad611..d32e394 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -14,12 +14,13 @@ trap_list_location = ("whereami", "tide", "moon", "wx", "wxc", "wxa", "wxalert") def where_am_i(lat=0, lon=0): whereIam = "" grid = mh.to_maiden(float(lat), float(lon)) - # initialize Nominatim API - geolocator = Nominatim(user_agent="mesh-bot") - + if float(lat) == 0 and float(lon) == 0: return NO_DATA_NOGPS + # initialize Nominatim API + geolocator = Nominatim(user_agent="mesh-bot") + # Nomatim API call to get address if float(lat) == latitudeValue and float(lon) == longitudeValue: # redacted address when no GPS and using default location