2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

33_readingsGroup.pm: handle , in reading@{...} expressions. see forum: http://forum.fhem.de/index.php/topic,27399.msg240004.html#msg240004

git-svn-id: https://svn.fhem.de/fhem/trunk@7430 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2015-01-04 15:29:44 +00:00
parent b568a6ed3b
commit 05d1321497

View File

@ -144,14 +144,16 @@ readingsGroup_updateDevices($;$)
my $multi = @list;
for( my $i = 0; $i <= $#list; ++$i ) {
my $regex = $list[$i];
while ($regex && $regex =~ m/^</ && $regex !~ m/>$/ && defined($list[++$i]) ) {
while ($regex
&& ( ($regex =~ m/^</ && $regex !~ m/>$/) #handle , in <...>
|| ($regex =~ m/@\{/ && $regex !~ m/}$/) ) #handle , in reading@{...}
&& defined($list[++$i]) ) {
$regex .= ",". $list[$i];
}
next if( !$regex );
if( $regex =~ m/^<.*>$/ ) {
# handle <{...}@reading>@device
} elsif( $regex =~ m/(.*)@(.*)/ ) {
$regex = $1;
@ -481,7 +483,10 @@ readingsGroup_2html($;$)
my $name = $name;
my $name2 = $name2;
my $regex = $list[$i];
while ($regex && $regex =~ m/^</ && $regex !~ m/>$/ && defined($list[++$i]) ) {
while ($regex
&& ( ($regex =~ m/^</ && $regex !~ m/>$/) #handle , in <...>
|| ($regex =~ m/@\{/ && $regex !~ m/}$/) ) #handle , in reading@{...}
&& defined($list[++$i]) ) {
$regex .= ",". $list[$i];
}
my $h = $h;
@ -956,9 +961,12 @@ readingsGroup_Notify($$)
#foreach my $regex (@list) {
for( my $i = 0; $i <= $#list; ++$i ) {
my $regex = $list[$i];
while ($regex && $regex =~ m/^</ && $regex !~ m/>$/ && defined($list[++$i]) ) {
while ($regex
&& ( ($regex =~ m/^</ && $regex !~ m/>$/) #handle , in <...>
|| ($regex =~ m/@\{/ && $regex !~ m/}$/) ) #handle , in reading@{...}
&& defined($list[++$i]) ) {
$regex .= ",". $list[$i];
}
}
next if( $reading eq "state" && !$show_state && (!defined($regex) || $regex ne "state") );
my $modifier = "";
if( $regex && $regex =~ m/^([+?!]*)(.*)/ ) {