fixDataReturn

This commit is contained in:
SpudGunMan
2024-07-10 16:05:07 -07:00
parent f408f5948c
commit cd166797d6
+5 -2
View File
@@ -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