Notify/FileLog: notify bug fixed
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@4664 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -39,15 +39,7 @@ notify_Define($$)
|
|||||||
return "Bad regexp: $@" if($@);
|
return "Bad regexp: $@" if($@);
|
||||||
$hash->{REGEXP} = $re;
|
$hash->{REGEXP} = $re;
|
||||||
$hash->{STATE} = "active";
|
$hash->{STATE} = "active";
|
||||||
|
notifyRegexpChanged($hash, $re);
|
||||||
if(($re =~ m/^([^:]*)$/ ||
|
|
||||||
$re =~ m/^([^:]*):(.*)$/) &&
|
|
||||||
defined($defs{$1})) {
|
|
||||||
$hash->{NOTIFYDEV} = $1
|
|
||||||
} else {
|
|
||||||
delete($hash->{NOTIFYDEV}); # when called by modify
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,14 +70,7 @@ FileLog_Define($@)
|
|||||||
$hash->{logfile} = $a[2];
|
$hash->{logfile} = $a[2];
|
||||||
$hash->{currentlogfile} = $f;
|
$hash->{currentlogfile} = $f;
|
||||||
$hash->{STATE} = "active";
|
$hash->{STATE} = "active";
|
||||||
|
notifyRegexpChanged($hash, $a[3]);
|
||||||
if(($a[3] =~ m/^([^:]*)$/ ||
|
|
||||||
$a[3] =~ m/^([^:]*):(.*)$/) &&
|
|
||||||
defined($defs{$1})) {
|
|
||||||
$hash->{NOTIFYDEV} = $1
|
|
||||||
} else {
|
|
||||||
delete($hash->{NOTIFYDEV}); # when called by modify
|
|
||||||
}
|
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@@ -222,6 +215,7 @@ FileLog_Set($@)
|
|||||||
return "Bad regexp: $@" if($@);
|
return "Bad regexp: $@" if($@);
|
||||||
$hash->{REGEXP} = $re;
|
$hash->{REGEXP} = $re;
|
||||||
$hash->{DEF} = $hash->{logfile} ." $re";
|
$hash->{DEF} = $hash->{logfile} ." $re";
|
||||||
|
notifyRegexpChanged($hash, $re);
|
||||||
|
|
||||||
} elsif($cmd eq "removeRegexpPart") {
|
} elsif($cmd eq "removeRegexpPart") {
|
||||||
my %h;
|
my %h;
|
||||||
@@ -234,6 +228,7 @@ FileLog_Set($@)
|
|||||||
return "Bad regexp: $@" if($@);
|
return "Bad regexp: $@" if($@);
|
||||||
$hash->{REGEXP} = $re;
|
$hash->{REGEXP} = $re;
|
||||||
$hash->{DEF} = $hash->{logfile} ." $re";
|
$hash->{DEF} = $hash->{logfile} ." $re";
|
||||||
|
notifyRegexpChanged($hash, $re);
|
||||||
|
|
||||||
} elsif($cmd eq "absorb") {
|
} elsif($cmd eq "absorb") {
|
||||||
my $victim = $a[2];
|
my $victim = $a[2];
|
||||||
@@ -270,6 +265,7 @@ FileLog_Set($@)
|
|||||||
|
|
||||||
$hash->{REGEXP} .= "|".$vh->{REGEXP};
|
$hash->{REGEXP} .= "|".$vh->{REGEXP};
|
||||||
$hash->{DEF} = $hash->{logfile} . " ". $hash->{REGEXP};
|
$hash->{DEF} = $hash->{logfile} . " ". $hash->{REGEXP};
|
||||||
|
notifyRegexpChanged($hash, $hash->{REGEXP});
|
||||||
CommandDelete(undef, $victim);
|
CommandDelete(undef, $victim);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user