Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}

Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
Loading