Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion 19 meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ def onConnected(interface):
if args.device_metadata:
closeNow = True
interface.getNode(args.dest).getMetadata()

if args.begin_edit:
closeNow = True
interface.getNode(args.dest, False).beginSettingsTransaction()

if args.commit_edit:
closeNow = True
interface.getNode(args.dest, False).commitSettingsTransaction()

if args.factory_reset:
closeNow = True
Expand Down Expand Up @@ -386,6 +394,8 @@ def onConnected(interface):
configuration = yaml.safe_load(file)
closeNow = True

interface.getNode(args.dest, False).beginSettingsTransaction()

if 'owner' in configuration:
print(f"Setting device owner to {configuration['owner']}")
waitForAckNak = True
Expand Down Expand Up @@ -444,7 +454,8 @@ def onConnected(interface):
for pref in configuration['module_config'][section]:
setPref(moduleConfig, f"{section}.{pref}", str(configuration['module_config'][section][pref]))
interface.getNode(args.dest).writeConfig(section)


interface.getNode(args.dest, False).commitSettingsTransaction()
print("Writing modified configuration to device")

if args.export_config:
Expand Down Expand Up @@ -935,6 +946,12 @@ def initParser():

parser.add_argument(
"--device-metadata", help="Get the device metadata from the node", action="store_true")

parser.add_argument(
"--begin-edit", help="Tell the node to open a transaction to edit settings", action="store_true")

parser.add_argument(
"--commit-edit", help="Tell the node to commit open settings transaction", action="store_true")

parser.add_argument(
"--factory-reset", help="Tell the destination node to install the default config", action="store_true")
Expand Down
12 changes: 6 additions & 6 deletions 12 meshtastic/admin_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.