control: Temporarily handle starting at poweron

For JSON based fan control the fan control init service is used to start
fan control at poweron. The associated recipe needs to be updated where
JSON based fan control only uses the non-init service and have it start
at BMC standby. Once that is merged, this commit can be reverted.

Change-Id: I893b8b8f2f73ef5ef842a3b7733c24c426df00e6
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/manager.hpp b/control/json/manager.hpp
index 5e5b33c..43b963c 100644
--- a/control/json/manager.hpp
+++ b/control/json/manager.hpp
@@ -431,6 +431,17 @@
      */
     void load();
 
+    // TODO - Set power state to on until fan control services updated
+    /**
+     * @brief Callback for power state changes
+     *
+     * @param[in] powerStateOn - Whether the power state is on or not
+     *
+     * Callback function bound to the PowerState object instance to handle each
+     * time the power state changes.
+     */
+    void powerStateChanged(bool powerStateOn);
+
   private:
     /* The sdbusplus bus object to use */
     sdbusplus::bus::bus& _bus;
@@ -478,16 +489,6 @@
     std::map<configKey, std::unique_ptr<Event>> _events;
 
     /**
-     * @brief Callback for power state changes
-     *
-     * @param[in] powerStateOn - Whether the power state is on or not
-     *
-     * Callback function bound to the PowerState object instance to handle each
-     * time the power state changes.
-     */
-    void powerStateChanged(bool powerStateOn);
-
-    /**
      * @brief Find the service name for a given path and interface from the
      * cached dataset
      *
diff --git a/control/main.cpp b/control/main.cpp
index 9284ae4..cf6489b 100644
--- a/control/main.cpp
+++ b/control/main.cpp
@@ -83,6 +83,9 @@
                       std::placeholders::_1, std::placeholders::_2));
 
         phosphor::fan::util::SDBusPlus::getBus().request_name(CONTROL_BUSNAME);
+
+        // TODO - Set power state to on until fan control services updated
+        manager.powerStateChanged(true);
 #else
         Manager manager(phosphor::fan::util::SDBusPlus::getBus(), event, mode);