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:
rudolfkoenig
2014-01-16 09:45:47 +00:00
parent ff93b14791
commit ce2d1704f1
2 changed files with 5 additions and 17 deletions

View File

@@ -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;
} }

View File

@@ -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);
} }