mirror of
https://github.com/meshtastic/python.git
synced 2026-05-19 05:46:14 -04:00
if mac address is in nodes, format it like a valid mac address
This commit is contained in:
@@ -18,7 +18,7 @@ from google.protobuf.json_format import MessageToJson
|
||||
|
||||
import meshtastic.node
|
||||
from . import portnums_pb2, mesh_pb2
|
||||
from .util import stripnl, Timeout, our_exit, remove_keys_from_dict
|
||||
from .util import stripnl, Timeout, our_exit, remove_keys_from_dict, convert_mac_addr
|
||||
from .__init__ import LOCAL_ADDR, BROADCAST_NUM, BROADCAST_ADDR, ResponseHandler, publishingThread, OUR_APP_VERSION, protocols
|
||||
|
||||
class MeshInterface:
|
||||
@@ -87,6 +87,14 @@ class MeshInterface:
|
||||
# when the TBeam is first booted, it sometimes shows the 'raw' data
|
||||
# so, we will just remove any raw keys
|
||||
n2 = remove_keys_from_dict('raw', n)
|
||||
|
||||
# if we have 'macaddr', re-format it
|
||||
if 'macaddr' in n2['user']:
|
||||
val = n2['user']['macaddr']
|
||||
# decode the base64 value
|
||||
addr = convert_mac_addr(val)
|
||||
n2['user']['macaddr'] = addr
|
||||
|
||||
nodes = nodes + f" {stripnl(n2)}"
|
||||
infos = owner + myinfo + mesh + nodes
|
||||
print(infos)
|
||||
|
||||
Reference in New Issue
Block a user