From ccb530574babdeb30fd4cc77fbc6330e2a7ed268 Mon Sep 17 00:00:00 2001 From: Travis-L-R <> Date: Tue, 11 Nov 2025 21:03:01 +1030 Subject: [PATCH] Splitting true_defaults for moduleConfig out in export_config() --- meshtastic/__main__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index 68571f45..16854002 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -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)