2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 07:24:21 +00:00

33_readingsGroup.pm: better webCmdFn matching

added ! flag to force device in <reading>@<device>


git-svn-id: https://svn.fhem.de/fhem/trunk@7318 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-12-24 10:00:41 +00:00
parent 02d134a4aa
commit 8c33bcc2c2

View File

@ -595,7 +595,7 @@ readingsGroup_2html($;$)
my %extPage = (); my %extPage = ();
my ($allSets, undef, undef) = FW_devState($name, "", \%extPage); my ($allSets, undef, undef) = FW_devState($name, "", \%extPage);
my ($set) = split( ' ', $set, 2 ); my ($set) = split( ' ', $set, 2 );
if( $allSets && $allSets =~ m/$set:([^ ]*)/) { if( $allSets && $allSets =~ m/\b$set:([^ ]*)/) {
$values = $1; $values = $1;
} }
} }
@ -634,9 +634,10 @@ readingsGroup_2html($;$)
++$cell_column; ++$cell_column;
next; next;
} else { } else {
if( $regex && $regex =~ m/(.*)@(.*)/ ) { if( $regex && $regex =~ m/(.*)@([!]?)(.*)/ ) {
$regex = $1; $regex = $1;
$name = $2; my $force_device = $2;
$name = $3;
if( $name =~ m/^{(.*)}$/ ) { if( $name =~ m/^{(.*)}$/ ) {
my $DEVICE = $device->[0]; my $DEVICE = $device->[0];
$name = eval $name; $name = eval $name;
@ -645,7 +646,7 @@ readingsGroup_2html($;$)
$h = $defs{$name}; $h = $defs{$name};
next if( !$h ); next if( !$h && !$force_device );
} }
$force_show = 0; $force_show = 0;
@ -659,7 +660,7 @@ readingsGroup_2html($;$)
} elsif( $modifier =~ m/\?/ ) { } elsif( $modifier =~ m/\?/ ) {
$h = $attr{$name}; $h = $attr{$name};
} else { } else {
$h = $h->{READINGS}; $h = $h->{READINGS} if( $h );
} }
$force_show = 1 if( $modifier =~ m/\!/ ); $force_show = 1 if( $modifier =~ m/\!/ );
@ -759,7 +760,7 @@ readingsGroup_2html($;$)
my %extPage = (); my %extPage = ();
my ($allSets, undef, undef) = FW_devState($name, $room, \%extPage); my ($allSets, undef, undef) = FW_devState($name, $room, \%extPage);
my ($set) = split( ' ', $set, 2 ); my ($set) = split( ' ', $set, 2 );
if( $allSets && $allSets =~ m/$set:([^ ]*)/) { if( $allSets && $allSets =~ m/\b$set:([^ ]*)/) {
$values = $1; $values = $1;
} }
} }
@ -1204,7 +1205,9 @@ readingsGroup_Attr($$$;$)
<li>If regex starts with a '+' it will be matched against the internal values of the device instead of the readings.</li> <li>If regex starts with a '+' it will be matched against the internal values of the device instead of the readings.</li>
<li>If regex starts with a '?' it will be matched against the attributes of the device instead of the readings.</li> <li>If regex starts with a '?' it will be matched against the attributes of the device instead of the readings.</li>
<li>If regex starts with a '!' the display of the value will be forced even if no reading with this name is available.</li> <li>If regex starts with a '!' the display of the value will be forced even if no reading with this name is available.</li>
<li>regex can be of the form &lt;regex&gt;@device to use readings from a different device.</li> <li>regex can be of the form &lt;regex&gt;@device to use readings from a different device.<br>
if the device name part starts with a '!' the display will be foreced.
use in conjunction with ! in front of the reading name.</li>
<li>regex can be of the form &lt;regex&gt;@{perl} to use readings from a different device.</li> <li>regex can be of the form &lt;regex&gt;@{perl} to use readings from a different device.</li>
<li>regex can be of the form &lt;STRING&gt; or &lt;{perl}[@readings]&gt; where STRING or the string returned by perl is <li>regex can be of the form &lt;STRING&gt; or &lt;{perl}[@readings]&gt; where STRING or the string returned by perl is
inserted as a reading or: inserted as a reading or: