Splitting true_defaults for moduleConfig out in export_config()

This commit is contained in:
Travis-L-R
2025-11-11 21:03:01 +10:30
parent dbc0101a7a
commit ccb530574b

View File

@@ -1147,13 +1147,16 @@ def export_config(interface) -> str:
configObj = {}
# A list of configuration keys that should be set to False if they are missing
true_defaults = {
config_true_defaults = {
("bluetooth", "enabled"),
("lora", "sx126xRxBoostedGain"),
("lora", "txEnabled"),
("lora", "usePreset"),
("position", "positionBroadcastSmartEnabled"),
("security", "serialEnabled"),
}
module_true_defaults = {
("mqtt", "encryptionEnabled"),
}
@@ -1215,7 +1218,7 @@ def export_config(interface) -> str:
else:
configObj["config"] = config
set_missing_flags_false(configObj["config"], true_defaults)
set_missing_flags_false(configObj["config"], config_true_defaults)
module_config = MessageToDict(interface.localNode.moduleConfig)
if module_config:
@@ -1229,6 +1232,8 @@ def export_config(interface) -> str:
else:
configObj["module_config"] = prefs
set_missing_flags_false(configObj["module_config"], module_true_defaults)
config_txt = "# start of Meshtastic configure yaml\n" #checkme - "config" (now changed to config_out)
#was used as a string here and a Dictionary above
config_txt += yaml.dump(configObj)