From 626dfb2ed67c955fe553ae3fe18077bfc20568f0 Mon Sep 17 00:00:00 2001 From: martinp876 Date: Tue, 3 Jul 2018 18:40:53 +0000 Subject: [PATCH] CUL_HM:another msg counting error git-svn-id: https://svn.fhem.de/fhem/trunk@16940 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index 8b1815fbc..71f7b0d3e 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -7020,14 +7020,10 @@ sub CUL_HM_statCnt(@) {# set msg statistics for (r)ecive (s)end or (u)pdate my ($ioName,$dir,$typ) = @_; my $stat = $modules{CUL_HM}{stat}; if (!$stat->{$ioName}){ - $stat->{r}{$ioName}{h}{$_} = 0 foreach(0..23); - $stat->{r}{$ioName}{d}{$_} = 0 foreach(0..6); - $stat->{s}{$ioName}{h}{$_} = 0 foreach(0..23); - $stat->{s}{$ioName}{d}{$_} = 0 foreach(0..6); - $stat->{rb}{$ioName}{h}{$_} = 0 foreach(0..23); - $stat->{rb}{$ioName}{d}{$_} = 0 foreach(0..6); - $stat->{sb}{$ioName}{h}{$_} = 0 foreach(0..23); - $stat->{sb}{$ioName}{d}{$_} = 0 foreach(0..6); + foreach my $ud ("r","s","rb","sb"){ + $stat->{$ud}{$ioName}{h}{$_} = 0 foreach(0..23); + $stat->{$ud}{$ioName}{d}{$_} = 0 foreach(0..6); + } $stat->{$ioName}{last} = 0; } my @l = localtime(gettimeofday()); @@ -7040,9 +7036,10 @@ sub CUL_HM_statCnt(@) {# set msg statistics for (r)ecive (s)end or (u)pdate $stat->{$ud}{$ioName}{d}{$recentD} += $stat->{$ud}{$ioName}{h}{$_} foreach (0..23); } } - $stat->{r}{$ioName}{h}{$l[2]} = 0; - $stat->{s}{$ioName}{h}{$l[2]} = 0; - $stat->{$ioName}{last} = $l[2]; + foreach my $ud ("r","s","rb","sb"){ + $stat->{$ud}{$ioName}{h}{$l[2]} = 0; + } + $stat->{$ioName}{last} = $l[2]; } if ($dir ne "u"){ $stat->{$dir}{$ioName}{h}{$l[2]}++;