Fixes Units for Temperature & Pressure for Hwmon
For pressure the units are Pascals and was missing in SensorPaths.cpp
Also changed to align with the rest of dbus-sensors and set units
as sensor_paths::unitDegreesC and sensor_paths::unitPascals instead
of literal string constants.
Tested: on Everest's Storm King Op Panels with busctl introspect \
--no-pager xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/\
sensors/temperature/Ambient_1_Temp and with
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/pressure/Station_Pressure
the .Unit fields are now align with the rest of dbus-sensors
Signed-off-by: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
Change-Id: I46ce300d1f04e05c65196d69f6201db8ba266ad9
diff --git a/src/SensorPaths.cpp b/src/SensorPaths.cpp
index b0cea9c..2e73012 100644
--- a/src/SensorPaths.cpp
+++ b/src/SensorPaths.cpp
@@ -45,6 +45,10 @@
{
return "Utilization";
}
+ if (units == "Pascals" || units == unitPascals)
+ {
+ return "pressure";
+ }
return "";
}