psu-ng: Store power supply model name

Store the model name for each power supply so that the monitor app can
perform checks such as verifying that all power supplies are of the same
model and if that model is supported by the system.

Tested: Called the new get name interface from the monitor app and
        verified it was populated for each of the present power supplies.

Change-Id: I79a0e4d3d45a8f3d2dfb6733806d4319ad4cb30c
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index cedc184..02fe779 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -296,6 +296,7 @@
         {
             ccin = pmbusIntf->readString(CCIN, Type::HwmonDeviceDebug);
             assetProps.emplace(MODEL_PROP, ccin);
+            modelName = ccin;
         }
         catch (ReadFailure& e)
         {
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index fc41635..b39cb89 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -208,6 +208,14 @@
         return fwVersion;
     }
 
+    /**
+     * @brief Returns the model name of the power supply
+     */
+    const std::string& getModelName() const
+    {
+        return modelName;
+    }
+
     /** @brief Returns true if the number of failed reads exceeds limit
      * TODO: or CML bit on.
      */
@@ -252,6 +260,9 @@
     /** @brief True if the power supply is present. */
     bool present = false;
 
+    /** @brief Power supply model name. */
+    std::string modelName;
+
     /** @brief D-Bus match variable used to subscribe to Present property
      * changes.
      **/