add hysteresis param to parseThresholdsFromAttr()

Parameter 'hysteresis' with a default = NaN, is added to the header for
parseThresholdsFromAttr(), and existing calls to it now explicitly
specify a hysteresis value.

This is an alternative to having calls to parseThresholdFromAttr() use
a hardcoded Intel-specific value of '0.'

The 'NaN' value was chosen as default because it reflects the value
that was being written before a device-specific value was hardcoded in
to solve a specific issue.

Change was created based on the discussion here:
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/61744/comments/38f6a
221_58a39817a

Tested: Confirmed the code builds and doesn't throw errors with OBMC
'local CI' testing. I believe heavier testing with actual Intel HW
isn't needed because this change simple moves where a value is specified
(from hardcode in function body to passed-in parameter) without
affecting any existing in-use functionality.

Change-Id: I1240b951d6e37adc1aad5ad3b19144f6baa64998
Signed-off-by: Chris Sides <christopher.sides@hpe.com>
diff --git a/src/Thresholds.hpp b/src/Thresholds.hpp
index fa7ce0c..352c55c 100644
--- a/src/Thresholds.hpp
+++ b/src/Thresholds.hpp
@@ -119,10 +119,15 @@
     std::vector<thresholds::Threshold>& thresholdVector,
     const std::string* matchLabel = nullptr, const int* sensorIndex = nullptr);
 
+// Sensors touched by parseThresholdFromAttr() are forcibly updated with given
+// parameters, so callers are encouraged to specify a sane hysteresis value for
+// their HW. For reference, the hysteresis fomula used in Sensor.hpp is:
+//  hysteresis.trigger = (max_val - min_val) * 0.01
 bool parseThresholdsFromAttr(
     std::vector<thresholds::Threshold>& thresholdVector,
     const std::string& inputPath, const double& scaleFactor,
-    const double& offset = 0);
+    const double& offset = 0,
+    const double& hysteresis = std::numeric_limits<double>::quiet_NaN());
 
 struct ThresholdDefinition
 {