psu-ng: Get max PSU number from entity manager

Read the max number of PSUs supported from entity manager instead of
JSON since entity manager would have the value based on system. If the
entity manager interface does not exist by the time the psu manager
starts, subscribe to interfaces added. The psu manager can take action
once the max count property is available on D-Bus.

Tested: On Rainier 2U with debug traces:
1. Restarted phosphor-psu-monitor and verified maxPowerSupplies was 2.
2. Stopped xyz.openbmc_project.Inventory.Manager. Restarted
   phosphor-psu-monitor and verified maxPowerSupplies was 0.
3. Started xyz.openbmc_project.Inventory.Manager and verified the
   psu callback was triggered setting maxPowerSupplies to 2.
4. Stopped and started xyz.openbmc_project.Inventory.Manager and
   verified the psu callback was not called again.

Change-Id: Ieff796ca5c79bfddc1fc6e15e339a0b15eb422d7
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 f3bba27..d3d101a 100644
--- a/phosphor-power-supply/psu_manager.hpp
+++ b/phosphor-power-supply/psu_manager.hpp
@@ -47,13 +47,18 @@
                const std::string& configfile);
 
     /**
-     * @brief Initialize the system properties and PowerSupply objects from
-     *        the JSON config file.
+     * @brief Initialize the PowerSupply objects from the JSON config file.
      * @param[in] path - Path to the JSON config file
      */
     void getJSONProperties(const std::string& path);
 
     /**
+     * @brief Initialize the system properties from the Supported Configuration
+     *        D-Bus object provided by Entity Manager.
+     */
+    void getSystemProperties();
+
+    /**
      * Initializes the manager.
      *
      * Get current BMC state, ...
@@ -163,6 +168,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 Entity Manager interfaces added */
+    std::unique_ptr<sdbusplus::bus::match_t> entityManagerIfacesAddedMatch;
+
     /**
      * @brief Callback for power state property changes
      *
@@ -173,6 +181,15 @@
     void powerStateChanged(sdbusplus::message::message& msg);
 
     /**
+     * @brief Callback for supported configuration interface added
+     *
+     * Process the information from the supported configuration interface
+     *
+     * @param[in] msg - Data associated with the interfaces added signal
+     */
+    void supportedConfIfaceAdded(sdbusplus::message::message& msg);
+
+    /**
      * @brief Adds properties to the inventory.
      *
      * Reads the values from the devices and writes them to the associated