Splitting out true_defaults for moduleConfig in export_config() by Travis-L-R · Pull Request #858 · meshtastic/python
Background
The output of export_config() normally omits config values that have been set to false, because most protobuf config settings default to false anyway and therefore don't normally need to be set to false. But because some config values may default to true, PR #807 adjusted things that so that where specified "true default" settings have been set false for the node, then those specified settings will still export as false when using export_config().
The Issue
- The specified setting for the mqtt module has been included as if MQTTConfig were contained in LocalConfig but it's actually contained in ModuleConfig.
- This results in "mqtt: encryptionEnabled: false" always being present in the wrong section of the output of --export-config (which will then be ignored by --configure with a warning) and no mention of "mqtt: encryptionEnabled: false" in the correct section when it is set to false.
This adjustment adds a second "true_defaults" variable and set_missing_flags_false() call in relation to ModuleConfig, and sticks the mqtt default there.