2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 04:36:02 +00:00

fhem.pl: previous hack removed, disableNotifyFn implemented (Forum #121631)

git-svn-id: https://svn.fhem.de/fhem/trunk@24651 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-06-17 18:56:32 +00:00
parent 467d7e6b19
commit a90a2f38c9

View File

@ -135,7 +135,7 @@ sub json2nameValue($;$$$);
sub json2reading($$;$$$$);
sub latin1ToUtf8($);
sub myrename($$$);
sub notifyRegexpChanged($$);
sub notifyRegexpChanged($$;$);
sub parseParams($;$$$);
sub prepareFhemTestFile();
sub perlSyntaxCheck($%);
@ -3882,7 +3882,7 @@ CallFn(@)
return undef;
}
my $fn = $modules{$defs{$d}{TYPE}}{$n};
return "" if(!$fn || $defs{$d}{"disable$n"}); #121631
return "" if(!$fn);
if(wantarray) {
no strict "refs";
my @ret = &{$fn}(@_);
@ -5516,6 +5516,7 @@ createNtfyHash()
my @ntfyList = sort { $defs{$a}{NTFY_ORDER} cmp $defs{$b}{NTFY_ORDER} }
grep { $defs{$_}{NTFY_ORDER} &&
$defs{$_}{TYPE} &&
!$defs{$_}{disableNotifyFn} &&
$modules{$defs{$_}{TYPE}}{NotifyFn} } keys %defs;
my %d2a_cache;
%ntfyHash = ("*" => []);
@ -5565,10 +5566,17 @@ notifyRegexpCheck($)
}
sub
notifyRegexpChanged($$)
notifyRegexpChanged($$;$)
{
my ($hash, $re) = @_;
my ($hash, $re, $disableNotifyFn) = @_;
%ntfyHash = ();
if($disableNotifyFn) {
delete($hash->{NOTIFYDEV});
$hash->{disableNotifyFn}=1;
return;
}
delete($hash->{disableNotifyFn});
my @list2 = split(/\|/, $re);
my @list = grep { m/./ } # Forum #62369
map { (m/^\(?([A-Za-z0-9\.\_]+(?:\.[\+\*])?)(?::.*)?\)?$/ &&
@ -5580,7 +5588,6 @@ notifyRegexpChanged($$)
} else {
delete($hash->{NOTIFYDEV});
}
%ntfyHash = ();
}
sub