From 8cb05d38dbb63d062e24a0f293b51715f0cd2e0c Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Fri, 20 Dec 2024 21:26:16 -0800 Subject: [PATCH] Update system.py --- modules/system.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/system.py b/modules/system.py index 49f4115..2eaff9f 100644 --- a/modules/system.py +++ b/modules/system.py @@ -666,6 +666,9 @@ def handleMultiPing(nodeID=0, deviceID=1): def handleAlertBroadcast(deviceID=1): + alertUk = NO_ALERTS + alertFema = NO_ALERTS + wxAlert = NO_ALERTS # only allow API call every 20 minutes # the watchdog will call this function 3 times, seeing possible throttling on the API clock = datetime.now() @@ -678,18 +681,13 @@ def handleAlertBroadcast(deviceID=1): # check for alerts if wxAlertBroadcastEnabled: alertWx = alertBrodcastNOAA() - else: - alertWx = NO_ALERTS if emergencyAlertBrodcastEnabled: - alertFema = getIpawsAlert(latitudeValue,longitudeValue, shortAlerts=True) - else: - alertFema = NO_ALERTS - - if enableGBalerts: - alertUk = get_govUK_alerts() - else: - alertUk = NO_ALERTS + if enableGBalerts: + alertUk = get_govUK_alerts() + else: + # default USA alerts + alertFema = getIpawsAlert(latitudeValue,longitudeValue, shortAlerts=True) # format alert if alertWx: