psu-ng: Run validation when PSU is plugged

Subscribe to the Present inventory property so that when a PSU becomes
present (it's plugged into the system), it triggers the PSU validation
check so that the user can know if the new PSU(s) is supported on the
system instead of needing to issue a power on to run the validation.

Tested: At BMC Ready state, set the Present property on powersupply1 to
false, then true, and check that the validation ran every time the
Present property was set to true. Same when changing the Present
property for powersupply0.

Change-Id: I14dc7d5902871284c9c099e81b45e78e4abf83bc
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/phosphor-power-supply/psu_manager.hpp b/phosphor-power-supply/psu_manager.hpp
index ca4fb45..6c5775e 100644
--- a/phosphor-power-supply/psu_manager.hpp
+++ b/phosphor-power-supply/psu_manager.hpp
@@ -192,6 +192,9 @@
     /** @brief Used to subscribe to D-Bus power on state changes */
     std::unique_ptr<sdbusplus::bus::match_t> powerOnMatch;
 
+    /** @brief Used to subscribe to D-Bus power supply presence changes */
+    std::vector<std::unique_ptr<sdbusplus::bus::match_t>> presenceMatches;
+
     /** @brief Used to subscribe to Entity Manager interfaces added */
     std::unique_ptr<sdbusplus::bus::match_t> entityManagerIfacesAddedMatch;
 
@@ -205,6 +208,15 @@
     void powerStateChanged(sdbusplus::message::message& msg);
 
     /**
+     * @brief Callback for inventory property changes
+     *
+     * Process change of the Present property for power supply.
+     *
+     * @param[in]  msg - Data associated with the Present change signal
+     **/
+    void presenceChanged(sdbusplus::message::message& msg);
+
+    /**
      * @brief Callback for entity-manager interface added
      *
      * Process the information from the supported configuration and or IBM CFFPS