2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

93_DbLog: fix ignore MinInterval if value is "0", Forum: #100344

git-svn-id: https://svn.fhem.de/fhem/trunk@19529 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2019-06-02 05:21:16 +00:00
parent 860c1ba1b3
commit e5f2ecb0c3
2 changed files with 19 additions and 18 deletions

View File

@ -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.
- bugfix: 93_DbLog: fix ignore MinInterval if value is "0", Forum: #100344
- change: 36_Vallox: added reading for handling homebridge speed control - change: 36_Vallox: added reading for handling homebridge speed control
- bugfix: 72_FB_CALLMONITOR: fix wrong call-by-call number removing for - bugfix: 72_FB_CALLMONITOR: fix wrong call-by-call number removing for
german call-by-call numbers german call-by-call numbers

View File

@ -28,6 +28,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
# Version History intern by DS_Starter: # Version History intern by DS_Starter:
our %DbLog_vNotesIntern = ( our %DbLog_vNotesIntern = (
"4.1.1" => "25.05.2019 fix ignore MinInterval if value is \"0\", Forum: #100344",
"4.1.0" => "17.04.2019 DbLog_Get: change reconnect for MySQL (Forum: #99719), change index suggestion in DbLog_configcheck ", "4.1.0" => "17.04.2019 DbLog_Get: change reconnect for MySQL (Forum: #99719), change index suggestion in DbLog_configcheck ",
"4.0.0" => "14.04.2019 rewrite DbLog_PushAsync / DbLog_Push / DbLog_Connectxx, new attribute \"bulkInsert\" ", "4.0.0" => "14.04.2019 rewrite DbLog_PushAsync / DbLog_Push / DbLog_Connectxx, new attribute \"bulkInsert\" ",
"3.14.1" => "12.04.2019 DbLog_Get: change select of MySQL Forum: https://forum.fhem.de/index.php/topic,99280.0.html ", "3.14.1" => "12.04.2019 DbLog_Get: change select of MySQL Forum: https://forum.fhem.de/index.php/topic,99280.0.html ",
@ -1320,7 +1321,7 @@ sub DbLog_Log($$) {
$DoIt = 1 if($DbLogSelectionMode =~ m/Exclude/ ); $DoIt = 1 if($DbLogSelectionMode =~ m/Exclude/ );
if($DbLogExclude && $DbLogSelectionMode =~ m/Exclude/) { if($DbLogExclude && $DbLogSelectionMode =~ m/Exclude/) {
# Bsp: "(temperature|humidity):300 battery:3600" # Bsp: "(temperature|humidity):300,battery:3600"
my @v1 = split(/,/, $DbLogExclude); my @v1 = split(/,/, $DbLogExclude);
for (my $i=0; $i<int(@v1); $i++) { for (my $i=0; $i<int(@v1); $i++) {
@ -1332,7 +1333,8 @@ sub DbLog_Log($$) {
my $lt = $defs{$dev_hash->{NAME}}{Helper}{DBLOG}{$reading}{$hash->{NAME}}{TIME}; my $lt = $defs{$dev_hash->{NAME}}{Helper}{DBLOG}{$reading}{$hash->{NAME}}{TIME};
my $lv = $defs{$dev_hash->{NAME}}{Helper}{DBLOG}{$reading}{$hash->{NAME}}{VALUE}; my $lv = $defs{$dev_hash->{NAME}}{Helper}{DBLOG}{$reading}{$hash->{NAME}}{VALUE};
$lt = 0 if(!$lt); $lt = 0 if(!$lt);
$lv = "" if(!$lv); # $lv = "" if(!$lv);
$lv = "" if(!defined $lv); # Forum: #100344
if(($now-$lt < $v2[1]) && ($lv eq $value)) { if(($now-$lt < $v2[1]) && ($lv eq $value)) {
# innerhalb MinIntervall und LastValue=Value # innerhalb MinIntervall und LastValue=Value
@ -1357,7 +1359,8 @@ sub DbLog_Log($$) {
my $lt = $defs{$dev_hash->{NAME}}{Helper}{DBLOG}{$reading}{$hash->{NAME}}{TIME}; my $lt = $defs{$dev_hash->{NAME}}{Helper}{DBLOG}{$reading}{$hash->{NAME}}{TIME};
my $lv = $defs{$dev_hash->{NAME}}{Helper}{DBLOG}{$reading}{$hash->{NAME}}{VALUE}; my $lv = $defs{$dev_hash->{NAME}}{Helper}{DBLOG}{$reading}{$hash->{NAME}}{VALUE};
$lt = 0 if(!$lt); $lt = 0 if(!$lt);
$lv = "" if(!$lv); # $lv = "" if(!$lv);
$lv = "" if(!defined $lv); # Forum: #100344
if(($now-$lt < $v2[1]) && ($lv eq $value)) { if(($now-$lt < $v2[1]) && ($lv eq $value)) {
# innerhalb MinIntervall und LastValue=Value # innerhalb MinIntervall und LastValue=Value
@ -6078,13 +6081,12 @@ return;
Probably same behavior als reopen, but rereadcfg will read the configuration data before reconnect.</ul><br/> Probably same behavior als reopen, but rereadcfg will read the configuration data before reconnect.</ul><br/>
<code>set &lt;name&gt; userCommand &lt;validSqlStatement&gt;</code><br/><br/> <code>set &lt;name&gt; userCommand &lt;validSqlStatement&gt;</code><br/><br/>
<ul><b>DO NOT USE THIS COMMAND UNLESS YOU REALLY (REALLY!) KNOW WHAT YOU ARE DOING!!!</b><br/><br/> <ul>
Performs any (!!!) sql statement on connected database. Usercommand and result will be written into Performs simple sql select statements on the connected database. Usercommand and result will be written into
corresponding readings.</br> corresponding readings.</br>
The result can only be a single line. If the SQL-Statement seems to deliver a multiline result, it can be suitable The result can only be a single line.
to use the analysis module <a href=https://fhem.de/commandref.html#DbRep>DbRep</a>.</br> The execution of SQL-Statements in DbLog is deprecated. Therefore the analysis module
If the database interface delivers no result (undef), the reading "userCommandResult" contains the message <a href=https://fhem.de/commandref.html#DbRep>DbRep</a> should be used.</br>
"no result".
</ul><br/> </ul><br/>
</ul><br> </ul><br>
@ -7309,14 +7311,12 @@ return;
Zwischen dem Schließen der Verbindung und dem Neuverbinden werden die Konfigurationsdaten neu gelesen</ul><br/> Zwischen dem Schließen der Verbindung und dem Neuverbinden werden die Konfigurationsdaten neu gelesen</ul><br/>
<code>set &lt;name&gt; userCommand &lt;validSqlStatement&gt;</code><br/><br/> <code>set &lt;name&gt; userCommand &lt;validSqlStatement&gt;</code><br/><br/>
<ul><b>BENUTZE DIESE FUNKTION NUR, WENN DU WIRKLICH (WIRKLICH!) WEISST, WAS DU TUST!!!</b><br/><br/> <ul>
Führt einen beliebigen (!!!) sql Befehl in der Datenbank aus. Der Befehl und ein zurückgeliefertes Führt einfache sql select Befehle auf der Datenbank aus. Der Befehl und ein zurückgeliefertes
Ergebnis wird in das Reading "userCommand" bzw. "userCommandResult" geschrieben. Das Ergebnis kann nur Ergebnis wird in das Reading "userCommand" bzw. "userCommandResult" geschrieben. Das Ergebnis kann nur
einzeilig sein. einzeilig sein.
Für SQL-Statements, die mehrzeilige Ergebnisse liefern, kann das Auswertungsmodul Die Ausführung von SQL-Befehlen in DbLog sind deprecated. Dafür sollte das Auswertungsmodul
<a href=https://fhem.de/commandref_DE.html#DbRep>DbRep</a> genutzt werden.</br> <a href=https://fhem.de/commandref_DE.html#DbRep>DbRep</a> genutzt werden.</br>
Wird von der Datenbankschnittstelle kein Ergebnis (undef) zurückgeliefert, erscheint die Meldung "no result"
im Reading "userCommandResult".
</ul><br> </ul><br>
</ul><br> </ul><br>