fhem.pl: NOTIFYDEV uses devspec2array (Forum #59300 / #59274)

git-svn-id: https://svn.fhem.de/fhem/trunk@12386 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2016-10-20 08:01:00 +00:00
parent 0754434c23
commit fa7e6bc208

View File

@@ -4385,7 +4385,7 @@ createNtfyHash()
grep { $defs{$_}{NTFY_ORDER} } keys %defs; grep { $defs{$_}{NTFY_ORDER} } keys %defs;
foreach my $d (@ntfyList) { foreach my $d (@ntfyList) {
if($defs{$d}{NOTIFYDEV}) { if($defs{$d}{NOTIFYDEV}) {
foreach my $nd (split(",",$defs{$d}{NOTIFYDEV})) { foreach my $nd (devspec2array($defs{$d}{NOTIFYDEV})) {
$ntfyHash{$nd} = [] if($nd && !defined($ntfyHash{$nd})); $ntfyHash{$nd} = [] if($nd && !defined($ntfyHash{$nd}));
} }
} }
@@ -4393,7 +4393,7 @@ createNtfyHash()
$ntfyHash{"*"} = []; $ntfyHash{"*"} = [];
foreach my $d (@ntfyList) { foreach my $d (@ntfyList) {
if($defs{$d}{NOTIFYDEV}) { if($defs{$d}{NOTIFYDEV}) {
foreach my $nd (split(",",$defs{$d}{NOTIFYDEV})) { foreach my $nd (devspec2array($defs{$d}{NOTIFYDEV})) {
my $arr = $ntfyHash{$nd}; my $arr = $ntfyHash{$nd};
push @{$arr}, $d if(!grep /^$d$/, @{$arr}); push @{$arr}, $d if(!grep /^$d$/, @{$arr});
} }