psu-ng: Remove Min Power Supplies and cleanup

The psu manager would not prevent a power on based on the number of
power supplies, it's only concerned about the max number so that if the
number of plugged power supplies is less than the specified max, then it
can take action such as log an error.

Therefore there's not a current use case for the min setting, so
removing it.

Also cleanup the function that parses that information from the JSON
config file, like removing passing parameters that are class members,
and adding a doxygen description. In addition, have the structure of
system properties as part of the class instead of individual variables,
since it's duplicate work to set the structure values then set the
individual variables.

Tested: With debug traces verified that maxPowerSupplies was set to 2
        which is the value in the JSON config file.

Change-Id: Id98900d213fcbef38dc3879b425161a8af172716
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/phosphor-power-supply/README.md b/phosphor-power-supply/README.md
index a485508..bd86b11 100644
--- a/phosphor-power-supply/README.md
+++ b/phosphor-power-supply/README.md
@@ -11,10 +11,6 @@
 
 The JSON configuration file should contain:
 
-## MinPowerSupplies
-Optional property, integer, that indicates the minimum number of power supplies
-that should be present.
-
 ## MaxPowerSupplies
 Optional property, integer, that indicates the maximum number of power supplies
 that should be present.
diff --git a/phosphor-power-supply/configurations/witherspoon/psu_config.json b/phosphor-power-supply/configurations/witherspoon/psu_config.json
index 546adeb..4542cea 100644
--- a/phosphor-power-supply/configurations/witherspoon/psu_config.json
+++ b/phosphor-power-supply/configurations/witherspoon/psu_config.json
@@ -1,6 +1,5 @@
 {
     "SystemProperties" : {
-        "MinPowerSupplies" : 1,
         "MaxPowerSupplies" : 2
     },
     "PowerSupplies": [
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index b83d77d..1f578aa 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -16,17 +16,14 @@
     bus(bus)
 {
     // Parse out the JSON properties
-    sys_properties properties;
-    getJSONProperties(configfile, bus, properties, psus);
+    sysProperties = {0};
+    getJSONProperties(configfile);
 
     using namespace sdeventplus;
     auto interval = std::chrono::milliseconds(1000);
     timer = std::make_unique<utility::Timer<ClockId::Monotonic>>(
         e, std::bind(&PSUManager::analyze, this), interval);
 
-    minPSUs = {properties.minPowerSupplies};
-    maxPSUs = {properties.maxPowerSupplies};
-
     // Subscribe to power state changes
     powerService = util::getService(POWER_OBJ_PATH, POWER_IFACE, bus);
     powerOnMatch = std::make_unique<sdbusplus::bus::match_t>(
@@ -38,9 +35,7 @@
     initialize();
 }
 
-void PSUManager::getJSONProperties(
-    const std::string& path, sdbusplus::bus::bus& bus, sys_properties& p,
-    std::vector<std::unique_ptr<PowerSupply>>& psus)
+void PSUManager::getJSONProperties(const std::string& path)
 {
     nlohmann::json configFileJSON = util::loadJSONFromFile(path.c_str());
 
@@ -61,22 +56,9 @@
 
     auto sysProps = configFileJSON["SystemProperties"];
 
-    if (sysProps.contains("MinPowerSupplies"))
-    {
-        p.minPowerSupplies = sysProps["MinPowerSupplies"];
-    }
-    else
-    {
-        p.minPowerSupplies = 0;
-    }
-
     if (sysProps.contains("MaxPowerSupplies"))
     {
-        p.maxPowerSupplies = sysProps["MaxPowerSupplies"];
-    }
-    else
-    {
-        p.maxPowerSupplies = 0;
+        sysProperties.maxPowerSupplies = sysProps["MaxPowerSupplies"];
     }
 
     for (auto psuJSON : configFileJSON["PowerSupplies"])
diff --git a/phosphor-power-supply/psu_manager.hpp b/phosphor-power-supply/psu_manager.hpp
index 06d7c82..f3bba27 100644
--- a/phosphor-power-supply/psu_manager.hpp
+++ b/phosphor-power-supply/psu_manager.hpp
@@ -11,7 +11,6 @@
 
 struct sys_properties
 {
-    int minPowerSupplies;
     int maxPowerSupplies;
 };
 
@@ -47,9 +46,12 @@
     PSUManager(sdbusplus::bus::bus& bus, const sdeventplus::Event& e,
                const std::string& configfile);
 
-    void getJSONProperties(const std::string& path, sdbusplus::bus::bus& bus,
-                           sys_properties& p,
-                           std::vector<std::unique_ptr<PowerSupply>>& psus);
+    /**
+     * @brief Initialize the system properties and PowerSupply objects from
+     *        the JSON config file.
+     * @param[in] path - Path to the JSON config file
+     */
+    void getJSONProperties(const std::string& path);
 
     /**
      * Initializes the manager.
@@ -188,14 +190,9 @@
     }
 
     /**
-     * @brief Minimum number of power supplies to operate.
+     * @brief The system properties.
      */
-    int minPSUs = 1;
-
-    /**
-     * @brief Maximum number of power supplies possible.
-     */
-    int maxPSUs = 1;
+    sys_properties sysProperties;
 
     /**
      * @brief The vector for power supplies.