mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-29 05:17:50 +00:00
sensors: add humidity data to output of sensors command
Patch provided by Iain Paton. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6070 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
parent
aa504302de
commit
4726e44ab8
1
CHANGES
1
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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user