NINA alerts

@sodoku 👀 branch for testing new alerts
This commit is contained in:
SpudGunMan
2025-01-12 13:22:30 -08:00
parent afa2bc4024
commit 12d94fb0dc
3 changed files with 14 additions and 16 deletions
+3 -11
View File
@@ -32,25 +32,17 @@ def get_nina_alerts():
try:
# get api.bund.dev alerts
alerts = []
for regionalKey in myRegionalKeys:
url = (
"https://nina.api.proxy.bund.dev/api31/dashboard/" + regionalKey + ".json"
)
for regionalKey in myRegionalKeysDE:
url = ("https://nina.api.proxy.bund.dev/api31/dashboard/" + regionalKey + ".json")
response = requests.get(url)
data = response.json()
for item in data:
title = item["i18nTitle"]["de"]
alerts.append(f"🚨 {title}")
return "\n".join(alerts) if alerts else NO_ALERTS
except Exception as e:
logger.warning("Error getting NINA alerts: " + str(e))
logger.warning("Error getting NINA DE alerts: " + str(e))
return NO_ALERTS
def get_wxUKgov():
+1 -1
View File
@@ -244,7 +244,7 @@ try:
enableDEalerts = config['location'].getboolean('enableDEalerts', False) # default False
wxAlertsEnabled = config['location'].getboolean('NOAAalertsEnabled', True) # default True
mySAME = config['location'].get('mySAME', '').split(',') # default empty
myRegionalKeys = config['location'].get('myRegionalKeys', '110000000000').split(',') # default city Berlin
myRegionalKeysDE = config['location'].get('myRegionalKeysDE', '110000000000').split(',') # default city Berlin
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