Add support for mV unit to voltage keys in lmsens.

This commit is contained in:
Andreas Bachlechner 2022-02-25 00:14:15 +01:00
parent 544152cd37
commit 34ea9fe59b
1 changed files with 3 additions and 1 deletions

View File

@ -316,7 +316,9 @@ sub lmsens_update {
$l++; $l++;
$tmp = $data[$l]; $tmp = $data[$l];
} }
my ($value, undef) = split(' ', $tmp); my ($value, $unit) = split(' ', $tmp);
($unit, undef) = split(' ', $unit);
$value /= 1000 if ($unit eq "mV");
$volt[$n] = $value; $volt[$n] = $value;
# check alerts for each sensor defined # check alerts for each sensor defined
lmsens_alerts($config, $str, $value); lmsens_alerts($config, $str, $value);