diff --git a/config.template b/config.template index 86dc89a..d503094 100644 --- a/config.template +++ b/config.template @@ -138,6 +138,8 @@ riverListDefault = wxAlertBroadcastEnabled = False # EAS Alert Broadcast Channels wxAlertBroadcastCh = 2 +# Add extra location to the weather alert +enableExtraLocationWx = False # Goverment IPAWS/CAP Alert Broadcast eAlertBroadcastEnabled = False diff --git a/modules/locationdata.py b/modules/locationdata.py index 78cd6d6..7ab277d 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -360,7 +360,10 @@ def getWeatherAlertsNOAA(lat=0, lon=0, useDefaultLatLon=False): for i in alertxml.getElementsByTagName("entry"): title = i.getElementsByTagName("title")[0].childNodes[0].nodeValue area_desc = i.getElementsByTagName("cap:areaDesc")[0].childNodes[0].nodeValue - alerts += f"{title}. {area_desc.replace(' ', '')}\n" + if enableExtraLocationWx: + alerts += f"{title}. {area_desc.replace(' ', '')}\n" + else: + alerts += f"{title}\n" if alerts == "" or alerts == None: return NO_ALERTS diff --git a/modules/settings.py b/modules/settings.py index d095713..3a4c51f 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -241,6 +241,7 @@ try: mySAME = config['location'].get('mySAME', '').split(',') # default empty forecastDuration = config['location'].getint('NOAAforecastDuration', 4) # NOAA forcast days numWxAlerts = config['location'].getint('NOAAalertCount', 2) # default 2 alerts + enableExtraLocationWx = config['location'].getboolean('enableExtraLocationWx', False) # default False ipawsPIN = config['location'].get('ipawsPIN', '000000') # default 000000 ignoreFEMAtest = config['location'].getboolean('ignoreFEMAtest', True) # default True wxAlertBroadcastChannel = config['location'].get('wxAlertBroadcastCh', '2').split(',') # default Channel 2