File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
core/ui/src/main/kotlin/org/meshtastic/core/ui/qr Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,16 @@ fun ScannedQrCodeDialog(
9595 val channelSet =
9696 remember(shouldReplace) {
9797 if (shouldReplace) {
98- incoming.copy { loraConfig = loraConfig.copy { configOkToMqtt = channels.loraConfig.configOkToMqtt } }
98+ // When replacing, apply the incoming LoRa configuration but preserve certain
99+ // locally safe fields such as MQTT flags and TX power. This prevents QR codes
100+ // from unintentionally overriding device-specific power limits (e.g. E22 caps).
101+ incoming.copy {
102+ loraConfig =
103+ loraConfig.copy {
104+ configOkToMqtt = channels.loraConfig.configOkToMqtt
105+ txPower = channels.loraConfig.txPower
106+ }
107+ }
99108 } else {
100109 channels.copy {
101110 // To guarantee consistent ordering, using a LinkedHashSet which iterates through
@@ -158,9 +167,6 @@ fun ScannedQrCodeDialog(
158167 if (current.txEnabled != new.txEnabled) {
159168 changes.add(" Transmit Enabled: ${current.txEnabled} -> ${new.txEnabled} " )
160169 }
161- if (current.txPower != new.txPower) {
162- changes.add(" Transmit Power: ${current.txPower} dBm -> ${new.txPower} dBm" )
163- }
164170 if (current.channelNum != new.channelNum) {
165171 changes.add(" Channel Number: ${current.channelNum} -> ${new.channelNum} " )
166172 }
You can’t perform that action at this time.
0 commit comments