Parse I2C bus and address out of JSON config file

The I2C bus and address need to be passed down to the PowerSupply
constructor, so get those out of the JSON configuration file now.

Change I2C address format in JSON to be a string, without the
hexadecimal format since it needs to be appended to a string, allowing
to skip conversion from string to number and then from number back to
string.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I2707799bb60d1f4a9783a0403bc3e4920461b7a1
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 922d555..9880b08 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -88,12 +88,20 @@
 
     for (auto psuJSON : configFileJSON["PowerSupplies"])
     {
-        if (psuJSON.contains("Inventory"))
+        if (psuJSON.contains("Inventory") && psuJSON.contains("Bus") &&
+            psuJSON.contains("Address"))
         {
             std::string invpath = psuJSON["Inventory"];
-            auto psu = std::make_unique<PowerSupply>(bus, invpath);
+            std::uint8_t i2cbus = psuJSON["Bus"];
+            std::string i2caddr = psuJSON["Address"];
+            auto psu =
+                std::make_unique<PowerSupply>(bus, invpath, i2cbus, i2caddr);
             psus.emplace_back(std::move(psu));
         }
+        else
+        {
+            log<level::ERR>("Insufficient PowerSupply properties");
+        }
     }
 
     if (psus.empty())