control: Introduce `poweron_target` configuration attribute
Use a required `poweron_target` attribute to eventually replace
`full_speed` instead of using `default_ceiling`. This allows a different
target other than the default ceiling to be used at poweron. In
addition, the `default_ceiling` and `default_floor` attributes can be
made optional. A user that just wants to set fans to a speed and not
change them does not need to provide a default ceiling or floor. The
default ceiling will now default to the poweron target value, if not
given, and the default floor will now default to 0 when not given.
Change-Id: I232935c00c34086ebb286adc4f9b91f5e302e64f
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/zone.hpp b/control/json/zone.hpp
index c4d90d7..50d8718 100644
--- a/control/json/zone.hpp
+++ b/control/json/zone.hpp
@@ -357,6 +357,9 @@
/* The zone's manager */
Manager* _manager;
+ /* The zone's poweron target value for fans */
+ uint64_t _poweronTarget;
+
/* The zone's default ceiling value for fans */
uint64_t _defaultCeiling;
@@ -423,24 +426,14 @@
std::vector<std::function<void(DBusZone&, Zone&)>> _propInitFunctions;
/**
- * @brief Parse and set the zone's default ceiling value
+ * @brief Parse and set the zone's poweron target value
*
* @param[in] jsonObj - JSON object for the zone
*
- * Sets the default ceiling value for the zone from the JSON configuration
+ * Sets the poweron target value for the zone from the JSON configuration
* object
*/
- void setDefaultCeiling(const json& jsonObj);
-
- /**
- * @brief Parse and set the zone's default floor value
- *
- * @param[in] jsonObj - JSON object for the zone
- *
- * Sets the default floor value for the zone from the JSON configuration
- * object
- */
- void setDefaultFloor(const json& jsonObj);
+ void setPowerOnTarget(const json& jsonObj);
/**
* @brief Parse and set the zone's decrease interval(in seconds)