config: implement group priority

Enable group priority.

Change-Id: I1777906e60d07420835ede904785071ee308c307
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/manager/grouplayout.hpp b/manager/grouplayout.hpp
new file mode 100644
index 0000000..fa932fa
--- /dev/null
+++ b/manager/grouplayout.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "ledlayout.hpp"
+
+#include <string>
+#include <unordered_map>
+
+namespace phosphor
+{
+namespace led
+{
+/** @namespace Layout
+ *  @brief Depicts the LED and their mappings and group actions
+ */
+namespace Layout
+{
+
+/** @brief Name of the Group and its properties
+ */
+struct GroupLayout
+{
+    int priority = 0;
+    ActionSet actionSet;
+};
+
+struct CompareGroupLayout
+{
+    bool operator()(const Layout::GroupLayout* lhs,
+                    const Layout::GroupLayout* rhs) const
+    {
+        return lhs->priority < rhs->priority;
+    };
+};
+
+} // namespace Layout
+
+using GroupMap = std::unordered_map<std::string, Layout::GroupLayout>;
+
+} // namespace led
+} // namespace phosphor
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)
diff --git a/manager/ledlayout.hpp b/manager/ledlayout.hpp
index 7fc896d..c11500f 100644
--- a/manager/ledlayout.hpp
+++ b/manager/ledlayout.hpp
@@ -51,7 +51,6 @@
 } // namespace Layout
 
 using ActionSet = std::set<Layout::LedAction>;
-using GroupMap = std::unordered_map<std::string, ActionSet>;
 
 } // namespace led
 } // namespace phosphor
diff --git a/manager/manager.cpp b/manager/manager.cpp
index ec02419..18d257b 100644
--- a/manager/manager.cpp
+++ b/manager/manager.cpp
@@ -37,16 +37,33 @@
 }
 
 // create the resulting new map from all currently asserted groups
-auto Manager::getNewMap(std::set<const ActionSet*> assertedGroups)
+static auto getNewMapWithGroupPriorities(
+    std::set<const Layout::GroupLayout*, Layout::CompareGroupLayout> sorted)
     -> std::map<LedName, Layout::LedAction>
 {
     std::map<LedName, Layout::LedAction> newState;
 
     // update the new map with the desired state
-    for (const auto it : assertedGroups)
+    for (const auto it : sorted)
     {
         // apply all led actions of that group to the map
-        for (auto action : *it)
+        for (Layout::LedAction action : it->actionSet)
+        {
+            newState[action.name] = action;
+        }
+    }
+    return newState;
+}
+
+static std::map<LedName, Layout::LedAction> getNewMapWithLEDPriorities(
+    std::set<const Layout::GroupLayout*> assertedGroups)
+{
+    std::map<LedName, Layout::LedAction> newState;
+    // update the new map with the desired state
+    for (const Layout::GroupLayout* it : assertedGroups)
+    {
+        // apply all led actions of that group to the map
+        for (Layout::LedAction action : it->actionSet)
         {
             applyGroupAction(newState, action);
         }
@@ -54,6 +71,38 @@
     return newState;
 }
 
+// create the resulting new map from all currently asserted groups
+std::map<LedName, Layout::LedAction>
+    Manager::getNewMap(std::set<const Layout::GroupLayout*> assertedGroups)
+{
+    std::map<LedName, Layout::LedAction> newState;
+
+    std::set<const Layout::GroupLayout*, Layout::CompareGroupLayout> sorted;
+
+    bool groupPriorities = false;
+
+    for (const Layout::GroupLayout* it : assertedGroups)
+    {
+        sorted.insert(it);
+
+        if (it->priority != 0)
+        {
+            groupPriorities = true;
+        }
+    }
+
+    if (groupPriorities)
+    {
+        newState = getNewMapWithGroupPriorities(sorted);
+    }
+    else
+    {
+        newState = getNewMapWithLEDPriorities(assertedGroups);
+    }
+
+    return newState;
+}
+
 // Assert -or- De-assert
 bool Manager::setGroupState(const std::string& path, bool assert,
                             ActionSet& ledsAssert, ActionSet& ledsDeAssert)
diff --git a/manager/manager.hpp b/manager/manager.hpp
index 24a6c17..ea37798 100644
--- a/manager/manager.hpp
+++ b/manager/manager.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "grouplayout.hpp"
 #include "ledlayout.hpp"
 #include "utils.hpp"
 
@@ -93,7 +94,7 @@
     }
 
     /* create the resulting map from all currently asserted groups */
-    static auto getNewMap(std::set<const ActionSet*> assertedGroups)
+    static auto getNewMap(std::set<const Layout::GroupLayout*> assertedGroups)
         -> std::map<LedName, Layout::LedAction>;
 
     /** @brief Given a group name, applies the action on the group
@@ -151,7 +152,7 @@
     DBusHandler dBusHandler;
 
     /** @brief Pointers to groups that are in asserted state */
-    std::set<const ActionSet*> assertedGroups;
+    std::set<const Layout::GroupLayout*> assertedGroups;
 
     /** Map of led name to current state */
     std::map<std::string, Layout::LedAction> ledStateMap;
