Merge branch 'master' of github.com:mikaku/Monitorix

This commit is contained in:
Jordi Sanfeliu 2021-09-29 09:28:30 +02:00
commit 32848627a0
1 changed files with 1 additions and 3 deletions

View File

@ -153,9 +153,7 @@ sub gensens_update {
$val = <IN>;
$val = trim($val);
$unit = $gensens->{unit}->{$str} || 0;
$c = () = $unit =~ /0/g;
$val /= 10**$c if $unit > 1;
$val *= 10**$c if $unit > 0 && $unit < 1;
$val /= $unit if $unit != 0;
close(IN);
} else {
logger("$myself: ERROR: unable to open '$gensens->{desc}->{$str}'.");