From cd166797d674794543fa0963b1cf836214681fd5 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 10 Jul 2024 16:05:07 -0700 Subject: [PATCH] fixDataReturn --- modules/locationdata.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/locationdata.py b/modules/locationdata.py index 7dd225c..da9071b 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -121,7 +121,9 @@ def get_weather(lat=0, lon=0, unit=0): weather = weather[:-1] # get any alerts and return the count - alert, alert_num = getWeatherAlerts(lat, lon) + alerts = getWeatherAlerts(lat, lon) + alert = alerts[0] + alert_num = alerts[1] if alert_num > 0: # add the alert count warning to the weather weather = str(alert_num) + " local alerts!\n" + weather + "\n" + alert @@ -210,7 +212,8 @@ def getWeatherAlerts(lat=0, lon=0): alerts = abbreviate_weather(alerts) # return the first ALERT_COUNT alerts - return "\n".join(alerts.split("\n")[:ALERT_COUNT]), alert_num + data = "\n".join(alerts.split("\n")[:ALERT_COUNT]), alert_num + return data def getActiveWeatherAlertsDetail(lat=0, lon=0): # get the latest details of weather alerts from NOAA