for localization
This commit is contained in:
SpudGunMan
2024-07-31 22:49:16 -07:00
parent c3aa37036e
commit 72cd6c9209
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -131,7 +131,7 @@ def get_weather(lat=0, lon=0, unit=0):
# get any alerts and return the count
alerts = getWeatherAlerts(lat, lon)
if alerts == ERROR_FETCHING_DATA or alerts == NO_DATA_NOGPS:
if alerts == ERROR_FETCHING_DATA or alerts == NO_DATA_NOGPS or alerts == NO_ALERTS:
alert = ""
alert_num = 0
else:
@@ -213,7 +213,7 @@ def getWeatherAlerts(lat=0, lon=0):
)
if alerts == "" or alerts == None:
return "No weather alerts found."
return NO_ALERTS
# trim off last newline
if alerts[-1] == "\n":
+1
View File
@@ -5,6 +5,7 @@ NO_DATA_NOGPS = "No location data: does your device have GPS?"
ERROR_FETCHING_DATA = "error fetching data"
WELCOME_MSG = 'MeshBot, here for you like a friend who is not. Try sending: ping @foo or, cmd'
MOTD = 'Thanks for using MeshBOT! Have a good day!'
NO_ALERTS = "No weather alerts found."
# setup the global variables
MESSAGE_CHUNK_SIZE = 160 # message chunk size for sending at high success rate