mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-06 08:53:27 +02:00
Update mesh_bot.py
This commit is contained in:
+15
-12
@@ -648,25 +648,28 @@ def handleGolf(message, nodeID, deviceID):
|
||||
|
||||
def handle_riverFlow(message, message_from_id, deviceID):
|
||||
location = get_node_location(message_from_id, deviceID)
|
||||
if "riverflow " in message.lower():
|
||||
userRiver = message.split("userriver ")[1]
|
||||
userRiver = message.lower()
|
||||
|
||||
if "riverflow " in userRiver:
|
||||
userRiver = userRiver.split("riverflow ")[1] if "riverflow " in userRiver else riverListDefault
|
||||
else:
|
||||
# if riverListDefault has multiple pass on if just one river clean up
|
||||
if "," in riverListDefault:
|
||||
riverList = riverListDefault.split(",")
|
||||
userRiver = riverList[0].strip()
|
||||
else:
|
||||
userRiver = riverListDefault
|
||||
|
||||
userRiver = userRiver.split(",") if "," in userRiver else riverListDefault
|
||||
|
||||
# return river flow data
|
||||
if use_meteo_wxApi:
|
||||
return get_flood_openmeteo(location[0], location[1])
|
||||
else:
|
||||
for river in userRiver:
|
||||
river = river.strip()
|
||||
msg = get_flood_noaa(location[0], location[1], river)
|
||||
# if userRiver a list
|
||||
if type(userRiver) == list:
|
||||
msg = ""
|
||||
for river in userRiver:
|
||||
msg += get_flood_noaa(location[0], location[1], river)
|
||||
return msg
|
||||
# if single river
|
||||
msg = get_flood_noaa(location[0], location[1], userRiver)
|
||||
return msg
|
||||
|
||||
|
||||
def handle_wxc(message_from_id, deviceID, cmd):
|
||||
location = get_node_location(message_from_id, deviceID)
|
||||
if use_meteo_wxApi and not "wxc" in cmd and not use_metric:
|
||||
|
||||
Reference in New Issue
Block a user