From 4de25ce7feac398c8d136fb0417a8db4b1cc91d3 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Thu, 14 Jun 2018 07:21:25 +0000 Subject: [PATCH] 98_structure.pm: new attribute setStateIndirectly (Forum #70488) git-svn-id: https://svn.fhem.de/fhem/trunk@16865 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_structure.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/98_structure.pm b/fhem/FHEM/98_structure.pm index 1bca2e639..9d16cecfc 100644 --- a/fhem/FHEM/98_structure.pm +++ b/fhem/FHEM/98_structure.pm @@ -49,6 +49,7 @@ structure_Initialize($) disable disabledForIntervals evaluateSetResult:1,0 + setStateIndirectly:1,0 setStructType:0,1 ); use warnings 'qw'; @@ -420,10 +421,11 @@ structure_Set($@) my $filter; if($list[1] ne "?") { 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=.*)]/) { - delete($hash->{INSET}); # Experimental, Forum #35382 + delete($hash->{INSET}); # Forum #35382 $filter = $1; @list = split(" ", $list[0] ." ". substr($state, length($filter)+2)); } @@ -523,6 +525,7 @@ structure_Attr($@) group=>1, icon=>1, room=>1, + setStateIndirectly=>1, stateFormat=>1, webCmd=>1, userattr=>1 @@ -731,6 +734,12 @@ structure_Attr($@) compute the new status. +
  • setStateIndirectly
    + 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. +
  • +
  • setStructType
    If true (1), then the <struct-type> will be set as an attribute 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.
  • +
  • setStateIndirectly
    + Falls wahr (1), dann wird der Status der Struktur nur aus dem + Statusmeldungen der Mitglied-Geräte bestimmt, sonst wird zuerst der + Status auf dem set Argument gesetzt. Die Voreinstellung ist 0. +
  • setStructType
    Falls wahr (1), <struct-type> wird als Attribute für jedes