98_structure.pm: add reverse modifier to set (Forum #67445)

git-svn-id: https://svn.fhem.de/fhem/trunk@13462 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2017-02-20 08:15:39 +00:00
parent 8bbf0a5855
commit 0529bcb965

View File

@@ -375,6 +375,10 @@ structure_Set($@)
my @devList = split("[ \t][ \t]*", $hash->{DEF}); my @devList = split("[ \t][ \t]*", $hash->{DEF});
shift @devList; shift @devList;
if(@list > 1 && @list[$#list] eq "reverse") {
pop @list;
@devList = reverse @devList;
}
foreach my $d (@devList) { foreach my $d (@devList) {
next if(!$defs{$d}); next if(!$defs{$d});
if($defs{$d}{INSET}) { if($defs{$d}{INSET}) {
@@ -553,9 +557,13 @@ structure_Attr($@)
Every set command is propagated to the attached devices. Exception: if an Every set command is propagated to the attached devices. Exception: if an
attached device has an attribute structexclude, and the attribute value attached device has an attribute structexclude, and the attribute value
matches (as a regexp) the name of the current structure.<br> matches (as a regexp) the name of the current structure.<br>
If the set is of the form <code>set &lt;structure&gt; [FILTER=&lt;filter&gt;] &lt;type-specific&gt;</code> If the set is of the form <code>set &lt;structure&gt;
then :FILTER=&lt;filter&gt; will be appended to the device name in the propagated set for [FILTER=&lt;filter&gt;] &lt;type-specific&gt;</code> then
the attached devices like this: <code>set <devN>:FILTER=&lt;filter&gt; &lt;type-specific&gt;</code> :FILTER=&lt;filter&gt; will be appended to the device name in the
propagated set for the attached devices like this: <code>set
<devN>:FILTER=&lt;filter&gt; &lt;type-specific&gt;</code><br>
If the last set parameter is "reverse", then execute the set commands in
the reverse order.
</ul> </ul>
<br> <br>
@@ -719,10 +727,14 @@ structure_Attr($@)
<ul> <ul>
Jedes set Kommando wird an alle Devices dieser Struktur weitergegeben.<br> Jedes set Kommando wird an alle Devices dieser Struktur weitergegeben.<br>
Aussnahme: das Attribut structexclude ist in einem Device definiert und Aussnahme: das Attribut structexclude ist in einem Device definiert und
dessen Attributwert matched als Regexp zum Namen der aktuellen Struktur.<br> dessen Attributwert matched als Regexp zum Namen der aktuellen
Wenn das set Kommando diese Form hat <code>set &lt;structure&gt; [FILTER=&lt;filter&gt;] &lt;type-specific&gt;</code> Struktur.<br> Wenn das set Kommando diese Form hat <code>set
wird :FILTER=&lt;filter&gt; bei der Weitergebe der set an jeden Devicenamen wie folgt angehängt: &lt;structure&gt; [FILTER=&lt;filter&gt;] &lt;type-specific&gt;</code> wird
<code>set <devN>:FILTER=&lt;filter&gt; &lt;type-specific&gt;</code> :FILTER=&lt;filter&gt; bei der Weitergebe der set an jeden Devicenamen wie
folgt angehängt: <code>set <devN>:FILTER=&lt;filter&gt;
&lt;type-specific&gt;</code><br>
Falls der letzte Parameter reverse ist, dann werden die Befehle in der
umgekehrten Reihenfolge ausgef&uuml;hrt.
</ul> </ul>
<br> <br>
<a name="structureget"></a> <a name="structureget"></a>