structure: clientstate_priority may be splitted by / (fhem.pl attrSplit function)
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@4371 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -159,7 +159,7 @@ sub structure_Notify($$)
|
|||||||
my $behavior = AttrVal($me, "clientstate_behavior", "absolute");
|
my $behavior = AttrVal($me, "clientstate_behavior", "absolute");
|
||||||
my %clientstate;
|
my %clientstate;
|
||||||
|
|
||||||
my @structPrio = split(" ", $attr{$me}{clientstate_priority})
|
my @structPrio = attrSplit($attr{$me}{clientstate_priority})
|
||||||
if($attr{$me}{clientstate_priority});
|
if($attr{$me}{clientstate_priority});
|
||||||
|
|
||||||
return "" if($hash->{INSET}); # Do not trigger for our own set
|
return "" if($hash->{INSET}); # Do not trigger for our own set
|
||||||
@@ -187,7 +187,7 @@ sub structure_Notify($$)
|
|||||||
next if(!$defs{$d});
|
next if(!$defs{$d});
|
||||||
|
|
||||||
if($attr{$d} && $attr{$d}{$devmap}) {
|
if($attr{$d} && $attr{$d}{$devmap}) {
|
||||||
my @gruppe = split(" ", $attr{$d}{$devmap});
|
my @gruppe = attrSplit($attr{$d}{$devmap});
|
||||||
my @value;
|
my @value;
|
||||||
for (my $i=0; $i<@gruppe; $i++) {
|
for (my $i=0; $i<@gruppe; $i++) {
|
||||||
@value = split(":", $gruppe[$i]);
|
@value = split(":", $gruppe[$i]);
|
||||||
@@ -484,7 +484,7 @@ structure_Attr($@)
|
|||||||
If clientstate_behavior is set to relative, then you have to set the
|
If clientstate_behavior is set to relative, then you have to set the
|
||||||
attribute "clientstate_priority" with all states of the defined devices
|
attribute "clientstate_priority" with all states of the defined devices
|
||||||
to this structure in descending order. Each group is delemited by
|
to this structure in descending order. Each group is delemited by
|
||||||
space. Each entry of one group is delimited by "pipe". The status
|
space or /. Each entry of one group is delimited by "pipe". The status
|
||||||
represented by the structure is the first entry of each group.
|
represented by the structure is the first entry of each group.
|
||||||
Example:<br>
|
Example:<br>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -623,7 +623,7 @@ structure_Attr($@)
|
|||||||
beinflusst. Die Prioritäten sind in absteigender Reihenfolge anzugeben.
|
beinflusst. Die Prioritäten sind in absteigender Reihenfolge anzugeben.
|
||||||
Dabei können Gruppen mit identischer Priorität angegeben werden, um zb.
|
Dabei können Gruppen mit identischer Priorität angegeben werden, um zb.
|
||||||
unterschiedliche Devicetypen zusammenfassen zu können. Jede Gruppe wird durch
|
unterschiedliche Devicetypen zusammenfassen zu können. Jede Gruppe wird durch
|
||||||
Leerzeichen, jeder Eintrag pro Gruppe durch Pipe getrennt. Der Status der
|
Leerzeichen oder /, jeder Eintrag pro Gruppe durch Pipe getrennt. Der Status der
|
||||||
Struktur ist der erste Eintrag in der entsprechenden Gruppe.
|
Struktur ist der erste Eintrag in der entsprechenden Gruppe.
|
||||||
</li>
|
</li>
|
||||||
<br>Beispiel:<br>
|
<br>Beispiel:<br>
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ sub CommandChain($$);
|
|||||||
sub Dispatch($$$);
|
sub Dispatch($$$);
|
||||||
sub DoTrigger($$@);
|
sub DoTrigger($$@);
|
||||||
sub EvalSpecials($%);
|
sub EvalSpecials($%);
|
||||||
sub EventMapAsList($);
|
|
||||||
sub FmtDateTime($);
|
sub FmtDateTime($);
|
||||||
sub FmtTime($);
|
sub FmtTime($);
|
||||||
sub GetLogLevel(@);
|
sub GetLogLevel(@);
|
||||||
@@ -81,6 +80,7 @@ sub WriteStatefile();
|
|||||||
sub XmlEscape($);
|
sub XmlEscape($);
|
||||||
sub addEvent($$);
|
sub addEvent($$);
|
||||||
sub addToAttrList($);
|
sub addToAttrList($);
|
||||||
|
sub attrSplit($);
|
||||||
sub createInterfaceDefinitions();
|
sub createInterfaceDefinitions();
|
||||||
sub devspec2array($);
|
sub devspec2array($);
|
||||||
sub doGlobalDef($);
|
sub doGlobalDef($);
|
||||||
@@ -1915,7 +1915,7 @@ getAllSets($)
|
|||||||
$em = join(" ", grep { !/ / }
|
$em = join(" ", grep { !/ / }
|
||||||
map { $_ =~ s/.*?=//s;
|
map { $_ =~ s/.*?=//s;
|
||||||
$_ =~ s/.*?://s; $_ }
|
$_ =~ s/.*?://s; $_ }
|
||||||
EventMapAsList($em));
|
attrSplit($em));
|
||||||
$a2 = "$em $a2";
|
$a2 = "$em $a2";
|
||||||
}
|
}
|
||||||
return $a2;
|
return $a2;
|
||||||
@@ -2943,7 +2943,7 @@ addToAttrList($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
EventMapAsList($)
|
attrSplit($)
|
||||||
{
|
{
|
||||||
my ($em) = @_;
|
my ($em) = @_;
|
||||||
my $sc = " "; # Split character
|
my $sc = " "; # Split character
|
||||||
@@ -2968,7 +2968,7 @@ ReplaceEventMap($$$)
|
|||||||
|
|
||||||
my $nstr = join(" ", @{$str}) if(!$dir);
|
my $nstr = join(" ", @{$str}) if(!$dir);
|
||||||
my $changed;
|
my $changed;
|
||||||
my @emList = EventMapAsList($em);
|
my @emList = attrSplit($em);
|
||||||
foreach my $rv (@emList) {
|
foreach my $rv (@emList) {
|
||||||
# Real-Event-Regexp:GivenName[:modifier]
|
# Real-Event-Regexp:GivenName[:modifier]
|
||||||
my ($re, $val, $modifier) = split(":", $rv, 3);
|
my ($re, $val, $modifier) = split(":", $rv, 3);
|
||||||
|
|||||||
Reference in New Issue
Block a user