From d1db7981dd52c43c71a1cf61eb4425ad58c35b6e Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 26 Jun 2024 11:23:21 -0700 Subject: [PATCH] Update mesh_bot.py --- mesh_bot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 2de83c9..17c1187 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -19,8 +19,8 @@ interface = meshtastic.serial_interface.SerialInterface() #serial interface #interface=meshtastic.ble_interface.BLEInterface("AA:BB:CC:DD:EE:FF") # BLE interface #A list of strings to trap and respond to -trap_list = ("ping","ack","testing","pong","motd","help","sun","solar","hfcond","lheard","sitrep", \ - "whereami","tide","moon","wx","joke","bbslist","bbspost","bbsread","bbsdelete","bbshelp") +trap_list = ("ping", "ack", "testing", "pong", "motd", "help", "sun", "solar", "hfcond", "lheard", "sitrep", \ + "whereami", "tide", "moon", "wx", "wxc", "joke", "bbslist", "bbspost", "bbsread", "bbsdelete", "bbshelp") welcome_message = "MeshBot, here for you like a friend who is not. Try sending: ping @foo or, help" help_message = "Commands are: ack, hfcond, joke, Lheard, moon, motd, ping, solar, sun, tide, whereami, wx, bbshelp" @@ -92,6 +92,10 @@ def auto_response(message, snr, rssi, hop, message_from_id): location = get_node_location(message_from_id) moon = get_moon(str(location[0]),str(location[1])) bot_response = moon + elif "wxc" in message.lower(): + location = get_node_location(message_from_id) + weather = get_weather(str(location[0]),str(location[1]),1) + bot_response = weather elif "wx" in message.lower(): location = get_node_location(message_from_id) weather = get_weather(str(location[0]),str(location[1]))