From fca2f9f0008932baf64e2edfba362499f322e20a Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Tue, 18 Jun 2024 23:43:22 -0700 Subject: [PATCH] Update mesh-bot.py --- mesh-bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mesh-bot.py b/mesh-bot.py index 9cbc035..d8b6a21 100644 --- a/mesh-bot.py +++ b/mesh-bot.py @@ -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: