diff --git a/modules/settings.py b/modules/settings.py index 6f57033..a3f1e49 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -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) diff --git a/modules/system.py b/modules/system.py index da08291..ab49c7b 100644 --- a/modules/system.py +++ b/modules/system.py @@ -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