diff --git a/CHANGES b/CHANGES index 83618838..4dbe746c 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ lm-sensors CHANGES file SVN HEAD libsensors: Fix warning about library path not in /etc/ld.so.conf sensors: Fix libiconv linkage need detection in rare corner case + Add support for humidity output sensors-detect: Don't choke on systems without PCI Avoid probing EDID addresses on graphics cards (#2386) Add detection of NCT6779D and NCT6102D/NCT6106D diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 98a886b5..15c37bb4 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -658,6 +658,27 @@ static void print_chip_vid(const sensors_chip_name *name, free(label); } +static void print_chip_humidity(const sensors_chip_name *name, + const sensors_feature *feature, + int label_size) +{ + char *label; + const sensors_subfeature *subfeature; + double humidity; + + subfeature = sensors_get_subfeature(name, feature, + SENSORS_SUBFEATURE_HUMIDITY_INPUT); + if (!subfeature) + return; + + if ((label = sensors_get_label(name, feature)) + && !sensors_get_value(name, subfeature->number, &humidity)) { + print_label(label, label_size); + printf("%6.1f \%RH\n", humidity); + } + free(label); +} + static void print_chip_beep_enable(const sensors_chip_name *name, const sensors_feature *feature, int label_size) @@ -792,6 +813,9 @@ void print_chip(const sensors_chip_name *name) case SENSORS_FEATURE_INTRUSION: print_chip_intrusion(name, feature, label_size); break; + case SENSORS_FEATURE_HUMIDITY: + print_chip_humidity(name, feature, label_size); + break; default: continue; }