From c20b60708b60b3dd4e3535f5c8669b4565542380 Mon Sep 17 00:00:00 2001 From: tobiasfaust Date: Tue, 28 Jan 2014 18:24:09 +0000 Subject: [PATCH] 93_DbLog.pm: fixing problems by generating DbLog Plots git-svn-id: https://svn.fhem.de/fhem/trunk@4763 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/93_DbLog.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/93_DbLog.pm b/fhem/FHEM/93_DbLog.pm index 22bc23277..959caa8db 100644 --- a/fhem/FHEM/93_DbLog.pm +++ b/fhem/FHEM/93_DbLog.pm @@ -1,4 +1,5 @@ + ############################################## # $Id$ # @@ -423,7 +424,7 @@ sub DbLog_Log($$) { my $DbLogType = AttrVal($hash->{NAME}, "DbLogType", "Current/History"); #one Transaction - #eval { + eval { for (my $i = 0; $i < $max; $i++) { my $s = $dev->{CHANGED}[$i]; $s = "" if(!defined($s)); @@ -473,7 +474,7 @@ sub DbLog_Log($$) { } } - #}; + }; return ""; } @@ -663,12 +664,17 @@ DbLog_Get($@) $inf = "history"; } + if($outf eq "int" && $inf eq "current") { + $inf = "history"; + Log3 $hash->{NAME}, 3, "Defining DbLog SVG-Plots with :CURRENT is deprecated. Please define DbLog SVG-Plots with :HISTORY instead of :CURRENT. (define SVG ::HISTORY)"; + } + if($outf eq "int") { $outf = "-"; $internal = 1; } elsif($outf eq "array"){ - } elsif(uc($outf) eq "webchart") { + } elsif(lc($outf) eq "webchart") { # redirect the get request to the chartQuery function return chartQuery($hash, @_); } @@ -788,7 +794,7 @@ DbLog_Get($@) $sth->bind_columns(undef, \$sql_timestamp, \$sql_device, \$sql_reading, \$sql_value, \$type, \$event, \$unit); } else { - $sth->bind_columns(undef, \$sql_timestamp, \$sql_value); + $sth->bind_columns(undef, \$sql_timestamp, \$sql_device, \$sql_reading, \$sql_value); } if ($outf =~ m/(all)/) {