psu-ng: Store PSU firmware version in errors

If a power supply is reporting a fault, it could be related to the
firmware version running on the supply. Add that information to the
AdditionalData for most errors. The missing error likely does not have
that updated, as you cannot read such information from a power supply
that is not present.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I968d48a3a2f3a56e61789b8e4d9fb2312d504fc7
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 77d533a..9735b6d 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -196,7 +196,6 @@
     std::string fn;
     std::string header;
     std::string sn;
-    std::string version;
     using PropertyMap =
         std::map<std::string, std::variant<std::string, std::vector<uint8_t>>>;
     PropertyMap assetProps;
@@ -261,8 +260,9 @@
 
         try
         {
-            version = pmbusIntf->readString(FW_VERSION, Type::HwmonDeviceDebug);
-            versionProps.emplace(VERSION_PROP, version);
+            fwVersion =
+                pmbusIntf->readString(FW_VERSION, Type::HwmonDeviceDebug);
+            versionProps.emplace(VERSION_PROP, fwVersion);
         }
         catch (ReadFailure& e)
         {