allow device selection by TYPE=xxx (and all other internal values)

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3852 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2013-09-03 20:53:25 +00:00
parent 214ed68660
commit 3e541afd88
3 changed files with 18 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
- SVN
- feature: readingsGroup: allow device selecton by TYPE=xxx
- feature: new module Revolt for Revolt NC-5462 power metering devices.
(by mehf)
- feature: HUEDevice: added alert command

View File

@@ -60,7 +60,17 @@ readingsGroup_updateDevices($)
} else {
my @device = split(":", $param);
if( defined($defs{$device[0]}) ) {
if($device[0] =~ m/(.*)=(.*)/) {
my ($lattr,$re) = ($1, $2);
foreach my $d (sort keys %defs) {
next if( IsIgnored($d) );
next if( !defined($defs{$d}{$lattr}) );
next if( $defs{$d}{$lattr} !~ m/^$re$/);
$list{$d} = 1;
push @devices, [$d,$device[1]];
}
}
elsif( defined($defs{$device[0]}) ) {
$list{$device[0]} = 1;
push @devices, [@device];
} else {
@@ -454,7 +464,8 @@ readingsGroup_Get($@)
Notes:
<ul>
<li>If regex starts with a + it will be matched against the internal values of the device instead of the readinsg.</li>
<li>&lt;device&gt; can be of the form INTERNAL=VALUE where INTERNAL is an internal value and VALUE is a regex.</li>
<li>If regex starts with a + it will be matched against the internal values of the device instead of the readings.</li>
<li>For internal values no longpoll update is possible. Refresh the page to update the values.</li>
</ul><br>
@@ -464,6 +475,9 @@ readingsGroup_Get($@)
define batteries readingsGroup .*:battery</code><br>
<br>
<code>define temperatures readingsGroup s300th.*:temperature</code><br>
<code>define temperatures readingsGroup TYPE=CUL_WS.*:temperature</code><br>
<br>
<code>define culRSSI readingsGroup cul_RSSI=.*:+cul_RSSI</code><br>
<br>
<code>define heizung readingsGroup t1:temperature t2:temperature t3:temperature<br>
attr heizung notime 1<br>

View File

@@ -85,7 +85,7 @@ FHEM/30_HUEBridge.pm justme1968 http://forum.fhem.de Sonstige
FHEM/31_HUEDevice.pm justme1968 http://forum.fhem.de Sonstige Systeme
FHEM/31_LightScene.pm justme1968 http://forum.fhem.de Automatisierung
FHEM/32_SYSSTAT.pm justme1968 http://forum.fhem.de Unterst<73>tzende Dienste
FHEM/33_readingsGroup.pm justme1968 http://forum.fhem.de Automatisierung
FHEM/33_readingsGroup.pm justme1968 http://forum.fhem.de Frontends
FHEM/32_speedtest.pm justme1968 http://forum.fhem.de Sonstiges
FHEM/34_panStamp.pm justme1968 http://forum.fhem.de Sonstiges Systeme
FHEM/34_SWAP.pm justme1968 http://forum.fhem.de Sonstiges Systeme