config: implement group priority
Enable group priority.
Change-Id: I1777906e60d07420835ede904785071ee308c307
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/manager/json-parser.hpp b/manager/json-parser.hpp
index 47f0d00..e92dfbc 100644
--- a/manager/json-parser.hpp
+++ b/manager/json-parser.hpp
@@ -1,5 +1,6 @@
#include "config.h"
+#include "grouplayout.hpp"
#include "json-config.hpp"
#include "ledlayout.hpp"
@@ -129,10 +130,12 @@
tmpPath /= groupName;
auto objpath = tmpPath.string();
auto members = entry.value("members", empty);
+ int priority = entry.value("Priority", 0);
lg2::debug("config for '{GROUP}'", "GROUP", groupName);
phosphor::led::ActionSet ledActions{};
+ phosphor::led::Layout::GroupLayout groupLayout{};
for (const auto& member : members)
{
loadJsonConfigV1GroupMember(member, priorityMap, ledActions);
@@ -140,7 +143,10 @@
// Generated an std::unordered_map of LedGroupNames to std::set of LEDs
// containing the name and properties.
- ledMap.emplace(objpath, ledActions);
+ groupLayout.actionSet = ledActions;
+ groupLayout.priority = priority;
+
+ ledMap.emplace(objpath, groupLayout);
}
/** @brief Load JSON config and return led map (JSON version 1)