mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-08 18:03:33 +02:00
cleanup a few things
This commit is contained in:
+6
-1
@@ -65,8 +65,13 @@ def auto_response(message, snr, rssi, hop, message_from_id, channel_number, devi
|
||||
bot_response = drap_xray_conditions() + "\n" + solar_conditions()
|
||||
elif "lheard" in message.lower() or "sitrep" in message.lower():
|
||||
bot_response = "Last heard:\n" + str(get_node_list(1))
|
||||
chutil1 = interface1.nodes.get(decimal_to_hex(myNodeNum1), {}).get("deviceMetrics", {}).get("channelUtilization", 0)
|
||||
if interface2_enabled:
|
||||
bot_response += "\nPort2:\n" + str(get_node_list(2))
|
||||
bot_response += "Port2:\n" + str(get_node_list(2))
|
||||
chutil2 = interface2.nodes.get(decimal_to_hex(myNodeNum2), {}).get("deviceMetrics", {}).get("channelUtilization", 0)
|
||||
bot_response += "Ch Use: " + str(chutil1) + "%"
|
||||
if interface2_enabled:
|
||||
bot_response += " P2:" + str(chutil2) + "%"
|
||||
elif "whereami" in message.lower():
|
||||
location = get_node_location(message_from_id, deviceID)
|
||||
where = where_am_i(str(location[0]),str(location[1]))
|
||||
|
||||
@@ -9,6 +9,7 @@ NO_ALERTS = "No weather alerts found."
|
||||
|
||||
# setup the global variables
|
||||
MESSAGE_CHUNK_SIZE = 160 # message chunk size for sending at high success rate
|
||||
SITREP_NODE_COUNT = 3 # number of nodes to report in the sitrep
|
||||
msg_history = [] # message history for the store and forward feature
|
||||
bbs_ban_list = [] # list of banned users
|
||||
bbs_admin_list = [] # list of admin users
|
||||
|
||||
+2
-2
@@ -197,9 +197,9 @@ def get_node_list(nodeInt=1):
|
||||
node_list2.sort(key=lambda x: x[1], reverse=True)
|
||||
|
||||
# make a nice list for the user
|
||||
for x in node_list1[:5]:
|
||||
for x in node_list1[:SITREP_NODE_COUNT]:
|
||||
short_node_list.append(f"{x[0]} SNR:{x[2]}")
|
||||
for x in node_list2[:5]:
|
||||
for x in node_list2[:SITREP_NODE_COUNT]:
|
||||
short_node_list.append(f"{x[0]} SNR:{x[2]}")
|
||||
|
||||
for x in short_node_list:
|
||||
|
||||
Reference in New Issue
Block a user