Move PowerLimit to correct location

See the following Redfish Validator errors and warning:
/redfish/v1/Chassis/chassis/Power
ERROR - PowerLimit not defined in schema Power.v1_5_2
(check version, spelling and casing)

/redfish/v1/Chassis/chassis/Power#/PowerControl/
ERROR - Decoded object no longer a dictionary /redfish/v1/Chassis/chassis/Power
ERROR - @odata.id of ReferenceableMember does not properly
resolve: /redfish/v1/Chassis/chassis/Power#/PowerControl/

WARNING - No @odata.type present, assuming highest type
Power.v1_0_0.PowerControl Power.v1_4_0.PowerControl

If you look at the specification/mockups, PowerLimit is
under PowerControl.

From the https://redfish.dmtf.org/redfish/mockups/v1/893 mockup:
PowerControl": [
    {
        "@odata.id": "/redfish/v1/Chassis/1U/Power#/PowerControl/0",
        "MemberId": "0",
        ...
        "PowerAvailableWatts": 0,
        "PowerCapacityWatts": 800,
        ...
        "PowerLimit": {
            "LimitInWatts": 500,
            "LimitException": "LogEventOnly",
            "CorrectionInMs": 50
         } ,
         ...
    }
],

Added an odata.type and fixed the odata.id for PowerControl.

Put all power control sensors under the same PowerControl
like we do for PowerSupplies.

Tested: No longer see the errors.

If no total_power (happens when a Open Power system is off):
curl -k https://${bmc}/redfish/v1/Chassis/chassis/Power
  ...
  "PowerControl": [
    {
      "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerControl/0",
      "@odata.type": "#Power.v1_0_0.PowerControl",
      "MemberId": "0",
      "Name": "Chassis Power Control",
      "PowerLimit": {
        "LimitInWatts": null
      }
    }
  ],
  "Redundancy": [],
   ...

 curl -k https://${bmc}/redfish/v1/Chassis/chassis/Power/
{
  "PowerControl": [
    {
      "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerControl/0",
      "@odata.type": "#Power.v1_0_0.PowerControl",
      "MemberId": "0",
      "Name": "Chassis Power Control",
      "PowerConsumedWatts": 232.0,
      "PowerLimit": {
        "LimitInWatts": null
      },
      "Status": {
        "Health": "OK",
        "State": "Enabled"

Change-Id: I8ca47bd6c7dedf5d0685886e2e45e6f964f69060
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 7980ba2..0ed47f7 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -568,6 +568,11 @@
 
         if (!sensorName.compare("total_power"))
         {
+            sensor_json["@odata.type"] = "#Power.v1_0_0.PowerControl";
+            // Put multiple "sensors" into a single PowerControl, so have
+            // generic names for MemberId and Name. Follows Redfish mockup.
+            sensor_json["MemberId"] = "0";
+            sensor_json["Name"] = "Chassis Power Control";
             unit = "PowerConsumedWatts";
         }
         else if (sensorNameLower.find("input") != std::string::npos)
@@ -1493,10 +1498,23 @@
                 nlohmann::json& tempArray =
                     SensorsAsyncResp->res.jsonValue[fieldName];
 
-                if (fieldName == "PowerSupplies" && !tempArray.empty())
+                if ((fieldName == "PowerSupplies" ||
+                     fieldName == "PowerControl") &&
+                    !tempArray.empty())
                 {
-                    // Power supplies put multiple "sensors" into a single power
-                    // supply entry, so only create the first one
+                    // For power supplies and power control put multiple
+                    // "sensors" into a single power supply or power control
+                    // entry, so only create the first one
+                }
+                else if (fieldName == "PowerControl")
+                {
+                    // Put multiple "sensors" into a single PowerControl.
+                    // Follows MemberId naming and naming in power.hpp.
+                    tempArray.push_back(
+                        {{"@odata.id", "/redfish/v1/Chassis/" +
+                                           SensorsAsyncResp->chassisId + "/" +
+                                           SensorsAsyncResp->chassisSubNode +
+                                           "#/" + fieldName + "/0"}});
                 }
                 else
                 {