From 15b5e935638c86252c91fffcd2d93ab152d78855 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 23 Aug 2024 22:21:54 -0500 Subject: [PATCH] Correctly format public key and add to node list --- meshtastic/mesh_interface.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index fa2781a..d6bbe0f 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -260,6 +260,7 @@ class MeshInterface: # pylint: disable=R0902 "AKA": user.get("shortName", "N/A"), "ID": user["id"], "Hardware": user.get("hwModel", "UNSET"), + "Pubkey": user.get("publicKey", "UNSET"), } ) @@ -782,6 +783,13 @@ class MeshInterface: # pylint: disable=R0902 return user.get("shortName", None) return None + def getPublicKey(self): + """Get Public Key""" + user = self.getMyUser() + if user is not None: + return user.get("publicKey", None) + return None + def _waitConnected(self, timeout=30.0): """Block until the initial node db download is complete, or timeout and raise an exception""" @@ -1066,7 +1074,10 @@ class MeshInterface: # pylint: disable=R0902 self.localNode.localConfig.bluetooth.CopyFrom( fromRadio.config.bluetooth ) - + elif fromRadio.config.HasField("security"): + self.localNode.localConfig.security.CopyFrom( + fromRadio.config.security + ) elif fromRadio.moduleConfig.HasField("mqtt"): self.localNode.moduleConfig.mqtt.CopyFrom(fromRadio.moduleConfig.mqtt) elif fromRadio.moduleConfig.HasField("serial"):