mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-05-08 14:24:28 +02:00
Update mesh-bot.py
This commit is contained in:
+3
-3
@@ -151,6 +151,7 @@ def onReceive(packet, interface):
|
||||
except KeyError as e:
|
||||
print(f"System: Error processing packet: {e}")
|
||||
print(packet) # print the packet for debugging
|
||||
print("END of packet \n")
|
||||
|
||||
def messageTrap(msg):
|
||||
message_list=msg.split(" ")
|
||||
@@ -194,11 +195,10 @@ def get_node_list():
|
||||
item = (node_name,last_heard)
|
||||
node_list.append(item)
|
||||
|
||||
#sort by last heard
|
||||
node_list.sort(key=lambda x: x[1], reverse=True)
|
||||
print (node_list)
|
||||
|
||||
#node_list.sort(key=lambda x: x[1], reverse=True)
|
||||
|
||||
|
||||
#return only the last 5 nodes
|
||||
return node_list[:5]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user