mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
93_DbLog.pm: fixing problems by generating DbLog Plots
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4763 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
898794bccc
commit
3070d82fcb
@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
@ -423,7 +424,7 @@ sub DbLog_Log($$) {
|
|||||||
my $DbLogType = AttrVal($hash->{NAME}, "DbLogType", "Current/History");
|
my $DbLogType = AttrVal($hash->{NAME}, "DbLogType", "Current/History");
|
||||||
|
|
||||||
#one Transaction
|
#one Transaction
|
||||||
#eval {
|
eval {
|
||||||
for (my $i = 0; $i < $max; $i++) {
|
for (my $i = 0; $i < $max; $i++) {
|
||||||
my $s = $dev->{CHANGED}[$i];
|
my $s = $dev->{CHANGED}[$i];
|
||||||
$s = "" if(!defined($s));
|
$s = "" if(!defined($s));
|
||||||
@ -473,7 +474,7 @@ sub DbLog_Log($$) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#};
|
};
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -663,12 +664,17 @@ DbLog_Get($@)
|
|||||||
$inf = "history";
|
$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 <mySVG> SVG <DbLogDev>:<gplotfile>:HISTORY)";
|
||||||
|
}
|
||||||
|
|
||||||
if($outf eq "int") {
|
if($outf eq "int") {
|
||||||
$outf = "-";
|
$outf = "-";
|
||||||
$internal = 1;
|
$internal = 1;
|
||||||
} elsif($outf eq "array"){
|
} elsif($outf eq "array"){
|
||||||
|
|
||||||
} elsif(uc($outf) eq "webchart") {
|
} elsif(lc($outf) eq "webchart") {
|
||||||
# redirect the get request to the chartQuery function
|
# redirect the get request to the chartQuery function
|
||||||
return chartQuery($hash, @_);
|
return chartQuery($hash, @_);
|
||||||
}
|
}
|
||||||
@ -788,7 +794,7 @@ DbLog_Get($@)
|
|||||||
$sth->bind_columns(undef, \$sql_timestamp, \$sql_device, \$sql_reading, \$sql_value, \$type, \$event, \$unit);
|
$sth->bind_columns(undef, \$sql_timestamp, \$sql_device, \$sql_reading, \$sql_value, \$type, \$event, \$unit);
|
||||||
}
|
}
|
||||||
else {
|
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)/) {
|
if ($outf =~ m/(all)/) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user