From ede95dafa270d3db94c258cbebd0faf9266a88f9 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Sun, 8 Dec 2024 17:22:54 +0100 Subject: [PATCH] Add missing mappings of module to serialized config Signed-off-by: Kai-Uwe Hermann --- src/manager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/manager.cpp b/src/manager.cpp index 94e600f6..908a352f 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -356,6 +356,7 @@ static std::map start_modules(ManagerConfig& config, MQTTAbs const std::string module_name = module.key(); json serialized_mod_config = serialized_config; serialized_mod_config["module_config"] = json::object(); + // add mappings of fulfillments serialized_mod_config["module_config"][module_name] = serialized_config.at("main").at(module_name); const auto fulfillments = config.get_fulfillments(module_name); serialized_mod_config["mappings"] = json::object(); @@ -367,6 +368,11 @@ static std::map start_modules(ManagerConfig& config, MQTTAbs } } } + // also add mappings of module + const auto mappings = config.get_module_3_tier_model_mappings(module_name); + if (mappings.has_value()) { + serialized_mod_config["mappings"][module_name] = mappings.value(); + } serialized_mod_config.erase("main"); // FIXME: do not put this "main" config in there in the first place const auto telemetry_config = config.get_telemetry_config(module_name); if (telemetry_config.has_value()) {