diff --git a/README.md b/README.md index 235f9b8..ec2c43b 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,8 @@ This uses USA: SAME, FIPS, ZIP code to locate the alerts in the feed. By default ```ini eAlertBroadcastEnabled = False # Goverment IPAWS/CAP Alert Broadcast eAlertBroadcastCh = 2,3 # Goverment Emergency IPAWS/CAP Alert Broadcast Channels -ignoreFEMAtest = True # Ignore any headline that includes the word Test +ignoreFEMAtest = True # Ignore any headline that includes followig word list +ignoreFEMAwords = test,exercise # comma separated list of codes (e.g., SAME,FIPS,ZIP) trigger local alert. # find your SAME https://www.weather.gov/nwr/counties mySAME = 053029,053073 diff --git a/config.template b/config.template index 985e7be..d61e55c 100644 --- a/config.template +++ b/config.template @@ -147,8 +147,9 @@ eAlertBroadcastEnabled = False eAlertBroadcastCh = 2 # FEMA Alert Broadcast Settings -# Ignore any headline that includes the word Test +# Ignore any headline that includes followig word list ignoreFEMAtest = True +ignoreFEMAwords = test,exercise # comma separated list of codes (e.g., SAME,FIPS,ZIP) trigger local alert. # find your SAME https://www.weather.gov/nwr/counties mySAME = 053029,053073 diff --git a/modules/locationdata.py b/modules/locationdata.py index 806d0ff..924049e 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -533,9 +533,10 @@ def getIpawsAlert(lat=0, lon=0, shortAlerts = False): if (sameVal in mySAME) or (geocode_value in mySAME): # ignore the FEMA test alerts if ignoreFEMAtest: - if "Test" in headline: - logger.debug(f"System: Ignoring FEMA Test Alert: {headline} for {areaDesc}") - continue + for word in ignoreFEMAwords: + if word.lower() in headline.lower(): + logger.debug(f"System: Ignoring FEMA Alert: {headline} containing {word} at {areaDesc}") + continue # add to alerts list alerts.append({ diff --git a/modules/settings.py b/modules/settings.py index 66349b9..61b81e6 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -258,6 +258,7 @@ try: enableExtraLocationWx = config['location'].getboolean('enableExtraLocationWx', False) # default False ipawsPIN = config['location'].get('ipawsPIN', '000000') # default 000000 ignoreFEMAtest = config['location'].getboolean('ignoreFEMAtest', True) # default True + ignoreFEMAwords = config['location'].get('ignoreFEMAwords', 'test,exercise').split(',') # default test,exercise wxAlertBroadcastChannel = config['location'].get('wxAlertBroadcastCh', '2').split(',') # default Channel 2 emergencyAlertBroadcastCh = config['location'].get('eAlertBroadcastCh', '2').split(',') # default Channel 2