presence: Make error time be per fan

Previously there was a global value for the amount of time a fan needed
to be missing before an event log was created.  This commit changes it
so that instead the value is specified per fan in the JSON.

This way, the times can be different or left off completely on a fan to
fan basis.  The ErrorReporter object will only be created if there is at
least one fan with a time value.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I53bb91c88ec1b0352df11b2e988064c2ec02af45
diff --git a/presence/error_reporter.hpp b/presence/error_reporter.hpp
index 398cd1f..a6a86fe 100644
--- a/presence/error_reporter.hpp
+++ b/presence/error_reporter.hpp
@@ -39,24 +39,16 @@
      * @brief Constructor
      *
      * @param[in] bus - The sdbusplus bus object
-     * @param[in] jsonConf - The 'reporting' section of the JSON config file
      * @param[in] fans - The fans for this configuration
      */
     ErrorReporter(
-        sdbusplus::bus::bus& bus, const nlohmann::json& jsonConf,
+        sdbusplus::bus::bus& bus,
         const std::vector<
             std::tuple<Fan, std::vector<std::unique_ptr<PresenceSensor>>>>&
             fans);
 
   private:
     /**
-     * @brief Reads in the configuration from the JSON section
-     *
-     * @param[in] jsonConf - The 'reporting' section of the JSON
-     */
-    void loadConfig(const nlohmann::json& jsonConf);
-
-    /**
      * @brief The propertiesChanged callback for the interface that
      *        contains the Present property of a fan.
      *
@@ -115,21 +107,18 @@
     std::unique_ptr<PowerState> _powerState;
 
     /**
-     * @brief The amount of time in seconds that a fan must be missing
-     *        before an event log is created for it.
-     */
-    std::chrono::seconds _fanMissingErrorTime;
-
-    /**
      * @brief The map of fan paths to their presence states.
      */
     std::map<std::string, bool> _fanStates;
 
     /**
-     * @brief The map of fan paths to their Timer objects.
+     * @brief The map of fan paths to their Timer objects with
+     *        the timer expiration time.
      */
-    std::map<std::string, std::unique_ptr<sdeventplus::utility::Timer<
-                              sdeventplus::ClockId::Monotonic>>>
+    std::map<std::string,
+             std::tuple<std::unique_ptr<sdeventplus::utility::Timer<
+                            sdeventplus::ClockId::Monotonic>>,
+                        std::chrono::seconds>>
         _fanMissingTimers;
 };