2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

93_DbRep: contrib 8.50.0

git-svn-id: https://svn.fhem.de/fhem/trunk@26318 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2022-08-13 06:31:36 +00:00
parent 6466eaf013
commit 5aacbfc515

View File

@ -9359,8 +9359,7 @@ sub _DbRep_rl_updateHour {
return $err if ($err); return $err if ($err);
} }
my ($max, $params); my $params;
my $sum = 0;
my $i = 0; my $i = 0;
my $k = 1; my $k = 1;
my $th = _DbRep_rl_logThreshold ($c); my $th = _DbRep_rl_logThreshold ($c);
@ -9400,12 +9399,13 @@ sub _DbRep_rl_updateHour {
$i++; $i++;
my $sum = 0;
for my $val (@{$hourHash->{$hourKey}->[4]}) { for my $val (@{$hourHash->{$hourKey}->[4]}) {
$sum += $val; $sum += $val;
} }
my $value = sprintf "%.${ndp}f", $sum / scalar @{$hourHash->{$hourKey}->[4]}; my $value = sprintf "%.${ndp}f", $sum / scalar @{$hourHash->{$hourKey}->[4]};
$sum = 0;
$paref->{logtxt} = "(hourly-$mstr) updating"; $paref->{logtxt} = "(hourly-$mstr) updating";
$paref->{newvalue} = $value; $paref->{newvalue} = $value;
@ -9429,6 +9429,8 @@ sub _DbRep_rl_updateHour {
$i++; $i++;
my $max;
for my $val (@{$hourHash->{$hourKey}->[4]}) { for my $val (@{$hourHash->{$hourKey}->[4]}) {
if (!defined $max) { if (!defined $max) {
$max = $val; $max = $val;
@ -9439,7 +9441,6 @@ sub _DbRep_rl_updateHour {
} }
my $value = sprintf "%.${ndp}f", $max; my $value = sprintf "%.${ndp}f", $max;
undef $max;
$paref->{logtxt} = "(hourly-$mstr) updating"; $paref->{logtxt} = "(hourly-$mstr) updating";
$paref->{newvalue} = $value; $paref->{newvalue} = $value;