2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 01:06:04 +00:00

98_structure.pm: new attribute setStateIndirectly (Forum #70488)

git-svn-id: https://svn.fhem.de/fhem/trunk@16865 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-06-14 07:21:25 +00:00
parent 44b9bfcf31
commit d2c76ed604

View File

@ -49,6 +49,7 @@ structure_Initialize($)
disable disable
disabledForIntervals disabledForIntervals
evaluateSetResult:1,0 evaluateSetResult:1,0
setStateIndirectly:1,0
setStructType:0,1 setStructType:0,1
); );
use warnings 'qw'; use warnings 'qw';
@ -420,10 +421,11 @@ structure_Set($@)
my $filter; my $filter;
if($list[1] ne "?") { if($list[1] ne "?") {
my $state = join(" ", @list[1..@list-1]); my $state = join(" ", @list[1..@list-1]);
readingsSingleUpdate($hash, "state", $state, 1); readingsSingleUpdate($hash, "state", $state, 1)
if(!AttrVal($me, "setStateIndirectly", undef));
if($state =~ /^\[(FILTER=.*)]/) { if($state =~ /^\[(FILTER=.*)]/) {
delete($hash->{INSET}); # Experimental, Forum #35382 delete($hash->{INSET}); # Forum #35382
$filter = $1; $filter = $1;
@list = split(" ", $list[0] ." ". substr($state, length($filter)+2)); @list = split(" ", $list[0] ." ". substr($state, length($filter)+2));
} }
@ -523,6 +525,7 @@ structure_Attr($@)
group=>1, group=>1,
icon=>1, icon=>1,
room=>1, room=>1,
setStateIndirectly=>1,
stateFormat=>1, stateFormat=>1,
webCmd=>1, webCmd=>1,
userattr=>1 userattr=>1
@ -731,6 +734,12 @@ structure_Attr($@)
compute the new status. compute the new status.
</li> </li>
<li>setStateIndirectly<br>
If true (1), set the state only when member devices report a state
change, else the state is first set to the set command argument. Default
is 0.
</li>
<li>setStructType<br> <li>setStructType<br>
If true (1), then the &lt;struct-type&gt; will be set as an attribute for If true (1), then the &lt;struct-type&gt; will be set as an attribute for
each member device to the name of the structure. True is the default for each member device to the name of the structure. True is the default for
@ -947,6 +956,11 @@ structure_Attr($@)
neuen Status auswerten soll. neuen Status auswerten soll.
</li> </li>
<li>setStateIndirectly<br>
Falls wahr (1), dann wird der Status der Struktur nur aus dem
Statusmeldungen der Mitglied-Ger&auml;te bestimmt, sonst wird zuerst der
Status auf dem set Argument gesetzt. Die Voreinstellung ist 0.
</li>
<li>setStructType<br> <li>setStructType<br>
Falls wahr (1), &lt;struct-type&gt; wird als Attribute f&uuml;r jedes Falls wahr (1), &lt;struct-type&gt; wird als Attribute f&uuml;r jedes