control: Remove JSON event precondition support
Event preconditions are essentially specialized actions that load events
after a certain condition is met. JSON configured fan control will just
utilize actions that are configured & created to enable or disable
events based on some state.
Change-Id: I8e8faf3c137062943ffaa9b3adc20d93da3a123c
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/event.hpp b/control/json/event.hpp
index a37d9be..305ff25 100644
--- a/control/json/event.hpp
+++ b/control/json/event.hpp
@@ -39,25 +39,14 @@
* how fan control should function. These events contain the configured
* attributes that result in how fans are controlled within a system. Events
* are made up of groups of sensors, triggers from those sensors, and actions
- * to be run when a trigger occurs. Events may also have a precondition that
- * must exist before the event is loaded into fan control. The triggers,
- * actions, and preconditions configured must be available within the fan
- * control application source.
+ * to be run when a trigger occurs. The triggers and actions configured must be
+ * available within the fan control application source.
*
* When no events exist, the configured fans are set to their corresponding
* zone's `full_speed` value.
*/
class Event : public ConfigBase
{
- static constexpr auto precondName = 0;
- static constexpr auto precondGroups = 1;
- static constexpr auto precondEvents = 2;
- using Precondition =
- std::tuple<std::string,
- std::vector<std::tuple<std::string, std::string, std::string,
- PropertyVariantType>>,
- std::vector<Event>>;
-
public:
/* JSON file name for events */
static constexpr auto confFileName = "events.json";
@@ -81,16 +70,6 @@
std::map<configKey, std::unique_ptr<Zone>>& zones);
/**
- * @brief Get the precondition
- *
- * @return The precondition details of the event
- */
- inline const auto& getPrecond() const
- {
- return _precond;
- }
-
- /**
* @brief Get the actions
*
* @return List of actions to perform for the event
@@ -107,9 +86,6 @@
/* The event's manager */
Manager* _manager;
- /* A precondition the event has in order to be enabled */
- Precondition _precond;
-
/* List of groups associated with the event */
std::vector<Group> _groups;
@@ -137,15 +113,6 @@
void configGroup(Group& group, const json& jsonObj);
/**
- * @brief Parse and set the event's precondition(OPTIONAL)
- *
- * @param[in] jsonObj - JSON object for the event
- *
- * Sets the precondition of the event in order to be enabled
- */
- void setPrecond(const json& jsonObj);
-
- /**
* @brief Parse and set the event's groups(OPTIONAL)
*
* @param[in] jsonObj - JSON object for the event