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

Notify/FileLog: notify bug fixed

git-svn-id: https://svn.fhem.de/fhem/trunk@4664 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-01-16 09:45:47 +00:00
parent 47adfbeec4
commit 5d6f999e5e
2 changed files with 5 additions and 17 deletions

View File

@ -39,15 +39,7 @@ notify_Define($$)
return "Bad regexp: $@" if($@);
$hash->{REGEXP} = $re;
$hash->{STATE} = "active";
if(($re =~ m/^([^:]*)$/ ||
$re =~ m/^([^:]*):(.*)$/) &&
defined($defs{$1})) {
$hash->{NOTIFYDEV} = $1
} else {
delete($hash->{NOTIFYDEV}); # when called by modify
}
notifyRegexpChanged($hash, $re);
return undef;
}

View File

@ -70,14 +70,7 @@ FileLog_Define($@)
$hash->{logfile} = $a[2];
$hash->{currentlogfile} = $f;
$hash->{STATE} = "active";
if(($a[3] =~ m/^([^:]*)$/ ||
$a[3] =~ m/^([^:]*):(.*)$/) &&
defined($defs{$1})) {
$hash->{NOTIFYDEV} = $1
} else {
delete($hash->{NOTIFYDEV}); # when called by modify
}
notifyRegexpChanged($hash, $a[3]);
return undef;
}
@ -222,6 +215,7 @@ FileLog_Set($@)
return "Bad regexp: $@" if($@);
$hash->{REGEXP} = $re;
$hash->{DEF} = $hash->{logfile} ." $re";
notifyRegexpChanged($hash, $re);
} elsif($cmd eq "removeRegexpPart") {
my %h;
@ -234,6 +228,7 @@ FileLog_Set($@)
return "Bad regexp: $@" if($@);
$hash->{REGEXP} = $re;
$hash->{DEF} = $hash->{logfile} ." $re";
notifyRegexpChanged($hash, $re);
} elsif($cmd eq "absorb") {
my $victim = $a[2];
@ -270,6 +265,7 @@ FileLog_Set($@)
$hash->{REGEXP} .= "|".$vh->{REGEXP};
$hash->{DEF} = $hash->{logfile} . " ". $hash->{REGEXP};
notifyRegexpChanged($hash, $hash->{REGEXP});
CommandDelete(undef, $victim);
}