Add chassis and inventory associations to PSU Pwm

PSU pwm sensors are not associated with chassis base
board object path. This causes the PSU pwm sensors
not list under chassis redfish object. Added chassis
base board path and inventory object path associations
to PSU Pwm Sensors.

Tested:
Get on redfish chassis/<chassis id>/Thermal and
chassis/<chassis id>/sensors  redfish URI shows
PSU Pwm sensors.

Change-Id: Ia862ecff058ca43fee38a6f71bdd57f8c135aae2
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/src/PSUSensorMain.cpp b/src/PSUSensorMain.cpp
index ce96c72..0367d2a 100644
--- a/src/PSUSensorMain.cpp
+++ b/src/PSUSensorMain.cpp
@@ -172,10 +172,12 @@
     }
 }
 
-static void checkPWMSensor(const fs::path& sensorPath, std::string& labelHead,
-                           const std::string& interfacePath,
-                           sdbusplus::asio::object_server& objectServer,
-                           const std::string& psuName)
+static void
+    checkPWMSensor(const fs::path& sensorPath, std::string& labelHead,
+                   const std::string& interfacePath,
+                   std::shared_ptr<sdbusplus::asio::connection>& dbusConnection,
+                   sdbusplus::asio::object_server& objectServer,
+                   const std::string& psuName)
 {
     for (const auto& pwmName : pwmTable)
     {
@@ -200,8 +202,8 @@
         }
 
         pwmSensors[psuName + labelHead] = std::make_unique<PwmSensor>(
-            "Pwm_" + psuName + "_" + pwmName.second, pwmPathStr, objectServer,
-            interfacePath + "_" + pwmName.second);
+            "Pwm_" + psuName + "_" + pwmName.second, pwmPathStr, dbusConnection,
+            objectServer, interfacePath + "_" + pwmName.second, "PSU");
     }
 }
 
@@ -468,8 +470,8 @@
                           << "\" label=\"" << labelHead << "\"\n";
             }
 
-            checkPWMSensor(sensorPath, labelHead, *interfacePath, objectServer,
-                           psuNames[0]);
+            checkPWMSensor(sensorPath, labelHead, *interfacePath,
+                           dbusConnection, objectServer, psuNames[0]);
 
             if (!findLabels.empty())
             {