Enable retrieving mapping of Redfish URI to D-Bus sensor path

Background:
Change is necessary to support TelemetryService implementation.
TelemetryService specifies its own resource type for data - MetricDefinition.
In principle - MetricDefinition might point to Redfish Sensor in the system.
Each MetricDefinition requires MetricProperty - URI to specific property in
resource wih the value. This change allows retrieving such data alongside
corresponding D-Bus sensor to be used as source of Metrics value.

This change:
Function was implemented to allow retrieving mapping of Redfish URI paths
to D-Bus sensors in the system. Some minor refactoring in regards to
SensorsAsyncResponse were also introduced to enhance code locality. Idea for the
changes was to be the least intrusive if possible, as retrieving sensors in the
system requires lots of processing.

Existing logic was used and left intact. Utilizing existing logic required to
'fake' a HTTP request to traverse the sensors in the system and build the
response. It's crucial to use exact logic of building Redfish nodes
representation, as goal of the function is to retrieve exact Redfish URI for
sensor value.

Extra parameter was introduced to SensorsAsyncResp - callback to be called when
sensor data will be fully determined. After processing is complete caller is
notified with the outcome (success or failure) and map<URI:D-Bus sensor>.

Testing:
- all positive cases (3 chassis, 3 subnodes) in the system,
  one of obtained mappings looked like the following:
    {   /redfish/v1/Chassis/WP_Baseboard/Power#/Voltages/3/ReadingVolts :
        /xyz/openbmc_project/sensors/voltage/P1V8_PCH }
- negative cases (wrong chassis, wrong subnode) - callback with error status
  was called
- RedfishServiceValidator passed

Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
Change-Id: I4389eb3df275126974168d1bb9af33dbf5cdb5b7
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index a159ed6..59492c3 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -38,8 +38,6 @@
     }
 
   private:
-    std::vector<const char*> typeList = {"/xyz/openbmc_project/sensors/voltage",
-                                         "/xyz/openbmc_project/sensors/power"};
     void setPowerCapOverride(
         std::shared_ptr<SensorsAsyncResp> asyncResp,
         std::vector<nlohmann::json>& powerControlCollections)
@@ -155,7 +153,8 @@
         res.jsonValue["PowerControl"] = nlohmann::json::array();
 
         auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
-            res, chassis_name, typeList, "Power");
+            res, chassis_name, sensors::dbus::types.at(sensors::node::power),
+            sensors::node::power);
 
         getChassisData(sensorAsyncResp);
 
@@ -336,8 +335,9 @@
         }
 
         const std::string& chassisName = params[0];
-        auto asyncResp = std::make_shared<SensorsAsyncResp>(res, chassisName,
-                                                            typeList, "Power");
+        auto asyncResp = std::make_shared<SensorsAsyncResp>(
+            res, chassisName, sensors::dbus::types.at(sensors::node::power),
+            sensors::node::power);
 
         std::optional<std::vector<nlohmann::json>> voltageCollections;
         std::optional<std::vector<nlohmann::json>> powerCtlCollections;