dbusconfiguration: Init margin similar to temp

Adding "margin" PID class to the same initialization block that is
used by "temp", so they initialize similarly.

This patch used to do a lot more, now it is simplified. The other
changes, to the "timeout" and "ignoreDbusMinMax" settings, are no
longer necessary to make here, as they were quietly already made by
other patches since this was originally written, as the same bugs they
would fix were already noticed and fixed by other people as well.

Tested: Correct behavior (no timeout at all, because these are D-Bus
passive sensors, which operate on a push model, not being polled by a
timer). Without this fix, margin PID class wrongly still had timeout.

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: Ibbf9294c249de9bc13a6449ea936ab0be4910dcc
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 8871dfb..460e9e3 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -637,9 +637,16 @@
                         inputSensorInterface.second;
                     const std::string& inputSensorPath =
                         inputSensorInterface.first;
-                    // todo: maybe un-hardcode this if we run into slower
-                    // timeouts with sensors
-                    if (pidClass == "temp")
+
+                    // Setting timeout to 0 is intentional, as D-Bus passive
+                    // sensor updates are pushed in, not pulled by timer poll.
+                    // Setting ignoreDbusMinMax is intentional, as this
+                    // prevents normalization of values to [0.0, 1.0] range,
+                    // which would mess up the PID loop math.
+                    // All non-fan PID classes should be initialized this way.
+                    // As for why a fan should not use this code path, see
+                    // the ed1dafdf168def37c65bfb7a5efd18d9dbe04727 commit.
+                    if ((pidClass == "temp") || (pidClass == "margin"))
                     {
                         std::string inputSensorName =
                             getSensorNameFromPath(inputSensorPath);
@@ -651,6 +658,7 @@
                         config.ignoreDbusMinMax = true;
                         config.unavailableAsFailed = unavailableAsFailed;
                     }
+
                     if (dbusInterface != sensorInterface)
                     {
                         /* all expected inputs in the configuration are expected