From eb09fd81c3912a092903a05dba45097e758f7f17 Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Sun, 21 Jun 2015 17:35:22 +0000 Subject: [PATCH] 00_HMLAN: convert to real load display - relative values in history git-svn-id: https://svn.fhem.de/fhem/trunk@8796 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_HMLAN.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/00_HMLAN.pm b/fhem/FHEM/00_HMLAN.pm index 3db2e773b..5d71ae225 100755 --- a/fhem/FHEM/00_HMLAN.pm +++ b/fhem/FHEM/00_HMLAN.pm @@ -117,8 +117,10 @@ sub HMLAN_Define($$) {######################################################### my @arr = (); @{$hash->{helper}{q}{apIDs}} = \@arr; - $hash->{helper}{q}{loadLast} = 0; - $hash->{msgLoadHistory} = join("/",("-") x $HMmlSlice); + $hash->{helper}{q}{loadNo} = 0; + $hash->{helper}{q}{loadLast} = 0; + $hash->{msgLoadHistory} = (60/$HMmlSlice)."min steps: " + .join("/",("-") x $HMmlSlice); $hash->{msgLoadCurrent} = 0; $defs{$name}{helper}{log}{all} = 0;# selective log support @@ -298,10 +300,12 @@ sub HMLAN_UpdtMsgLoad($$) {#################################################### my $t = int(gettimeofday()/(3600/$HMmlSlice))%$HMmlSlice; - if ($hash->{helper}{q}{loadLast} != $t){ - $hash->{helper}{q}{loadLast} = $t; + if ($hash->{helper}{q}{loadNo} != $t){ + $hash->{helper}{q}{loadNo} = $t; my (undef,@a) = split(": ",$hash->{msgLoadHistory}); - @a = ($hash->{msgLoadCurrent},split("/",$a[0])); + @a = ( ($hash->{msgLoadCurrent} - $hash->{helper}{q}{loadLast}) + ,split("/",$a[0])); + $hash->{helper}{q}{loadLast} = $hash->{msgLoadCurrent}; $hash->{msgLoadHistory} = (60/$HMmlSlice)."min steps: " .join("/",@a[0...($HMmlSlice-1)]);