Reuse node to prevent overwriting channel settings to be sent out over the admin channel

This commit is contained in:
Derek Arnold
2024-09-03 17:41:05 -05:00
parent bcce5687c5
commit aed4f25cf5

View File

@@ -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