mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
structure.pm: add filterEvents (Forum #131841)
git-svn-id: https://svn.fhem.de/fhem/trunk@27133 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e8394a46b0
commit
e5a8fdc351
@ -46,10 +46,11 @@ structure_Initialize($)
|
|||||||
async_delay
|
async_delay
|
||||||
clientstate_behavior:relative,relativeKnown,absolute,last
|
clientstate_behavior:relative,relativeKnown,absolute,last
|
||||||
clientstate_priority
|
clientstate_priority
|
||||||
|
considerDisabledMembers
|
||||||
disable
|
disable
|
||||||
disabledForIntervals
|
disabledForIntervals
|
||||||
considerDisabledMembers
|
|
||||||
evaluateSetResult:1,0
|
evaluateSetResult:1,0
|
||||||
|
filterEvents:1,0
|
||||||
propagateAttr
|
propagateAttr
|
||||||
setStateIndirectly:1,0
|
setStateIndirectly:1,0
|
||||||
setStructType:0,1
|
setStructType:0,1
|
||||||
@ -211,6 +212,21 @@ structure_Notify($$)
|
|||||||
|
|
||||||
return "" if (! exists $hash->{".memberHash"}->{$devName});
|
return "" if (! exists $hash->{".memberHash"}->{$devName});
|
||||||
|
|
||||||
|
if(AttrVal($me, "filterEvents", 0) &&
|
||||||
|
AttrVal($devName, $devmap, 0)) { #131841
|
||||||
|
my %re;
|
||||||
|
map {
|
||||||
|
my @val = split(":",$_);
|
||||||
|
$re{$val[0]} = 1 if(@val==1 || @val==3);
|
||||||
|
} attrSplit($attr{$devName}{$devmap});
|
||||||
|
my @re = keys %re;
|
||||||
|
my $fnd;
|
||||||
|
map {
|
||||||
|
my $e = $_; map { $fnd = 1 if($e =~ m/^$_:/) } @re;
|
||||||
|
} @{deviceEvents($dev, 0)};
|
||||||
|
return "" if(!$fnd);
|
||||||
|
}
|
||||||
|
|
||||||
my $behavior = AttrVal($me, "clientstate_behavior", "absolute");
|
my $behavior = AttrVal($me, "clientstate_behavior", "absolute");
|
||||||
my %clientstate;
|
my %clientstate;
|
||||||
|
|
||||||
@ -768,6 +784,14 @@ structure_Attr($@)
|
|||||||
compute the new status.
|
compute the new status.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<a id="structure-attr-filterEvents"></a>
|
||||||
|
<li>filterEvents<br>
|
||||||
|
if set, and the device triggering the event has a struct_type map, the
|
||||||
|
only events (i.e. reading names) contained in the structure map will
|
||||||
|
trigger the structure. Note: only the readingName and
|
||||||
|
readingName:oldVal:newVal entries of the struct_type map are considered.
|
||||||
|
</li>
|
||||||
|
|
||||||
<a id="structure-attr-propagateAttr"></a>
|
<a id="structure-attr-propagateAttr"></a>
|
||||||
<li>propagateAttr <regexp><br>
|
<li>propagateAttr <regexp><br>
|
||||||
if the regexp matches the name of the attribute, then this attribute will
|
if the regexp matches the name of the attribute, then this attribute will
|
||||||
@ -1016,6 +1040,15 @@ structure_Attr($@)
|
|||||||
neuen Status auswerten soll.
|
neuen Status auswerten soll.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<a id="structure-attr-filterEvents"></a>
|
||||||
|
<li>filterEvents<br>
|
||||||
|
falls gesetzt, und das Event auslösende Gerät über ein
|
||||||
|
struct_type map verfügt, dann werden nur solche Events die
|
||||||
|
Strukturberechnung auslösen, die in diesem map enthalten sind.<br>
|
||||||
|
Achtung: in struct_type map werden nur die readingName und
|
||||||
|
readingName:oldVal:newVal Einträge berücksichtigt.
|
||||||
|
</li>
|
||||||
|
|
||||||
<a id="structure-attr-propagateAttr"></a>
|
<a id="structure-attr-propagateAttr"></a>
|
||||||
<li>propagateAttr <regexp><br>
|
<li>propagateAttr <regexp><br>
|
||||||
Falls der Regexp auf den Namen des Attributes zutrifft, dann wird dieses
|
Falls der Regexp auf den Namen des Attributes zutrifft, dann wird dieses
|
||||||
|
Loading…
x
Reference in New Issue
Block a user