mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
InternalVal added
git-svn-id: https://svn.fhem.de/fhem/trunk@3331 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a62f38ddfb
commit
b54e727f6e
@ -1,6 +1,8 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII
|
# Add changes at the top of the list. Keep it in ASCII
|
||||||
- SVN
|
- SVN
|
||||||
- feature: new module speedtest to monitor internet connection speed with speedtest-cli
|
- feature: InternalVal function added (like ReadingsVal)
|
||||||
|
- feature: new module speedtest to monitor internet connection speed with
|
||||||
|
speedtest-cli
|
||||||
- feature: new module "remotecontrol" to display a graphical remotecontrol
|
- feature: new module "remotecontrol" to display a graphical remotecontrol
|
||||||
for any device
|
for any device
|
||||||
- feature: HUEDevice: new attribute color-icons to colored svg icons
|
- feature: HUEDevice: new attribute color-icons to colored svg icons
|
||||||
|
@ -24,7 +24,7 @@ sub FW_htmlEscape($);
|
|||||||
sub FW_logWrapper($);
|
sub FW_logWrapper($);
|
||||||
sub FW_makeEdit($$$);
|
sub FW_makeEdit($$$);
|
||||||
sub FW_makeImage(@);
|
sub FW_makeImage(@);
|
||||||
sub FW_makeTable($$@);
|
sub FW_makeTable($$$@);
|
||||||
sub FW_makeTableFromArray($@);
|
sub FW_makeTableFromArray($@);
|
||||||
sub FW_pF($@);
|
sub FW_pF($@);
|
||||||
sub FW_pH(@);
|
sub FW_pH(@);
|
||||||
@ -664,11 +664,12 @@ FW_updateHashes()
|
|||||||
|
|
||||||
##############################
|
##############################
|
||||||
sub
|
sub
|
||||||
FW_makeTable($$@)
|
FW_makeTable($$$@)
|
||||||
{
|
{
|
||||||
my($name, $hash, $cmd) = (@_);
|
my($title, $name, $hash, $cmd) = (@_);
|
||||||
|
|
||||||
return if(!$hash || !int(keys %{$hash}));
|
return if(!$hash || !int(keys %{$hash}));
|
||||||
|
FW_pO $title;
|
||||||
FW_pO "<table class=\"block wide\">";
|
FW_pO "<table class=\"block wide\">";
|
||||||
my $si = AttrVal("global", "showInternalValues", 0);
|
my $si = AttrVal("global", "showInternalValues", 0);
|
||||||
|
|
||||||
@ -758,7 +759,7 @@ FW_makeSelect($$$$)
|
|||||||
# Initial setting
|
# Initial setting
|
||||||
FW_pO "<script type=\"text/javascript\">" .
|
FW_pO "<script type=\"text/javascript\">" .
|
||||||
"FW_selChange('$selEl','$list','val.$cmd$d')</script>";
|
"FW_selChange('$selEl','$list','val.$cmd$d')</script>";
|
||||||
FW_pO "</form>";
|
FW_pO "</form><br><br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
@ -798,16 +799,15 @@ FW_doDetail($)
|
|||||||
FW_pO FW_hidden("detail", $d);
|
FW_pO FW_hidden("detail", $d);
|
||||||
|
|
||||||
FW_makeSelect($d, "set", getAllSets($d), "set");
|
FW_makeSelect($d, "set", getAllSets($d), "set");
|
||||||
FW_makeTable($d, $h); # Internal values
|
FW_makeTable("Internals", $d, $h);
|
||||||
FW_pO "Readings" if($h->{READINGS});
|
FW_makeTable("Readings", $d, $h->{READINGS});
|
||||||
FW_makeTable($d, $h->{READINGS}); # Readings
|
|
||||||
|
|
||||||
my $attrList = getAllAttr($d);
|
my $attrList = getAllAttr($d);
|
||||||
my $roomList = join(",", sort grep !/ /, keys %FW_rooms);
|
my $roomList = join(",", sort grep !/ /, keys %FW_rooms);
|
||||||
$attrList =~ s/room /room:$roomList /;
|
$attrList =~ s/room /room:$roomList /;
|
||||||
|
|
||||||
FW_makeSelect($d, "attr", $attrList,"attr");
|
FW_makeSelect($d, "attr", $attrList,"attr");
|
||||||
FW_makeTable($d, $attr{$d}, "deleteattr"); # Attributes
|
|
||||||
|
FW_makeTable("Attributes", $d, $attr{$d}, "deleteattr");
|
||||||
|
|
||||||
## dependent objects
|
## dependent objects
|
||||||
my @dob; # dependent objects - triggered by current device
|
my @dob; # dependent objects - triggered by current device
|
||||||
@ -838,7 +838,7 @@ FW_makeTableFromArray($@) {
|
|||||||
my ($txt,@obj) = @_;
|
my ($txt,@obj) = @_;
|
||||||
if (@obj>0) {
|
if (@obj>0) {
|
||||||
my $row=1;
|
my $row=1;
|
||||||
FW_pO "<br><br>";
|
FW_pO "<br>";
|
||||||
FW_pO "$txt";
|
FW_pO "$txt";
|
||||||
FW_pO '<table class="block wide">';
|
FW_pO '<table class="block wide">';
|
||||||
foreach (sort @obj) {
|
foreach (sort @obj) {
|
||||||
|
@ -1288,15 +1288,15 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<li>Value(<devicename>)<br>
|
<li>Value(<devicename>)<br>
|
||||||
returns the state of the device (the string you see in paranthesis in
|
returns the state of the device (the string you see in paranthesis in
|
||||||
the output of the list command).
|
the output of the list command).
|
||||||
<br><br>
|
</li><br>
|
||||||
<li>OldValue(<devicename>)
|
<li>OldValue(<devicename>)
|
||||||
<li>OldTimestamp(<devicename>)<br>
|
<li>OldTimestamp(<devicename>)<br>
|
||||||
returns the old value/timestamp of the device.
|
returns the old value/timestamp of the device.
|
||||||
<br><br>
|
</li><br>
|
||||||
<li>
|
<li>
|
||||||
ReadingsVal(<devicename>,<reading>,<defaultvalue>)<br>
|
ReadingsVal(<devicename>,<reading>,<defaultvalue>)<br>
|
||||||
Return the reading (the value in the Readings section of "list device")
|
Return the reading (the value in the Readings section of "list device")
|
||||||
<br><br>
|
</li><br>
|
||||||
<li>
|
<li>
|
||||||
AttrVal(<devicename>,<attribute>,<defaultvalue>)<br>
|
AttrVal(<devicename>,<attribute>,<defaultvalue>)<br>
|
||||||
Return the attribute of the device
|
Return the attribute of the device
|
||||||
@ -1307,6 +1307,13 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
{ ReadingsVal("wz", "measured-temp", "20")+0 }<br>
|
{ ReadingsVal("wz", "measured-temp", "20")+0 }<br>
|
||||||
{ ReadingsTimestamp("wz", "measured-temp", 0)}<br>
|
{ ReadingsTimestamp("wz", "measured-temp", 0)}<br>
|
||||||
{ AttrVal("wz", "room", "none") }<br>
|
{ AttrVal("wz", "room", "none") }<br>
|
||||||
|
</li><br>
|
||||||
|
<li>
|
||||||
|
InternalVal(<devicename>,<property>,<defaultvalue>)
|
||||||
|
<br>
|
||||||
|
Return the internal value (the value in the Internals section of "list
|
||||||
|
device").
|
||||||
|
</li><br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1356,19 +1356,19 @@ ebenfalls 1 bei Urlaubstagen.<br>
|
|||||||
<br>
|
<br>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Value(<devicename>)<br>
|
<li>Value(<devicename>)<br>
|
||||||
gibt den Status eines Gerätes zurück (entsprechend dem Ausdruck in
|
gibt den Status eines Gerätes zurück (entsprechend dem
|
||||||
Klammern, den Sie beim List-Befehl sehen).
|
Ausdruck in Klammern, den Sie beim List-Befehl sehen).
|
||||||
<br><br>
|
</li><br>
|
||||||
</li><li>OldValue(<devicename>)
|
<li>OldValue(<devicename>)</li>
|
||||||
</li><li>OldTimestamp(<devicename>)<br>
|
<li>OldTimestamp(<devicename>)<br>
|
||||||
gibt den vorherigen Wert/Zeitstempel des Gerätes zurück.
|
gibt den vorherigen Wert/Zeitstempel des Gerätes zurück.
|
||||||
<br><br>
|
</li><br>
|
||||||
</li><li>
|
<li>
|
||||||
ReadingsVal(<devicename>,<reading>,<defaultvalue>)<br>
|
ReadingsVal(<devicename>,<reading>,<defaultvalue>)<br>
|
||||||
Gibt den Inhalt der "readings" zurück (den Inhalt der in dem "Readings"-Abschnitt
|
Gibt den Inhalt der "readings" zurück (den Inhalt der in dem "Readings"-Abschnitt
|
||||||
von "list device" angezeigt wird)
|
von "list device" angezeigt wird)
|
||||||
<br><br>
|
</li><br>
|
||||||
</li><li>
|
<li>
|
||||||
AttrVal(<devicename>,<attribute>,<defaultvalue>)<br>
|
AttrVal(<devicename>,<attribute>,<defaultvalue>)<br>
|
||||||
Gibt die gesetzteb Attribute des Gerätes zurück
|
Gibt die gesetzteb Attribute des Gerätes zurück
|
||||||
<br><br>
|
<br><br>
|
||||||
@ -1378,7 +1378,13 @@ ebenfalls 1 bei Urlaubstagen.<br>
|
|||||||
{ ReadingsVal("wz", "measured-temp", "20")+0 }<br>
|
{ ReadingsVal("wz", "measured-temp", "20")+0 }<br>
|
||||||
{ ReadingsTimestamp("wz", "measured-temp", 0)}<br>
|
{ ReadingsTimestamp("wz", "measured-temp", 0)}<br>
|
||||||
{ AttrVal("wz", "room", "none") }<br>
|
{ AttrVal("wz", "room", "none") }<br>
|
||||||
</li></ul>
|
</li><br>
|
||||||
|
<li>
|
||||||
|
InternalVal(<devicename>,<reading>,<defaultvalue>)<br>
|
||||||
|
Gibt den Inhalt der "internal" zurück (den Inhalt der in
|
||||||
|
dem "Internals"-Abschnitt von "list device" angezeigt wird)
|
||||||
|
</li><br>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
</li><li>
|
</li><li>
|
||||||
|
11
fhem/fhem.pl
11
fhem/fhem.pl
@ -2832,6 +2832,17 @@ setGlobalAttrBeforeFork($)
|
|||||||
###########################################
|
###########################################
|
||||||
# Functions used to make fhem-oneliners more readable,
|
# Functions used to make fhem-oneliners more readable,
|
||||||
# but also recommended to be used by modules
|
# but also recommended to be used by modules
|
||||||
|
sub
|
||||||
|
InternalVal($$$)
|
||||||
|
{
|
||||||
|
my ($d,$n,$default) = @_;
|
||||||
|
if(defined($defs{$d}) &&
|
||||||
|
defined($defs{$d}{$n})) {
|
||||||
|
return $defs{$d}{$n};
|
||||||
|
}
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
ReadingsVal($$$)
|
ReadingsVal($$$)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user