From aed4f25cf59da8e6081452615fa754f990ad6844 Mon Sep 17 00:00:00 2001 From: Derek Arnold Date: Tue, 3 Sep 2024 17:41:05 -0500 Subject: [PATCH] Reuse node to prevent overwriting channel settings to be sent out over the admin channel --- meshtastic/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index e7886e6..f78155d 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -778,7 +778,8 @@ def onConnected(interface): channelIndex = mt_config.channel_index if channelIndex is None: meshtastic.util.our_exit("Warning: Need to specify '--ch-index'.", 1) - ch = interface.getNode(args.dest).channels[channelIndex] + node = interface.getNode(args.dest) + ch = node.channels[channelIndex] if args.ch_enable or args.ch_disable: print( @@ -836,7 +837,7 @@ def onConnected(interface): ch.role = channel_pb2.Channel.Role.DISABLED print(f"Writing modified channels to device") - interface.getNode(args.dest).writeChannel(channelIndex) + node.writeChannel(channelIndex) if args.get_canned_message: closeNow = True