From 8407512b0f2164ba7b6e8124ad704606cdf17131 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 4 Dec 2024 23:31:29 -0800 Subject: [PATCH] fineTuneEAS --- modules/locationdata.py | 6 ++++-- modules/system.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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