mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
fhem.pl: fix list bug and doc (Forum #104279)
git-svn-id: https://svn.fhem.de/fhem/trunk@20318 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c66ac5a10d
commit
f613e6ed79
@ -941,7 +941,7 @@ The following local attributes are used by a wider range of devices:
|
|||||||
<a name="list"></a>
|
<a name="list"></a>
|
||||||
<h3>list</h3>
|
<h3>list</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<code>list [devspec] [value]</code><br>
|
<code>list [devspec] [value ...]</code><br>
|
||||||
or<br>
|
or<br>
|
||||||
<code>list {-r|-R} devspec</code><br>
|
<code>list {-r|-R} devspec</code><br>
|
||||||
<br><br>
|
<br><br>
|
||||||
@ -951,13 +951,15 @@ The following local attributes are used by a wider range of devices:
|
|||||||
See the <a href="#devspec">Device specification</a> section for details on
|
See the <a href="#devspec">Device specification</a> section for details on
|
||||||
<devspec>.
|
<devspec>.
|
||||||
<br>
|
<br>
|
||||||
If value is specified, then output this property (like DEF, TYPE, etc) or
|
If <value> is specified, then output this property (internal, reading
|
||||||
reading (actuator, measured-temp) for all devices from the devspec.
|
or attribute) for all devices from the devspec. <value> can be
|
||||||
|
restricted with prefix i: for internals, r: for readings and a: for
|
||||||
|
attributes.
|
||||||
<br><br>
|
<br><br>
|
||||||
Example:
|
Example:
|
||||||
<pre><code> fhem> list
|
<pre><code> fhem> list
|
||||||
|
|
||||||
Type list <name> for detailed info.
|
Type list <name> for detailed info.
|
||||||
|
|
||||||
Internal:
|
Internal:
|
||||||
global (Internal)
|
global (Internal)
|
||||||
@ -988,7 +990,7 @@ The following local attributes are used by a wider range of devices:
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
If specifying <code>name</code>, then a detailed status for <code>name</code>
|
If specifying <code>name</code>, then a detailed status for <code>name</code>
|
||||||
will be displayed, e.g.:
|
will be displayed, e.g.:
|
||||||
<pre><code> fhem> list fl
|
<pre><code> fhem> list fl
|
||||||
|
|
||||||
Internals:
|
Internals:
|
||||||
CODE 5102
|
CODE 5102
|
||||||
|
@ -996,7 +996,7 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
|
|||||||
<a name="list"></a>
|
<a name="list"></a>
|
||||||
<h3>list</h3>
|
<h3>list</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<code>list [devspec] [value]</code><br>
|
<code>list [devspec] [value ...]</code><br>
|
||||||
oder<br>
|
oder<br>
|
||||||
<code>list {-r|-R} devspec</code><br>
|
<code>list {-r|-R} devspec</code><br>
|
||||||
<br><br>
|
<br><br>
|
||||||
@ -1004,11 +1004,14 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
|
|||||||
"at"-Definitionen. Dies ist eines der wenigen Befehle, die im
|
"at"-Definitionen. Dies ist eines der wenigen Befehle, die im
|
||||||
Normalfall eine Zeichenkette ausgeben.<br> Siehe den Abschnitt über <a
|
Normalfall eine Zeichenkette ausgeben.<br> Siehe den Abschnitt über <a
|
||||||
href="#devspec">Geräte-Spezifikation</a> für Details der
|
href="#devspec">Geräte-Spezifikation</a> für Details der
|
||||||
<devspec>.<br>
|
<devspec>.<br><br>
|
||||||
|
|
||||||
<br> Wenn value angegeben ist, der von ( DEF, TYPE, usw) oder reading
|
Wenn <value> angegeben ist, dann wird dieses Wert (Internal, Reading
|
||||||
(actuator, measured-temp) für alle Geräte die in devspec angegeben
|
oder Attribut) ausgegeben, soweit es vorhanden ist. Die Werte können mit
|
||||||
sind. <br><br> Beispiel:
|
einem Präfix eingeschränkt werden: i: für Internals, r:
|
||||||
|
für Readings und a: für Attribute.
|
||||||
|
|
||||||
|
<br><br> Beispiel:
|
||||||
<pre><code>fhem> list
|
<pre><code>fhem> list
|
||||||
|
|
||||||
Type list <name> for detailed info.
|
Type list <name> for detailed info.
|
||||||
|
10
fhem/fhem.pl
10
fhem/fhem.pl
@ -2508,6 +2508,7 @@ CommandList($$)
|
|||||||
my @list = devspec2array($arg[0],$cl);
|
my @list = devspec2array($arg[0],$cl);
|
||||||
if($arg[1]) {
|
if($arg[1]) {
|
||||||
foreach my $sdev (@list) { # Show a Hash-Entry or Reading for each device
|
foreach my $sdev (@list) { # Show a Hash-Entry or Reading for each device
|
||||||
|
next if(!$defs{$sdev});
|
||||||
|
|
||||||
my $first = 1;
|
my $first = 1;
|
||||||
foreach my $n (@arg[1..@arg-1]) {
|
foreach my $n (@arg[1..@arg-1]) {
|
||||||
@ -2518,20 +2519,19 @@ CommandList($$)
|
|||||||
$n = $2;
|
$n = $2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($defs{$sdev}) {
|
|
||||||
if(defined($defs{$sdev}{$n}) && (!$fType || $fType eq "i:")) {
|
if(defined($defs{$sdev}{$n}) && (!$fType || $fType eq "i:")) {
|
||||||
my $val = $defs{$sdev}{$n};
|
my $val = $defs{$sdev}{$n};
|
||||||
if(ref($val) eq 'HASH') {
|
if(ref($val) eq 'HASH') {
|
||||||
$val = ($val->{NAME} ? $val->{NAME} : # ???
|
$val = ($val->{NAME} ? $val->{NAME} : # ???
|
||||||
join(" ", map { "$_=$val->{$_}" } sort keys %{$val}));
|
join(" ", map { "$_=$val->{$_}" } sort keys %{$val}));
|
||||||
}
|
}
|
||||||
$str .= sprintf("%-20s %*s %*s %s\n", $first?$sdev:'',
|
$str .= sprintf("%-20s %*s %*s %s\n", ($first++==1)?$sdev:'',
|
||||||
$arg[2]?19:0, '', $arg[2]?-15:0, $arg[2]?$n:'', $val);
|
$arg[2]?19:0, '', $arg[2]?-15:0, $arg[2]?$n:'', $val);
|
||||||
|
|
||||||
} elsif($defs{$sdev}{READINGS} &&
|
} elsif($defs{$sdev}{READINGS} &&
|
||||||
defined($defs{$sdev}{READINGS}{$n})
|
defined($defs{$sdev}{READINGS}{$n})
|
||||||
&& (!$fType || $fType eq "r:")) {
|
&& (!$fType || $fType eq "r:")) {
|
||||||
$str .= sprintf("%-20s %s %*s %s\n", $first?$sdev:'',
|
$str .= sprintf("%-20s %s %*s %s\n", ($first++==1)?$sdev:'',
|
||||||
$defs{$sdev}{READINGS}{$n}{TIME},
|
$defs{$sdev}{READINGS}{$n}{TIME},
|
||||||
$arg[2]?-15:0, $arg[2]?$n:'',
|
$arg[2]?-15:0, $arg[2]?$n:'',
|
||||||
$defs{$sdev}{READINGS}{$n}{VAL});
|
$defs{$sdev}{READINGS}{$n}{VAL});
|
||||||
@ -2539,14 +2539,12 @@ CommandList($$)
|
|||||||
} elsif($attr{$sdev} &&
|
} elsif($attr{$sdev} &&
|
||||||
defined($attr{$sdev}{$n})
|
defined($attr{$sdev}{$n})
|
||||||
&& (!$fType || $fType eq "a:")) {
|
&& (!$fType || $fType eq "a:")) {
|
||||||
$str .= sprintf("%-20s %*s %*s %s\n", $first?$sdev:'',
|
$str .= sprintf("%-20s %*s %*s %s\n",($first++==1)?$sdev:'',
|
||||||
$arg[2]?19:0, '', $arg[2]?-15:0, $arg[2]?$n:'',
|
$arg[2]?19:0, '', $arg[2]?-15:0, $arg[2]?$n:'',
|
||||||
$attr{$sdev}{$n});
|
$attr{$sdev}{$n});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$first = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif(@list == 1) { # Details
|
} elsif(@list == 1) { # Details
|
||||||
|
Loading…
Reference in New Issue
Block a user