control: Add timer trigger support
When an event is configured with a "timer" trigger, the event's actions
are run after the configured type of timer expires.
Change-Id: I4a400cdae0df560ba58383916c246c10d27d3516
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/triggers/trigger.hpp b/control/json/triggers/trigger.hpp
index 7051932..b5fb902 100644
--- a/control/json/triggers/trigger.hpp
+++ b/control/json/triggers/trigger.hpp
@@ -17,6 +17,7 @@
#include "action.hpp"
#include "manager.hpp"
+#include "timer.hpp"
#include <nlohmann/json.hpp>
@@ -36,6 +37,7 @@
std::vector<std::unique_ptr<ActionBase>>&)>;
// Mapping of trigger class name to its creation function
-static const std::map<std::string, createTrigger> triggers = {};
+static const std::map<std::string, createTrigger> triggers = {
+ {"timer", timer::triggerTimer}};
} // namespace phosphor::fan::control::json::trigger