Sync ReadingUnit with Redfish Sensor Schema
Actual attribute "ReadingUnits" does not match with Redfish Sensor
Schema. This change match "ReadingUnits" with Redfish Sensor Scheme
1.0.0 and add missing "ReadingType" attribute. This change affect all
users that depends on old units that does not match with Redfish
standard. Added toReadingType and toReadingUnit function that uses
values taken from Redfish Sensor Scheme 1.0.0. Latest version 1.2.0 of
Sensor scheme defines same units.
Changed value stored in ReadingUnits for Sensor resource:
- "Watts" -> "W"
- "Amperes" -> "A"
- "Percent" -> "%"
Tested:
- RedfishServiceValidator pass
- Verified that Sensors contain proper ReadingUnits
- Webui-Vue displays ReadingUnits properly in Health tab
Change-Id: I0c8820eba7271022c427cd25dec321db36aa0176
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 8e01bee..00acdf9 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -48,7 +48,7 @@
}
const std::string& chassisName = params[0];
auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
- res, chassisName, sensors::dbus::types.at(sensors::node::thermal),
+ res, chassisName, sensors::dbus::paths.at(sensors::node::thermal),
sensors::node::thermal);
// TODO Need to get Chassis Redundancy information.
@@ -71,7 +71,7 @@
allCollections;
auto asyncResp = std::make_shared<SensorsAsyncResp>(
- res, chassisName, sensors::dbus::types.at(sensors::node::thermal),
+ res, chassisName, sensors::dbus::paths.at(sensors::node::thermal),
sensors::node::thermal);
if (!json_util::readJson(req, asyncResp->res, "Temperatures",