mirror of
https://github.com/meshtastic/python.git
synced 2025-12-29 02:47:53 -05:00
Add ensureSessionKey to setURL and setFixedPosition calls
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user