statistics: bugfix durationReadings

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@11056 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
grompo
2016-03-13 16:41:38 +00:00
parent cd696a87a0
commit 07376732f3

View File

@@ -922,8 +922,8 @@ sub statistics_doStatisticDurationSingle ($$$$$$)
$saveLast = 0;
$lastState = $state;
$hidden{"(since:"} = strftime ("%Y-%m-%d_%H:%M:%S)",localtime() );
$hidden{$state} = 0;
$hidden{$state."_Count"} = 1;
$hidden{$state.":"} = 0;
$hidden{$state."_Count:"} = 1;
}
# Do calculations if hidden reading exists
else {
@@ -955,10 +955,10 @@ sub statistics_doStatisticDurationSingle ($$$$$$)
#Store current value for single readings
$stat{$key} = $hidden{$key};
# Reset hidden reading if period change
if ($saveLast && $key ne $state."_Count") {
if ($saveLast && $key ne $state."_Count:") {
delete $hidden{$key};
}
elsif ($saveLast && $key eq $state."_Count") {
elsif ($saveLast && $key eq $state."_Count:") {
$hidden{$key} = 1;
}
}