bugfix: writePath is the dbus object path for the sensor

For the sensor, if writePath is used for dbus active, it is always
FanPwm (presently) and needs to be the object path.

Tested: Not tested, only code inspected.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I4eafaff4316aac9dab9a2c9e1bd61093a670b023
diff --git a/configure.md b/configure.md
index a027282..f33ec92 100644
--- a/configure.md
+++ b/configure.md
@@ -75,13 +75,10 @@
 *   `/sys/devices/platform/ahb/1e786000.pwm-tacho-controller/hwmon/<asterisk
     asterisk>/pwm1`
 
-If the `writePath` value contains: `/xyz/openbmc_project/control/fanpwm/` it
+If the `writePath` value contains: `/xyz/openbmc_project/sensors/fan_tach/fan{N}` it
 sets of a sensor object that writes over dbus to the
-`xyz.openbmc_project.Control.FanPwm` interface. The `writePath` should end with
-the sensor's dbus name.
-
-**BUG NOTE** It's currently using the writePath specified for fanpwm as the
-sensor path, when in fact, the interface is attached to:
+`xyz.openbmc_project.Control.FanPwm` interface. The `writePath` should be the
+full object path.
 
 ```
 busctl introspect xyz.openbmc_project.Hwmon-1644477290.Hwmon1 /xyz/openbmc_project/sensors/fan_tach/fan1 --no-pager
diff --git a/util.cpp b/util.cpp
index f66f20b..ec60d7a 100644
--- a/util.cpp
+++ b/util.cpp
@@ -21,7 +21,6 @@
 static constexpr auto external_sensor =
     "/xyz/openbmc_project/extsensors/";                         // type/
 static constexpr auto openbmc_sensor = "/xyz/openbmc_project/"; // type/
-static constexpr auto dbus_pwm = "/xyz/openbmc_project/control/fanpwm/";
 static constexpr auto sysfs = "/sys/";
 
 IOInterfaceType getWriteInterfaceType(const std::string& path)
@@ -37,7 +36,7 @@
         return IOInterfaceType::SYSFS;
     }
 
-    if (path.find(dbus_pwm) != std::string::npos)
+    if (path.find(openbmc_sensor) != std::string::npos)
     {
         return IOInterfaceType::DBUSACTIVE;
     }