2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00
git-svn-id: https://svn.fhem.de/fhem/trunk@5979 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tpoitzsch 2014-05-26 19:12:51 +00:00
parent 8bd9fd1b3d
commit b5567d0e2c

View File

@ -662,11 +662,15 @@ statistics_doStatisticDelta ($$$$$)
# Store single readings
my $singularReadings = AttrVal($name, "singularReadings", "");
if ($singularReadings ne "") {
# statistics_storeSingularReadings $hashName,$singularReadings,$dev,$statReadingName,$readingName,$statType,$period,$statValue,$lastValue,$saveLast
statistics_storeSingularReadings ($name,$singularReadings,$dev,$statReadingName,$readingName,"Delta","Hour",$stat[1],$last[1],$periodSwitch >= 1);
statistics_storeSingularReadings ($name,$singularReadings,$dev,$statReadingName,$readingName,"Delta","Day",$stat[3],$last[3],$periodSwitch >= 2);
statistics_storeSingularReadings ($name,$singularReadings,$dev,$statReadingName,$readingName,"Delta","Month",$stat[5],$last[5],$periodSwitch >= 3);
statistics_storeSingularReadings ($name,$singularReadings,$dev,$statReadingName,$readingName,"Delta","Year",$stat[7],$last[7],$periodSwitch >= 4);
# statistics_storeSingularReadings $hashName,$singularReadings,$dev,$statReadingName,$readingName,$statType,$period,$value,$lastValue,$saveLast
$value = sprintf "%.".$decPlaces."f", $stat[1];
statistics_storeSingularReadings ($name,$singularReadings,$dev,$statReadingName,$readingName,"Delta","Hour",$value,$last[1],$periodSwitch >= 1);
$value = sprintf "%.".$decPlaces."f", $stat[3];
statistics_storeSingularReadings ($name,$singularReadings,$dev,$statReadingName,$readingName,"Delta","Day",$value,$last[3],$periodSwitch >= 2);
$value = sprintf "%.".$decPlaces."f", $stat[5];
statistics_storeSingularReadings ($name,$singularReadings,$dev,$statReadingName,$readingName,"Delta","Month",$value,$last[5],$periodSwitch >= 3);
$value = sprintf "%.".$decPlaces."f", $stat[7];
statistics_storeSingularReadings ($name,$singularReadings,$dev,$statReadingName,$readingName,"Delta","Year",$value,$last[7],$periodSwitch >= 4);
}
# Store hidden reading
@ -782,7 +786,7 @@ statistics_storeSingularReadings ($$$$$$$$$$)
{
my ($hashName,$singularReadings,$dev,$statReadingName,$readingName,$statType,$period,$statValue,$lastValue,$saveLast) = @_;
return if $singularReadings eq "";
if ($statType eq "Delta") { $statReadingName .= $period;}
else { $statReadingName .= $statType;}
my $devName=$dev->{NAME};