control: Associate identifier with target holds

Create a zone method that associates a unique identifier to a target
hold so that if more than one hold exists, the highest target is always
used between all actions that could have set a target hold on the zone.

Change-Id: I7699769a2e271c8a63a0a0a05aef6b0888ce180a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/actions/count_state_target.cpp b/control/json/actions/count_state_target.cpp
index 9f2ba5e..1017ae6 100644
--- a/control/json/actions/count_state_target.cpp
+++ b/control/json/actions/count_state_target.cpp
@@ -64,7 +64,6 @@
             }
             if (numAtState >= _count)
             {
-                zone.setTarget(_target);
                 break;
             }
         }
@@ -74,9 +73,9 @@
         }
     }
 
-    // Update zone's active fan control allowed based on action results
-    zone.setActiveAllow(ActionBase::getName() + std::to_string(_id),
-                        !(numAtState >= _count));
+    // Update zone's target hold based on action results
+    zone.setTargetHold(ActionBase::getName() + std::to_string(_id), _target,
+                       (numAtState >= _count));
 }
 
 void CountStateTarget::setCount(const json& jsonObj)
diff --git a/control/json/actions/missing_owner_target.cpp b/control/json/actions/missing_owner_target.cpp
index 68f6614..8d8a605 100644
--- a/control/json/actions/missing_owner_target.cpp
+++ b/control/json/actions/missing_owner_target.cpp
@@ -49,12 +49,8 @@
                         [&intf = group.getInterface()](const auto& member) {
                             return !Manager::hasOwner(member, intf);
                         });
-        if (isMissingOwner)
-        {
-            zone.setTarget(_target);
-        }
-        // Update group's fan control active allowed based on action results
-        zone.setActiveAllow(group.getName(), !isMissingOwner);
+        // Update zone's target hold based on action results
+        zone.setTargetHold(group.getName(), _target, isMissingOwner);
     }
 }