Use host state object to check if host is on

The code was using pgood to determine if host is on or off. Now we have
host state object, which is a more appropriate way to check host on/off.
So change pgood related code to use host state object.

Change-Id: I553c1a40922ca2e8bc6904688c55e85971bd4720
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/manager.hpp b/manager.hpp
index f9ee511..e84652c 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -45,8 +45,8 @@
         /** @brief The match of settings property change */
         std::vector<sdbusplus::bus::match::match> settingsMatches;
 
-        /** @brief The match of pgood change */
-        sdbusplus::bus::match::match pgoodChangeMatch;
+        /** @brief The match of host state change */
+        std::unique_ptr<sdbusplus::bus::match::match> hostStateChangeMatch;
 
         /** @brief The container to hold all the listeners */
         std::set<PropertyChangeListner*> listeners;
@@ -135,11 +135,17 @@
         void onPropertyChanged(const std::string& key,
                                const std::string& value);
 
-        /** @brief Notified on pgood has changed
+        /** @brief Notified on host state has changed
          *
-         * @param[in] pgood - The changed pgood value
+         * @param[in] msg - sdbusplus dbusmessage
          */
-        void onPgoodChanged(bool pgood);
+        void onHostStateChanged(sdbusplus::message::message& msg);
+
+        /** @brief Notified on host state has changed
+         *
+         * @param[in] on - Indicate if the host is on or off
+         */
+        void onHostState(bool on);
 
         /** @brief Set the property as requested time mode/owner
          *
@@ -179,16 +185,6 @@
                                      void* userData,
                                      sd_bus_error* retError);
 
-        /** @brief Notified on pgood has changed
-         *
-         * @param[in] msg - Data associated with subscribed signal
-         * @param[in] userData - Pointer to this object instance
-         * @param[out] retError  - Not used but required with signal API
-         */
-        static int onPgoodChanged(sd_bus_message* msg,
-                                  void* userData,
-                                  sd_bus_error* retError);
-
         /** @brief The string of time mode property */
         static constexpr auto PROPERTY_TIME_MODE = "TimeSyncMethod";