Read fan target sysfs value on startup
When creating the object that represents the
Control.FanSpeed interface for a fan, read the
target fan speed out of sysfs and save it in
the object so it shows up in D-Bus immediately.
Previously the Target property would have a value
of zero until another application wrote it, leaving
a window where the D-Bus property wouldn't match
the underlying sysfs file value.
Change-Id: I08b149840c2cf731bc48f89118622fa63222600e
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/mainloop.cpp b/mainloop.cpp
index 1190d85..bf2cacc 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -346,7 +346,7 @@
addThreshold<CriticalObject>(i.first.first, id, sensorValue, info);
auto target = addTarget<hwmon::FanSpeed>(
- i.first, ioAccess.path(), _devPath, info);
+ i.first, ioAccess, _devPath, info);
if (target)
{