diff options
author | George Liu <liuxiwei@inspur.com> | 2022-10-13 15:22:14 +0300 |
---|---|---|
committer | George Liu <liuxiwei@inspur.com> | 2022-12-09 05:43:54 +0300 |
commit | 51c35a8f0fa5cfcfb405ac5674bdd390ee2a3a22 (patch) | |
tree | 5f68d52b188a533288fccfc4ee6162df8d299c04 | |
parent | d00907336f7497df6073a668fa8b398e6a12bf5b (diff) | |
download | bmcweb-51c35a8f0fa5cfcfb405ac5674bdd390ee2a3a22.tar.xz |
Add Accuracy property to sensors
Base on Sensor.v1_2_0.json[1], add the Accuracy property to sensors.
At present, the D-Bus interface[2] has been exposed in the
phosphor-hwmon repo[3], and this function will be synchronized to the
dbus-sensor repo in the future.
[1]http://redfish.dmtf.org/schemas/v1/Sensor.v1_2_0.json
[2]https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/53569
[3]https://gerrit.openbmc.org/c/openbmc/phosphor-hwmon/+/57839
Tested: built bmcweb successfully and validator passes
get Accuracy:
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/
Chassis/chassis/Sensors/temperature_inlet
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/temperature_inlet",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Accuracy": 5.0,
"Id": "Sensors_inlet",
"Name": "inlet",
...
}
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie51356d810f63ba70c56ce702d6bbeb97e279530
-rw-r--r-- | redfish-core/lib/sensors.hpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp index 697bf0db0b..b87c060abb 100644 --- a/redfish-core/lib/sensors.hpp +++ b/redfish-core/lib/sensors.hpp @@ -895,6 +895,8 @@ inline void objectPropertiesToJson( "/ReadingRangeMin"_json_pointer); properties.emplace_back("xyz.openbmc_project.Sensor.Value", "MaxValue", "/ReadingRangeMax"_json_pointer); + properties.emplace_back("xyz.openbmc_project.Sensor.Accuracy", + "Accuracy", "/Accuracy"_json_pointer); } else if (sensorType == "temperature") { |