From 34ea9fe59bcecac136942ca3b9924e34a3757062 Mon Sep 17 00:00:00 2001 From: Andreas Bachlechner <62039342+bachandi@users.noreply.github.com> Date: Fri, 25 Feb 2022 00:14:15 +0100 Subject: [PATCH] Add support for mV unit to voltage keys in lmsens. --- lib/lmsens.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/lmsens.pm b/lib/lmsens.pm index 579d6fc..0e85e60 100644 --- a/lib/lmsens.pm +++ b/lib/lmsens.pm @@ -316,7 +316,9 @@ sub lmsens_update { $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; # check alerts for each sensor defined lmsens_alerts($config, $str, $value);