mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
33_readingsGroup.pm: allow devspec :FILTER= expressions in device selection
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@7478 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
bc10b25266
commit
073d61ef93
1
CHANGED
1
CHANGED
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: readingsGroup: allow devspec :FILTER= expressions in device selection
|
||||||
- added: 73_km200.pm for the Buderus KM200 heating controller (Sailor)
|
- added: 73_km200.pm for the Buderus KM200 heating controller (Sailor)
|
||||||
- feature: 70_XBMC: added command 'connect' to connect instantly
|
- feature: 70_XBMC: added command 'connect' to connect instantly
|
||||||
- change: FB_CALLMONITOR: use standard file read/write function to support use of configDb
|
- change: FB_CALLMONITOR: use standard file read/write function to support use of configDb
|
||||||
|
@ -96,7 +96,19 @@ readingsGroup_updateDevices($;$)
|
|||||||
} else {
|
} else {
|
||||||
my @device = split(":", $param);
|
my @device = split(":", $param);
|
||||||
|
|
||||||
if($device[0] =~ m/(.*)=(.*)/) {
|
if( $device[1] =~ m/^FILTER=/ ) {
|
||||||
|
my $devspec = shift(@device);
|
||||||
|
while( @device && $device[0] =~ m/^FILTER=/ ) {
|
||||||
|
$devspec .= ":";
|
||||||
|
$devspec .= shift(@device)
|
||||||
|
}
|
||||||
|
my $regex = $device[0];
|
||||||
|
foreach my $d (devspec2array($devspec)) {
|
||||||
|
$list{$d} = 1;
|
||||||
|
push @devices, [$d,$regex];
|
||||||
|
}
|
||||||
|
|
||||||
|
} elsif($device[0] =~ m/(.*)=(.*)/) {
|
||||||
my ($lattr,$re) = ($1, $2);
|
my ($lattr,$re) = ($1, $2);
|
||||||
foreach my $d (sort keys %defs) {
|
foreach my $d (sort keys %defs) {
|
||||||
next if( IsIgnored($d) );
|
next if( IsIgnored($d) );
|
||||||
@ -105,6 +117,7 @@ readingsGroup_updateDevices($;$)
|
|||||||
$list{$d} = 1;
|
$list{$d} = 1;
|
||||||
push @devices, [$d,$device[1]];
|
push @devices, [$d,$device[1]];
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif($device[0] =~ m/(.*)&(.*)/) {
|
} elsif($device[0] =~ m/(.*)&(.*)/) {
|
||||||
my ($lattr,$re) = ($1, $2);
|
my ($lattr,$re) = ($1, $2);
|
||||||
foreach my $d (sort keys %attr) {
|
foreach my $d (sort keys %attr) {
|
||||||
@ -114,11 +127,14 @@ readingsGroup_updateDevices($;$)
|
|||||||
$list{$d} = 1;
|
$list{$d} = 1;
|
||||||
push @devices, [$d,$device[1]];
|
push @devices, [$d,$device[1]];
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif($device[0] =~ m/^<.*>$/) {
|
} elsif($device[0] =~ m/^<.*>$/) {
|
||||||
push @devices, [$device[0]];
|
push @devices, [$device[0]];
|
||||||
|
|
||||||
} elsif( defined($defs{$device[0]}) ) {
|
} elsif( defined($defs{$device[0]}) ) {
|
||||||
$list{$device[0]} = 1;
|
$list{$device[0]} = 1;
|
||||||
push @devices, [@device];
|
push @devices, [@device];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
foreach my $d (sort keys %defs) {
|
foreach my $d (sort keys %defs) {
|
||||||
next if( IsIgnored($d) );
|
next if( IsIgnored($d) );
|
||||||
@ -1217,6 +1233,7 @@ readingsGroup_Attr($$$;$)
|
|||||||
<li><device> can be of the form ATTRIBUTE&VALUE where ATTRIBUTE is the name of an attribute and VALUE is a regex.</li>
|
<li><device> can be of the form ATTRIBUTE&VALUE where ATTRIBUTE is the name of an attribute and VALUE is a regex.</li>
|
||||||
<li><device> can be of the form <STRING> or <{perl}> where STRING or the string returned by perl is
|
<li><device> can be of the form <STRING> or <{perl}> where STRING or the string returned by perl is
|
||||||
inserted as a line in the readings list. skipped if STRING is undef.</li>
|
inserted as a line in the readings list. skipped if STRING is undef.</li>
|
||||||
|
<li><device> can be a devspec (see <a href="#devspec">devspec</a>) with at least one FILTER expression.</li>
|
||||||
<li>If regex is a comma separatet list the reading values will be shown on a single line.</li>
|
<li>If regex is a comma separatet list the reading values will be shown on a single line.</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 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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user