control: Use group objects in actions

Switch to use the group objects created from JSON in the actions which
allows the zone and fan YAML objects to be removed from the JSON based
binary. In switching to the JSON based group objects, the
`default_floor` action required additional methods to be added to the
appropriate objects. These additional methods were copied over from the
associated YAML based object classes.

To reduce the amount of changes in this commit, the `requestIncrease`
method was not copied over and will be in a following commit. An
additional commit will also remove the use of YAML based objects from
the JSON based zone object.

Change-Id: I5fea29f099d0176b2ffe486e79f0c585e744d807
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/actions/action.hpp b/control/json/actions/action.hpp
index cfee7af..358e33a 100644
--- a/control/json/actions/action.hpp
+++ b/control/json/actions/action.hpp
@@ -15,7 +15,7 @@
  */
 #pragma once
 
-#include "types.hpp"
+#include "group.hpp"
 #include "zone.hpp"
 
 #include <fmt/format.h>
diff --git a/control/json/actions/default_floor.cpp b/control/json/actions/default_floor.cpp
index 5970ae2..1f95ffa 100644
--- a/control/json/actions/default_floor.cpp
+++ b/control/json/actions/default_floor.cpp
@@ -15,8 +15,9 @@
  */
 #include "default_floor.hpp"
 
-#include "types.hpp"
-#include "zone.hpp"
+#include "../manager.hpp"
+#include "../zone.hpp"
+#include "group.hpp"
 
 #include <nlohmann/json.hpp>
 
@@ -35,18 +36,18 @@
 
 void DefaultFloor::run(Zone& zone, const Group& group)
 {
-    // Set/update the services of the group
-    zone.setServices(&group);
-    auto services = zone.getGroupServices(&group);
-    auto defFloor =
-        std::any_of(services.begin(), services.end(),
-                    [](const auto& s) { return !std::get<hasOwnerPos>(s); });
-    if (defFloor)
+    const auto& members = group.getMembers();
+    auto isMissingOwner =
+        std::any_of(members.begin(), members.end(),
+                    [&intf = group.getInterface()](const auto& member) {
+                        return !Manager::hasOwner(member, intf);
+                    });
+    if (isMissingOwner)
     {
-        zone.setFloor(zone.getDefFloor());
+        zone.setFloor(zone.getDefaultFloor());
     }
     // Update fan control floor change allowed
-    zone.setFloorChangeAllow(&group, !defFloor);
+    zone.setFloorChangeAllow(group.getName(), !isMissingOwner);
 }
 
 } // namespace phosphor::fan::control::json
diff --git a/control/json/actions/default_floor.hpp b/control/json/actions/default_floor.hpp
index 5aa4182..3eeb13d 100644
--- a/control/json/actions/default_floor.hpp
+++ b/control/json/actions/default_floor.hpp
@@ -15,9 +15,9 @@
  */
 #pragma once
 
+#include "../zone.hpp"
 #include "action.hpp"
-#include "types.hpp"
-#include "zone.hpp"
+#include "group.hpp"
 
 #include <nlohmann/json.hpp>