Skip to content

Commit ccb5305

Browse files
author
Travis-L-R
committed
Splitting true_defaults for moduleConfig out in export_config()
1 parent dbc0101 commit ccb5305

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

meshtastic/__main__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,13 +1147,16 @@ def export_config(interface) -> str:
11471147
configObj = {}
11481148

11491149
# A list of configuration keys that should be set to False if they are missing
1150-
true_defaults = {
1150+
config_true_defaults = {
11511151
("bluetooth", "enabled"),
11521152
("lora", "sx126xRxBoostedGain"),
11531153
("lora", "txEnabled"),
11541154
("lora", "usePreset"),
11551155
("position", "positionBroadcastSmartEnabled"),
11561156
("security", "serialEnabled"),
1157+
}
1158+
1159+
module_true_defaults = {
11571160
("mqtt", "encryptionEnabled"),
11581161
}
11591162

@@ -1215,7 +1218,7 @@ def export_config(interface) -> str:
12151218
else:
12161219
configObj["config"] = config
12171220

1218-
set_missing_flags_false(configObj["config"], true_defaults)
1221+
set_missing_flags_false(configObj["config"], config_true_defaults)
12191222

12201223
module_config = MessageToDict(interface.localNode.moduleConfig)
12211224
if module_config:
@@ -1229,6 +1232,8 @@ def export_config(interface) -> str:
12291232
else:
12301233
configObj["module_config"] = prefs
12311234

1235+
set_missing_flags_false(configObj["module_config"], module_true_defaults)
1236+
12321237
config_txt = "# start of Meshtastic configure yaml\n" #checkme - "config" (now changed to config_out)
12331238
#was used as a string here and a Dictionary above
12341239
config_txt += yaml.dump(configObj)

0 commit comments

Comments
 (0)