Allow floor speed changes based on sensor values

Given a group of sensor values, the average of those sensor values will
be used in selecting the floor speed for the zone. Each time the speed
is set/updated, any speed requested lower than the current floor will be
overwritten with the floor speed to not allow speeds below the floor.

Change-Id: I4c8e8a2cd66892b9fdc2bc5643e907adddff51f8
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/zone.hpp b/control/zone.hpp
index c524397..24739f8 100644
--- a/control/zone.hpp
+++ b/control/zone.hpp
@@ -123,6 +123,16 @@
             return _defFloorSpeed;
         };
 
+        /**
+         * @brief Set the floor speed to the given speed
+         *
+         * @param[in] speed - Speed to set the floor to
+         */
+        inline void setFloor(uint64_t speed)
+        {
+            _floorSpeed = speed;
+        };
+
     private:
 
         /**
@@ -146,6 +156,11 @@
         const uint64_t _defFloorSpeed;
 
         /**
+         * The floor speed to not go below
+         */
+        uint64_t _floorSpeed = _defFloorSpeed;
+
+        /**
          * Automatic fan control active state
          */
         bool _isActive = true;