add humidity for lm_sensors version >= 0x431
authorSarah Fischmann <sfischmann@starry.com>
Fri, 31 Aug 2018 14:03:00 +0000 (10:03 -0400)
committerSarah Fischmann <sfischmann@starry.com>
Fri, 31 Aug 2018 14:03:00 +0000 (10:03 -0400)
src/sensors.c

index 6d51101..6106df3 100644 (file)
@@ -367,6 +367,8 @@ static int sensors_load_conf(void) {
           (feature->type != SENSORS_FEATURE_TEMP) &&
 #if SENSORS_API_VERSION >= 0x402
           (feature->type != SENSORS_FEATURE_CURR) &&
+#endif
+#if SENSORS_API_VERSION >= 0x431
           (feature->type != SENSORS_FEATURE_HUMIDITY) &&
 #endif
           (feature->type != SENSORS_FEATURE_POWER)) {
@@ -387,6 +389,8 @@ static int sensors_load_conf(void) {
             (subfeature->type != SENSORS_SUBFEATURE_TEMP_INPUT) &&
 #if SENSORS_API_VERSION >= 0x402
             (subfeature->type != SENSORS_SUBFEATURE_CURR_INPUT) &&
+#endif
+#if SENSORS_API_VERSION >= 0x431
             (subfeature->type != SENSORS_SUBFEATURE_HUMIDITY_INPUT) &&
 #endif
             (subfeature->type != SENSORS_SUBFEATURE_POWER_INPUT))
@@ -522,6 +526,8 @@ static int sensors_read(void) {
 #if SENSORS_API_VERSION >= 0x402
     else if (fl->feature->type == SENSORS_FEATURE_CURR)
       type = "current";
+#endif
+#if SENSORS_API_VERSION >= 0x431
     else if (fl->feature->type == SENSORS_FEATURE_HUMIDITY)
       type = "humidity";
 #endif