From ce4a031db82e6addbdafd5d489976281f8c71592 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 14 Apr 2018 10:31:20 +0000 Subject: [PATCH] 98_structure.pm: setStructType, default=1 for featurelevel<=5.8 (Forum #86921) git-svn-id: https://svn.fhem.de/fhem/trunk@16613 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_structure.pm | 35 +++++++++++++++++++++++++++++------ fhem/UPGRADE | 3 +++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/98_structure.pm b/fhem/FHEM/98_structure.pm index b4c7d6965..1bca2e639 100644 --- a/fhem/FHEM/98_structure.pm +++ b/fhem/FHEM/98_structure.pm @@ -41,10 +41,18 @@ structure_Initialize($) $hash->{NotifyFn} = "structure_Notify"; $hash->{SetFn} = "structure_Set"; $hash->{AttrFn} = "structure_Attr"; - $hash->{AttrList} = "async_delay clientstate_priority ". - "clientstate_behavior:relative,relativeKnown,absolute,last ". - "disable disabledForIntervals evaluateSetResult:1,0 ". - $readingFnAttributes; + no warnings 'qw'; + my @attrList = qw( + async_delay + clientstate_behavior:relative,relativeKnown,absolute,last + clientstate_priority + disable + disabledForIntervals + evaluateSetResult:1,0 + setStructType:0,1 + ); + use warnings 'qw'; + $hash->{AttrList} = join(" ", @attrList)." $readingFnAttributes"; my %ahash = ( Fn=>"CommandAddStruct", Hlp=>" ,add to " ); @@ -97,7 +105,8 @@ structure_Define($$) structure_setDevs($hash, $def); # needed by set while init is running InternalTimer(1, sub { # repeat it for devices defined later structure_setDevs($hash, $def); - structure_Attr("set", $devname, $stype, $devname); + structure_Attr("set", $devname, $stype, $devname) + if(AttrVal($devname, "setStructType", $featurelevel <= 5.8)); }, undef, 0); return undef; @@ -722,9 +731,17 @@ structure_Attr($@) compute the new status. +
  • 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 + featurelevel <= 5.8. +
  • +
  • structexclude
    - exclude the device from set/notify or attribute operations. For the set + Note: this is an attribute for the member device, not for the struct + itself.
    + Exclude the device from set/notify or attribute operations. For the set and notify the value of structexclude must match the structure name, for the attr/deleteattr commands ist must match the combination of structure_name:attribute_name. Examples:
    @@ -931,6 +948,12 @@ structure_Attr($@)
  • +
  • setStructType
    + Falls wahr (1), <struct-type> wird als Attribute für jedes + Mitglied-Gerät auf dem Namen der Struktur gesetzt. + Wahr ist die Voreinstellung für featurelevel <= 5.8. +
  • +
  • structexclude
    Bei gesetztem Attribut wird set, attr/deleteattr ignoriert. Dies trifft ebenfalls auf die Weitergabe des Devicestatus an die Struktur zu. diff --git a/fhem/UPGRADE b/fhem/UPGRADE index 004e01892..c56546e25 100644 --- a/fhem/UPGRADE +++ b/fhem/UPGRADE @@ -23,3 +23,6 @@ enable the old feature. rewrite the above call to: wget 'http://fhemhost:8083/fhem?cmd=set%20device%20on&fwcsrf=mySecret' There are other solutions in the FHEM wiki. + +- 20XX-XX-XX (5.9) + - the default for the setStructType structure attribute changed from 1 to 0