Merge pull request #111 from sodoku/main

enable NINA alerts for Germany
This commit is contained in:
Kelly
2025-01-12 13:11:16 -08:00
committed by GitHub
5 changed files with 47 additions and 2 deletions
+12
View File
@@ -656,6 +656,7 @@ def handleMultiPing(nodeID=0, deviceID=1):
def handleAlertBroadcast(deviceID=1):
alertUk = NO_ALERTS
alertDe = NO_ALERTS
alertFema = NO_ALERTS
wxAlert = NO_ALERTS
# only allow API call every 20 minutes
@@ -671,6 +672,8 @@ def handleAlertBroadcast(deviceID=1):
alertWx = alertBrodcastNOAA()
if emergencyAlertBrodcastEnabled:
if enableDEalerts:
alertDe = get_nina_alerts()
if enableGBalerts:
alertUk = get_govUK_alerts()
else:
@@ -685,6 +688,7 @@ def handleAlertBroadcast(deviceID=1):
femaAlert = alertFema
ukAlert = alertUk
deAlert = alertDe
if emergencyAlertBrodcastEnabled:
if NO_ALERTS not in femaAlert and ERROR_FETCHING_DATA not in femaAlert:
@@ -701,6 +705,14 @@ def handleAlertBroadcast(deviceID=1):
else:
send_message(ukAlert, emergencyAlertBroadcastCh, 0, deviceID)
return True
if NO_ALERTS not in deAlert:
if isinstance(emergencyAlertBroadcastCh, list):
for channel in emergencyAlertBroadcastCh:
send_message(ukAlert, int(channel), 0, deviceID)
else:
send_message(ukAlert, emergencyAlertBroadcastCh, 0, deviceID)
return True
# pause for 10 seconds
time.sleep(10)