Add ensureSessionKey to setURL and setFixedPosition calls

This commit is contained in:
Ian McEwen
2024-08-24 21:50:44 -07:00
parent 5a06888cc7
commit dfa29bbb7c

View File

@@ -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)
self.requestConfig(admin_pb2.AdminMessage.SESSIONKEY_CONFIG)