Change power control match to use host state
Lower level signals were removed, use host state instead.
Also fix bug that was introduced, std::abs(nan, number)
returns nan, so checkThresholds wasn't being called.
Tested: Put in prints and saw power/post state change to on
Change-Id: I98df270237900c3a0b01c03ec7905851bc47e3b3
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/sensor.hpp b/include/sensor.hpp
index 3ff37f7..57b9987 100644
--- a/include/sensor.hpp
+++ b/include/sensor.hpp
@@ -146,7 +146,8 @@
internalSet = true;
sensorInterface->set_property("Value", newValue);
internalSet = false;
- if (std::abs(value - newValue) > hysteresis)
+ double diff = std::abs(value - newValue);
+ if (std::isnan(diff) || diff > hysteresis)
{
value = newValue;
checkThresholds();