summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 16bf49d)
raw | patch | inline | side by side (parent: 16bf49d)
author | Clemens Gruber <clemensgru@gmail.com> | |
Tue, 18 Apr 2017 16:45:22 +0000 (18:45 +0200) | ||
committer | Clemens Gruber <clemensgru@gmail.com> | |
Tue, 18 Apr 2017 18:29:45 +0000 (20:29 +0200) |
Add support for current sensor data collection.
Signed-off-by: Clemens Gruber <clemensgru@gmail.com>
Signed-off-by: Clemens Gruber <clemensgru@gmail.com>
src/sensors.c | patch | blob | history |
diff --git a/src/sensors.c b/src/sensors.c
index 8f1824d09b0a32f6462dfe64930db0c418e371b5..2c09006b2f0a431d65a9ff1e8d57501b84019054 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
if ((feature->type != SENSORS_FEATURE_IN) &&
(feature->type != SENSORS_FEATURE_FAN) &&
(feature->type != SENSORS_FEATURE_TEMP) &&
+#if SENSORS_API_VERSION >= 0x402
+ (feature->type != SENSORS_FEATURE_CURR) &&
+#endif
(feature->type != SENSORS_FEATURE_POWER)) {
DEBUG("sensors plugin: sensors_load_conf: "
"Ignoring feature `%s', "
if ((subfeature->type != SENSORS_SUBFEATURE_IN_INPUT) &&
(subfeature->type != SENSORS_SUBFEATURE_FAN_INPUT) &&
(subfeature->type != SENSORS_SUBFEATURE_TEMP_INPUT) &&
+#if SENSORS_API_VERSION >= 0x402
+ (subfeature->type != SENSORS_SUBFEATURE_CURR_INPUT) &&
+#endif
(subfeature->type != SENSORS_SUBFEATURE_POWER_INPUT))
continue;
type = "temperature";
else if (fl->feature->type == SENSORS_FEATURE_POWER)
type = "power";
+#if SENSORS_API_VERSION >= 0x402
+ else if (fl->feature->type == SENSORS_FEATURE_CURR)
+ type = "current";
+#endif
else
continue;