mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26:02 +00:00
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:
parent
b25830a613
commit
839697020d
@ -2573,6 +2573,12 @@ CommandRename($$)
|
|||||||
delete($oldvalue{$old});
|
delete($oldvalue{$old});
|
||||||
|
|
||||||
CallFn($new, "RenameFn", $new,$old);# ignore replies
|
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);
|
addStructChange("rename", $new, $param);
|
||||||
DoTrigger("global", "RENAMED $old $new", 1);
|
DoTrigger("global", "RENAMED $old $new", 1);
|
||||||
@ -5575,6 +5581,8 @@ getPawList($)
|
|||||||
push(@dob, $dn);
|
push(@dob, $dn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
my $aw = ReadingsVal($d, "associatedWith", ""); # Explicit link
|
||||||
|
push(@dob, split("[ ,]",$aw)) if($aw);
|
||||||
return @dob;
|
return @dob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user