monitor: Don't create errors for missing sensors
Don't start the error timer (so no errors would be created) in the cases
where the tach sensor is being made nonfunctional because its value
can't be found on D-Bus, as that error indicates a problem with the fan
itself, which is fine.
Also don't check any power off actions in this case either so a running
system isn't turned off.
If no sensors at all are on D-Bus, that is already caught during a power
on.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: If5cd6d1d444be11b9666500db89b4bb82d7b282a
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index 5b214c4..f3619be 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -254,8 +254,12 @@
/**
* Set the functional status and update inventory to match
+ *
+ * @param[in] functional - The new state
+ * @param[in] skipErrorTimer - If setting the sensor to
+ * nonfunctional, don't start the error timer.
*/
- void setFunctional(bool functional);
+ void setFunctional(bool functional, bool skipErrorTimer = false);
/**
* @brief Says if the timer is running or not
@@ -435,7 +439,7 @@
* @brief If functional (not too slow). The parent
* fan object sets this.
*/
- bool _functional;
+ bool _functional = true;
/**
* @brief If the sensor has a Target property (can set speed)