control: 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".
By default, it is "/xyz/openbmc_project/sensors/fan_tach/".
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: Id799986ff69455b7c7054070ed2ab3b2e2500a6c
diff --git a/control/gen-fan-zone-defs.py b/control/gen-fan-zone-defs.py
index 72c416d..e085570 100755
--- a/control/gen-fan-zone-defs.py
+++ b/control/gen-fan-zone-defs.py
@@ -697,6 +697,9 @@
fan['target_interface'] = f.get(
'target_interface',
'xyz.openbmc_project.Control.FanSpeed')
+ fan['target_path'] = f.get(
+ 'target_path',
+ '/xyz/openbmc_project/sensors/fan_tach/')
fans.append(fan)
return fans