monitor: Avoid Target interface for mapper queries
Avoid asking the mapper for the Target interface on sensors
that do not have it.
Change-Id: I43f61c98291cc15d7daf43d2b01c6b7fa4edfa62
diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp
index 2ece054..6c7143a 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -145,8 +145,10 @@
//Can cache this value after openbmc/openbmc#1496 is resolved
std::string TachSensor::getService()
{
+ // Use the Value interface since not all sensors implement
+ // the control interface.
return phosphor::fan::util::getService(_name,
- FAN_SENSOR_CONTROL_INTF,
+ FAN_SENSOR_VALUE_INTF,
_bus);
}