Skip to content

Commit

Permalink
Add missing mappings of module to serialized config
Browse files Browse the repository at this point in the history
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
  • Loading branch information
hikinggrass committed Dec 8, 2024
1 parent bffe376 commit ede95da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ static std::map<pid_t, std::string> 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();
Expand All @@ -367,6 +368,11 @@ static std::map<pid_t, std::string> 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()) {
Expand Down

0 comments on commit ede95da

Please sign in to comment.