mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-06 12:18:46 +00:00
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
This commit is contained in:
parent
b7359bc692
commit
ce4a031db8
@ -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=>"<structure> <devspec>,add <devspec> to <structure>" );
|
||||
@ -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.
|
||||
</li>
|
||||
|
||||
<li>setStructType<br>
|
||||
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.
|
||||
</li>
|
||||
|
||||
<a name="structexclude"></a>
|
||||
<li>structexclude<br>
|
||||
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.<br>
|
||||
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:<br>
|
||||
@ -931,6 +948,12 @@ structure_Attr($@)
|
||||
</li>
|
||||
|
||||
|
||||
<li>setStructType<br>
|
||||
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.
|
||||
</li>
|
||||
|
||||
<li>structexclude<br>
|
||||
Bei gesetztem Attribut wird set, attr/deleteattr ignoriert. Dies
|
||||
trifft ebenfalls auf die Weitergabe des Devicestatus an die Struktur zu.
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user