diff --git a/test/led-test-map.hpp b/test/led-test-map.hpp
index 60d0363..8c58506 100644
--- a/test/led-test-map.hpp
+++ b/test/led-test-map.hpp
@@ -1,229 +1,250 @@
+#include "grouplayout.hpp"
 #include "ledlayout.hpp"
 
 static const phosphor::led::GroupMap singleLedOn = {
     {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
-     {
-         {"One", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+      }}},
 };
 
 static const phosphor::led::GroupMap singleLedBlink = {
     {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
-     {
-         {"One", phosphor::led::Layout::Action::Blink, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::Blink, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+      }}},
 };
 
 static const phosphor::led::GroupMap singleLedBlinkOverrideOn = {
     {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
-     {
-         {"One", phosphor::led::Layout::Action::Blink, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::Blink, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
 };
 
 static const phosphor::led::GroupMap multipleLedsOn = {
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
-     {
-         {"One", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Two", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Three", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Two", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Three", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
 };
 
 static const phosphor::led::GroupMap multipleLedsBlink = {
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
-     {
-         {"One", phosphor::led::Layout::Action::Blink, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-         {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-         {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::Blink, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+          {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+          {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+      }}},
 };
 
 static const phosphor::led::GroupMap multipleLedsOnAndBlink = {
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix",
-     {
-         {"One", phosphor::led::Layout::Action::Blink, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-         {"Two", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-         {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Four", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-         {"Five", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::Blink, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+          {"Two", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+          {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Four", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+          {"Five", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+      }}},
 };
 
 static const phosphor::led::GroupMap twoGroupsWithDistinctLEDsOn = {
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
-     {
-         {"One", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-         {"Two", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Three", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+          {"Two", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Three", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+      }}},
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
-     {
-         {"Four", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-         {"Five", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::Blink},
-         {"Six", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"Four", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+          {"Five", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::Blink},
+          {"Six", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
 };
 
 static const phosphor::led::GroupMap twoGroupsWithOneComonLEDOn = {
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
-     {
-         {"One", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Two", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Three", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Two", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Three", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
-     {
-         {"Four", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Three", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Six", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"Four", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Three", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Six", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
 };
 
 static const phosphor::led::GroupMap
     twoGroupsWithOneComonLEDOnOneLEDBlinkPriority = {
         {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
-         {
-             {"One", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Two", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
-              phosphor::led::Layout::Action::Blink},
-         }},
+         {0,
+          {
+              {"One", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Two", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+               phosphor::led::Layout::Action::Blink},
+          }}},
         {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
-         {
-             {"Four", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Three", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::Blink},
-             {"Six", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-         }},
+         {0,
+          {
+              {"Four", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Three", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::Blink},
+              {"Six", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+          }}},
 };
 
 static const phosphor::led::GroupMap twoGroupsWithOneComonLEDOnPriority = {
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
-     {
-         {"One", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Two", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Two", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
-     {
-         {"Four", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Three", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Six", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"Four", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Three", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Six", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
 };
 
 static const phosphor::led::GroupMap twoGroupsWithMultiplComonLEDOn = {
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
-     {
-         {"One", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Two", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Three", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"One", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Two", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Three", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
     {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
-     {
-         {"Two", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Six", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Three", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-         {"Seven", phosphor::led::Layout::Action::On, 0, 0,
-          phosphor::led::Layout::Action::On},
-     }},
+     {0,
+      {
+          {"Two", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Six", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Three", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+          {"Seven", phosphor::led::Layout::Action::On, 0, 0,
+           phosphor::led::Layout::Action::On},
+      }}},
 };
 
 static const phosphor::led::GroupMap
     twoGroupsWithMultipleComonLEDInDifferentState = {
         {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
-         {
-             {"One", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Four", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-         }},
+         {0,
+          {
+              {"One", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Four", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+          }}},
         {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
-         {
-             {"Two", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Five", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Six", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-         }},
+         {0,
+          {
+              {"Two", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Five", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Six", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+          }}},
 };
 
 static const phosphor::led::GroupMap
     twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority = {
         {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
-         {
-             {"One", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Three", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::Blink},
-             {"Four", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Ten", phosphor::led::Layout::Action::Blink, 0, 0,
-              phosphor::led::Layout::Action::Blink},
-         }},
+         {0,
+          {
+              {"One", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Three", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::Blink},
+              {"Four", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Ten", phosphor::led::Layout::Action::Blink, 0, 0,
+               phosphor::led::Layout::Action::Blink},
+          }}},
         {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
-         {
-             {"Two", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Three", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::Blink},
-             {"Five", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Six", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::On},
-             {"Ten", phosphor::led::Layout::Action::On, 0, 0,
-              phosphor::led::Layout::Action::Blink},
-         }},
+         {0,
+          {
+              {"Two", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Three", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::Blink},
+              {"Five", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Six", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::On},
+              {"Ten", phosphor::led::Layout::Action::On, 0, 0,
+               phosphor::led::Layout::Action::Blink},
+          }}},
 };
diff --git a/test/utest-led-json.cpp b/test/utest-led-json.cpp
index 853f4d1..36eb404 100644
--- a/test/utest-led-json.cpp
+++ b/test/utest-led-json.cpp
@@ -16,9 +16,9 @@
     ASSERT_EQ(ledMap.contains(powerOn), true);
     ASSERT_EQ(ledMap.contains(enclosureIdentify), true);
 
-    auto& bmcBootedActions = ledMap.at(bmcBooted);
-    auto& powerOnActions = ledMap.at(powerOn);
-    auto& enclosureIdentifyActions = ledMap.at(enclosureIdentify);
+    auto& bmcBootedActions = ledMap.at(bmcBooted).actionSet;
+    auto& powerOnActions = ledMap.at(powerOn).actionSet;
+    auto& enclosureIdentifyActions = ledMap.at(enclosureIdentify).actionSet;
 
     for (const auto& group : bmcBootedActions)
     {