fhem.pl: add associatedWith reading (Forum #94434)

git-svn-id: https://svn.fhem.de/fhem/trunk@18029 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2018-12-22 19:22:09 +00:00
parent b8aea4b4ae
commit f3e013e40b

View File

@@ -2573,6 +2573,12 @@ CommandRename($$)
delete($oldvalue{$old});
CallFn($new, "RenameFn", $new,$old);# ignore replies
for my $d (keys %defs) {
my $aw = ReadingsVal($d, "associatedWith", "");
next if($aw !~ m/\b$old\b/);
$aw =~ s/\b$old\b/$new/;
setReadingsVal($defs{$d}, "associatedWith", $aw, TimeNow());
}
addStructChange("rename", $new, $param);
DoTrigger("global", "RENAMED $old $new", 1);
@@ -5575,6 +5581,8 @@ getPawList($)
push(@dob, $dn);
}
}
my $aw = ReadingsVal($d, "associatedWith", ""); # Explicit link
push(@dob, split("[ ,]",$aw)) if($aw);
return @dob;
}