diff --git a/modules/locationdata.py b/modules/locationdata.py index e2197bd..37d64a2 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -378,8 +378,10 @@ def alertBrodcast(): # get the latest weather alerts and broadcast them if there are any global wxAlertCache currentAlert = getWeatherAlerts(latitudeValue, longitudeValue) - - if currentAlert == ERROR_FETCHING_DATA or currentAlert == NO_DATA_NOGPS or currentAlert == NO_ALERTS: + # check if any reason to discard the alerts + if currentAlert == ERROR_FETCHING_DATA or currentAlert == NO_DATA_NOGPS: + return False + elif currentAlert == NO_ALERTS: wxAlertCache = "" return False # broadcast the alerts send to wxBrodcastCh diff --git a/modules/system.py b/modules/system.py index 3f5b8f7..cd8f087 100644 --- a/modules/system.py +++ b/modules/system.py @@ -641,7 +641,7 @@ def handleMultiPing(nodeID=0, deviceID=1): def handleWxBroadcast(deviceID=1): # only allow API call every 15 minutes clock = datetime.now() - if clock.minute % 15 == 0: + if clock.minute % 20 == 0: return False # check for alerts