hwmontempsensor: update PercentRH unit string
change PercentRH unit string to follow the definition in
phosphor-dbus-interface.
Test Result:
```
root@bmc:~# busctl get-property xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/humidity/FRONT_PANEL_HUMIDTY xyz.openbmc_project.Sensor.Value Unit -j
{
"type" : "s",
"data" : "xyz.openbmc_project.Sensor.Value.Unit.PercentRH"
}
```
Change-Id: I2967ee5d804eaa6f7ab28c9f39789bc58317e210
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
diff --git a/src/HwmonTempMain.cpp b/src/HwmonTempMain.cpp
index 943443d..96eab9b 100644
--- a/src/HwmonTempMain.cpp
+++ b/src/HwmonTempMain.cpp
@@ -166,7 +166,7 @@
// Relative Humidity are read in milli-percent, we need percent.
tmpSensorParameters.scaleValue *= 0.001;
tmpSensorParameters.typeName = "humidity";
- tmpSensorParameters.units = "PercentRH";
+ tmpSensorParameters.units = sensor_paths::unitPercentRH;
}
else
{
diff --git a/src/SensorPaths.hpp b/src/SensorPaths.hpp
index e2475fa..8524400 100644
--- a/src/SensorPaths.hpp
+++ b/src/SensorPaths.hpp
@@ -27,6 +27,8 @@
constexpr const char* unitCFM = "xyz.openbmc_project.Sensor.Value.Unit.CFM";
constexpr const char* unitPascals =
"xyz.openbmc_project.Sensor.Value.Unit.Pascals";
+constexpr const char* unitPercentRH =
+ "xyz.openbmc_project.Sensor.Value.Unit.PercentRH";
std::string getPathForUnits(const std::string& units);