From d2fd1337435f621d41dba9c23206de13769e9fea Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 5 Jan 2025 21:50:36 -0800 Subject: [PATCH] extraLocation @turnrye another thing to check out --- config.template | 2 ++ modules/locationdata.py | 5 ++++- modules/settings.py | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) 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