add to configure

This commit is contained in:
pdxlocations
2025-06-24 07:40:11 -07:00
parent 84417f0bb1
commit 308ac93399
2 changed files with 19 additions and 9 deletions

View File

@@ -362,7 +362,6 @@ def onConnected(interface):
print(f"Setting device owner short to {args.set_owner_short}")
interface.getNode(args.dest, False, **getNode_kwargs).setOwner(long_name=args.set_owner, short_name=args.set_owner_short)
# TODO: add to export-config and configure
if args.set_canned_message:
closeNow = True
waitForAckNak = True
@@ -371,7 +370,6 @@ def onConnected(interface):
args.set_canned_message
)
# TODO: add to export-config and configure
if args.set_ringtone:
closeNow = True
waitForAckNak = True
@@ -705,6 +703,16 @@ def onConnected(interface):
interface.getNode(args.dest, **getNode_kwargs).setURL(configuration["channelUrl"])
time.sleep(0.5)
if "canned_messages" in configuration:
print("Setting canned message messages to", configuration["canned_messages"])
interface.getNode(args.dest, **getNode_kwargs).set_canned_message(configuration["canned_messages"])
time.sleep(0.5)
if "ringtone" in configuration:
print("Setting ringtone to", configuration["ringtone"])
interface.getNode(args.dest, **getNode_kwargs).set_ringtone(configuration["ringtone"])
time.sleep(0.5)
if "location" in configuration:
alt = 0
lat = 0.0

View File

@@ -1078,15 +1078,17 @@ class MeshInterface: # pylint: disable=R0902
return None
def getCannedMessage(self):
"""Fetch and return the canned message from the local node."""
if hasattr(self, "localNode") and self.localNode:
return self.localNode.get_canned_message()
"""Get canned message"""
node = self.localNode
if node is not None:
return node.get_canned_message()
return None
def getRingtone(self):
"""Fetch and return the ringtone from the local node."""
if hasattr(self, "localNode") and self.localNode:
return self.localNode.get_ringtone()
"""Get ringtone"""
node = self.localNode
if node is not None:
return node.get_ringtone()
return None
def _waitConnected(self, timeout=30.0):