From dfa29bbb7cbf01041e6548dc06f57386dabe9dc5 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Sat, 24 Aug 2024 21:50:44 -0700 Subject: [PATCH] Add ensureSessionKey to setURL and setFixedPosition calls --- meshtastic/node.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meshtastic/node.py b/meshtastic/node.py index 10c673c..fff8f8d 100644 --- a/meshtastic/node.py +++ b/meshtastic/node.py @@ -375,6 +375,7 @@ class Node: p = admin_pb2.AdminMessage() p.set_config.lora.CopyFrom(channelSet.lora_config) + self.ensureSessionKey() self._sendAdmin(p) def onResponseRequestRingtone(self, p): @@ -676,6 +677,7 @@ class Node: def setFixedPosition(self, lat: Union[int, float], lon: Union[int, float], alt: int): """Tell the node to set fixed position to the provided value and enable the fixed position setting""" + self.ensureSessionKey() if self != self.iface.localNode: logging.error("Setting position of remote nodes is not supported.") return None @@ -872,4 +874,4 @@ class Node: elif self.nodeNum.startswith("!"): nodeid = int(self.nodeNum[1:],16) if self.iface._getOrCreateByNum(nodeid).get("adminSessionPassKey") is None: - self.requestConfig(admin_pb2.AdminMessage.SESSIONKEY_CONFIG) \ No newline at end of file + self.requestConfig(admin_pb2.AdminMessage.SESSIONKEY_CONFIG)