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():