Update mesh-bot.py

This commit is contained in:
SpudGunMan
2024-06-18 22:45:47 -07:00
parent abf6dbe815
commit 883c025fca

View File

@@ -183,10 +183,12 @@ def get_node_list():
for node in interface.nodes.values():
#ignore own
if node['num'] != myNodeNum:
node_list.append(get_name_from_number(node['num']))
#return only the last 5 nodes
return node_list[:5]
node_list.append(get_name_from_number(node['num']),node['lastHeard'])
#sort by last heard
node_list.sort(key=lambda x: x[1], reverse=True)
#return only the last 5 nodes 0 value is the name ignore last heard
node_list = [x[0] for x in node_list[:5]]
return node_list
else:
node_list.append("Nothing heard")
return node_list