2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fhem.pl: multi-device NOTIFYDEV patch from Markus (Forum #47119)

git-svn-id: https://svn.fhem.de/fhem/trunk@10433 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-01-10 07:43:26 +00:00
parent b1ceb42fb8
commit c14834723c

View File

@ -4316,18 +4316,20 @@ createNtfyHash()
my @ntfyList = sort { $defs{$a}{NTFY_ORDER} cmp $defs{$b}{NTFY_ORDER} } my @ntfyList = sort { $defs{$a}{NTFY_ORDER} cmp $defs{$b}{NTFY_ORDER} }
grep { $defs{$_}{NTFY_ORDER} } keys %defs; grep { $defs{$_}{NTFY_ORDER} } keys %defs;
foreach my $d (@ntfyList) { foreach my $d (@ntfyList) {
my $nd = $defs{$d}{NOTIFYDEV}; if($defs{$d}{NOTIFYDEV}) {
#Log 1, "Created notify class for $nd / $d" if($nd); foreach my $nd (split(",",$defs{$d}{NOTIFYDEV})) {
$ntfyHash{$nd} = [] if($nd && !defined($ntfyHash{$nd})); $ntfyHash{$nd} = [] if($nd && !defined($ntfyHash{$nd}));
}
}
} }
$ntfyHash{"*"} = []; $ntfyHash{"*"} = [];
foreach my $d (@ntfyList) { foreach my $d (@ntfyList) {
my $nd = $defs{$d}{NOTIFYDEV}; if($defs{$d}{NOTIFYDEV}) {
if($nd) { foreach my $nd (split(",",$defs{$d}{NOTIFYDEV})) {
push @{$ntfyHash{$nd}}, $d; push @{$ntfyHash{$nd}}, $d;
}
} else { } else {
foreach $nd (keys %ntfyHash) { foreach my $nd (keys %ntfyHash) {
push @{$ntfyHash{$nd}}, $d; push @{$ntfyHash{$nd}}, $d;
} }
} }