mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
93_DbLog: Added support for longpoll SVG.
git-svn-id: https://svn.fhem.de/fhem/trunk@9688 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a13bc14769
commit
e36f27a75f
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 93_DbLog: Added support for longpoll SVG.
|
||||||
- feature: contrib/98_openweathermap.pm - add support for stationByZip.
|
- feature: contrib/98_openweathermap.pm - add support for stationByZip.
|
||||||
e.g. 76133,de will find weather data for Karlsruhe,Germany
|
e.g. 76133,de will find weather data for Karlsruhe,Germany
|
||||||
- bugfix: 38_CO20: fixed error messages on timeout
|
- bugfix: 38_CO20: fixed error messages on timeout
|
||||||
|
@ -33,14 +33,15 @@ sub DbLog_Initialize($)
|
|||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
$hash->{DefFn} = "DbLog_Define";
|
$hash->{DefFn} = "DbLog_Define";
|
||||||
$hash->{UndefFn} = "DbLog_Undef";
|
$hash->{UndefFn} = "DbLog_Undef";
|
||||||
$hash->{NotifyFn} = "DbLog_Log";
|
$hash->{NotifyFn} = "DbLog_Log";
|
||||||
$hash->{SetFn} = "DbLog_Set";
|
$hash->{SetFn} = "DbLog_Set";
|
||||||
$hash->{GetFn} = "DbLog_Get";
|
$hash->{GetFn} = "DbLog_Get";
|
||||||
$hash->{AttrFn} = "DbLog_Attr";
|
$hash->{AttrFn} = "DbLog_Attr";
|
||||||
$hash->{ShutdownFn} = "DbLog_Shutdown";
|
$hash->{SVG_regexpFn} = "DbLog_regexpFn";
|
||||||
$hash->{AttrList} = "disable:0,1 ".
|
$hash->{ShutdownFn} = "DbLog_Shutdown";
|
||||||
|
$hash->{AttrList} = "disable:0,1 ".
|
||||||
"DbLogType:Current,History,Current/History ".
|
"DbLogType:Current,History,Current/History ".
|
||||||
"shutdownWait ".
|
"shutdownWait ".
|
||||||
"suppressUndef:0,1 ".
|
"suppressUndef:0,1 ".
|
||||||
@ -142,6 +143,32 @@ sub DbLog_Attr(@)
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
#
|
||||||
|
# Exrahieren des Filters aus der ColumnsSpec (gplot-Datei)
|
||||||
|
#
|
||||||
|
# Die grundlegend idee ist das jeder svg plot einen filter hat der angibt
|
||||||
|
# welches device und reading dargestellt wird so das der plot sich neu
|
||||||
|
# lädt wenn es ein entsprechendes event gibt.
|
||||||
|
#
|
||||||
|
# Parameter: Quell-Instanz-Name, und alle FileLog-Parameter, die diese Instanz betreffen.
|
||||||
|
# Quelle: http://forum.fhem.de/index.php/topic,40176.msg325200.html#msg325200
|
||||||
|
################################################################
|
||||||
|
sub DbLog_regexpFn($$) {
|
||||||
|
my ($name, $filter) = @_;
|
||||||
|
my $ret;
|
||||||
|
|
||||||
|
my @a = split( ' ', $filter );
|
||||||
|
for(my $i = 0; $i < int(@a); $i++) {
|
||||||
|
my @fld = split(":", $a[$i]);
|
||||||
|
|
||||||
|
$ret .= '|' if( $ret );
|
||||||
|
$ret .= $fld[0] .'.'. $fld[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
#
|
#
|
||||||
# Parsefunktion, abhaengig vom Devicetyp
|
# Parsefunktion, abhaengig vom Devicetyp
|
||||||
@ -501,6 +528,8 @@ sub DbLog_Log($$) {
|
|||||||
# Log is my entry, Dev is the entry of the changed device
|
# Log is my entry, Dev is the entry of the changed device
|
||||||
my ($hash, $dev) = @_;
|
my ($hash, $dev) = @_;
|
||||||
|
|
||||||
|
Log3 $hash,5, "Notify from Device: ".$dev->{NAME}." recieved";
|
||||||
|
|
||||||
return undef if($hash->{STATE} eq "disabled");
|
return undef if($hash->{STATE} eq "disabled");
|
||||||
|
|
||||||
# name and type required for parsing
|
# name and type required for parsing
|
||||||
@ -1884,7 +1913,7 @@ DbLog_sampleDataFn($$$$$)
|
|||||||
# Table Current present, use it for sample data
|
# Table Current present, use it for sample data
|
||||||
|
|
||||||
my $dbhf = $defs{$dlName}{DBHF};
|
my $dbhf = $defs{$dlName}{DBHF};
|
||||||
my $query = "select device,reading,value from current where device <> '' group by device,reading order by device,reading";
|
my $query = "select device,reading,value from current where device <> '' order by device,reading";
|
||||||
my $sth = $dbhf->prepare( $query );
|
my $sth = $dbhf->prepare( $query );
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
while (my @line = $sth->fetchrow_array()) {
|
while (my @line = $sth->fetchrow_array()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user