monitor: Support target_path option in configuration file

The target path containing the interface
xyz.openbmc_project.control.FanPwm or
xyz.openbmc_project.control.FanSpeed can be different between
phosphor-hwmon and dbus-sensor.

In phosphor-hwmon, it is "/xyz/openbmc_project/sensors/fan_tach/".
In dbus-sensor, it is "/xyz/openbmc_project/control/fanpwm/".

This commit supports making this path configurable via "target_path"
as a full object path.
By default, it is the same as the fan tach object path.

Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: I2658a462dd49a98ad77d684f2927e6ccae21cd15
diff --git a/monitor/gen-fan-monitor-defs.py b/monitor/gen-fan-monitor-defs.py
index c771109..1118e83 100755
--- a/monitor/gen-fan-monitor-defs.py
+++ b/monitor/gen-fan-monitor-defs.py
@@ -67,6 +67,9 @@
                       target_interface = sensor.get(
                           'target_interface',
                           'xyz.openbmc_project.Control.FanSpeed')
+                      target_path = sensor.get(
+                          'target_path',
+                          '')
                       factor = sensor.get('factor', 1)
                       offset = sensor.get('offset', 0)
                       threshold = sensor.get('threshold', 1)
@@ -76,6 +79,7 @@
                       SensorDefinition{"${sensor['name']}",
                                        ${has_target},
                                        "${target_interface}",
+                                       "${target_path}",
                                        ${factor},
                                        ${offset},
                                        ${threshold},