fixEAS Multi Channel

This commit is contained in:
SpudGunMan
2024-11-27 22:50:30 -08:00
parent 7e4822e4ec
commit afe48a44da
2 changed files with 9 additions and 4 deletions
+6 -1
View File
@@ -139,7 +139,12 @@ try:
wxAlertsEnabled = config['location'].getboolean('NOAAalertsEnabled', True) # default True not enabled yet
repeater_lookup = config['location'].get('repeaterLookup', 'rbook') # default repeater lookup source
wxAlertBroadcastEnabled = config['location'].getboolean('wxAlertBroadcastEnabled', False) # default False
wxAlertBroadcastChannel = config['location'].get('wxAlertBroadcastChannel', 2)
# brodcast channel for weather alerts
wxAlertBroadcastChannel = config['location'].get('wxAlertBroadcastCh')
if ',' in wxAlertBroadcastChannel:
wxAlertBroadcastChannel = config['location'].get('wxAlertBroadcastCh').split(',')
else:
wxAlertBroadcastChannel = config['location'].getint('wxAlertBroadcastCh', 2) # default 2
# bbs
bbs_enabled = config['bbs'].getboolean('enabled', False)
+3 -3
View File
@@ -603,9 +603,9 @@ def handleWxBroadcast(deviceID=1):
alert = alertBrodcast()
if alert:
msg = f"🚨 {alert[1]} EAS ALERTs: {alert[0]}"
if "," in wxAlertBroadcastChannel:
for channel in wxAlertBroadcastChannel.split(","):
send_message(msg, channel, 0, deviceID)
if isinstance(wxAlertBroadcastChannel, list):
for channel in wxAlertBroadcastChannel:
send_message(msg, int(channel), 0, deviceID)
else:
send_message(msg, wxAlertBroadcastChannel, 0, deviceID)
return True