mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 10:46:03 +00:00
10_ZWave.pm: change parseHook order, add veto possibility (Forum #38587)
git-svn-id: https://svn.fhem.de/fhem/trunk@10608 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
82833b8ef3
commit
c41c9d0595
@ -2189,6 +2189,7 @@ ZWave_associationRequest($$)
|
||||
return if($grp >= $nGrp);
|
||||
$zwave_parseHook{"$hash->{nodeIdHex}:..85"} = \&ZWave_associationRequest;
|
||||
ZWave_Set($hash, $hash->{NAME}, "associationRequest", $grp+1);
|
||||
return undef; # No veto for further parsing
|
||||
}
|
||||
|
||||
|
||||
@ -3358,26 +3359,28 @@ ZWave_Parse($$@)
|
||||
next;
|
||||
}
|
||||
|
||||
my $matched = 0;
|
||||
foreach my $k (keys %{$ptr}) {
|
||||
if($arg =~ m/^$k/) {
|
||||
my $val = $ptr->{$k};
|
||||
my @val = ($val);
|
||||
@val = eval $val if(index($val, '$') >= 0);
|
||||
push @event, @val if(defined($val[0]));
|
||||
$matched++;
|
||||
}
|
||||
}
|
||||
|
||||
my $hookVeto = 0;
|
||||
foreach my $h (keys %zwave_parseHook) {
|
||||
if("$id:$arg" =~ m/$h/) {
|
||||
my $fn = $zwave_parseHook{$h};
|
||||
delete $zwave_parseHook{$h};
|
||||
$fn->($hash, $arg);
|
||||
$hookVeto++ if($fn->($hash, $arg));
|
||||
}
|
||||
}
|
||||
|
||||
push @event, "UNPARSED:$className $arg" if(!$matched);
|
||||
if(!$hookVeto) {
|
||||
my $matched = 0;
|
||||
foreach my $k (keys %{$ptr}) {
|
||||
if($arg =~ m/^$k/) {
|
||||
my $val = $ptr->{$k};
|
||||
my @val = ($val);
|
||||
@val = eval $val if(index($val, '$') >= 0);
|
||||
push @event, @val if(defined($val[0]));
|
||||
$matched++;
|
||||
}
|
||||
}
|
||||
push @event, "UNPARSED:$className $arg" if(!$matched);
|
||||
}
|
||||
}
|
||||
|
||||
if($arg =~ m/^028407/) { # wakeup:notification
|
||||
|
Loading…
x
Reference in New Issue
Block a user