mirror of
https://github.com/meshtastic/python.git
synced 2026-01-10 00:37:55 -05:00
add to configure
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user