mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-23 20:52:13 +00:00
allow hash lookup to return {perlcode} for nameStyle, valueStyle, valueFormat, and commands
git-svn-id: https://svn.fhem.de/fhem/trunk@4894 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2aef2f9c27
commit
b93d6c5fc0
@ -210,7 +210,9 @@ lookup2($$$$)
|
|||||||
$vf = $lookup->{$name.".".$reading} if( exists($lookup->{$name.".".$reading}) );
|
$vf = $lookup->{$name.".".$reading} if( exists($lookup->{$name.".".$reading}) );
|
||||||
$vf = $lookup->{$reading.".".$value} if( defined($value) && exists($lookup->{$reading.".".$value}) );
|
$vf = $lookup->{$reading.".".$value} if( defined($value) && exists($lookup->{$reading.".".$value}) );
|
||||||
$lookup = $vf;
|
$lookup = $vf;
|
||||||
} elsif($lookup =~ m/^{.*}$/) {
|
}
|
||||||
|
|
||||||
|
if( !ref($lookup) && $lookup =~ m/^{.*}$/) {
|
||||||
my $DEVICE = $name;
|
my $DEVICE = $name;
|
||||||
my $READING = $reading;
|
my $READING = $reading;
|
||||||
my $VALUE = $value;
|
my $VALUE = $value;
|
||||||
@ -928,10 +930,10 @@ readingsGroup_Attr($$$)
|
|||||||
<li>notime<br>
|
<li>notime<br>
|
||||||
If set to 1 the reading timestamp is not displayed.</li>
|
If set to 1 the reading timestamp is not displayed.</li>
|
||||||
<li>mapping<br>
|
<li>mapping<br>
|
||||||
Can be a simple string or a perl expression enclosed in {} that returns a hash that maps reading names to the displayed name.
|
Can be a simple string or a perl expression enclosed in {} that returns a hash that maps reading names
|
||||||
The keys can be either the name of the reading or <device>.<reading>.
|
to the displayed name. The keys can be either the name of the reading or <device>.<reading>.
|
||||||
%DEVICE, %ALIAS, %ROOM, %GROUP and %READING are replaced by the device name, device alias, room attribute, group attribute and reading name respectively. You can
|
%DEVICE, %ALIAS, %ROOM, %GROUP and %READING are replaced by the device name, device alias, room attribute,
|
||||||
also prefix these keywords with $ instead of %. Examples:<br>
|
group attribute and reading name respectively. You can also prefix these keywords with $ instead of %. Examples:<br>
|
||||||
<code>attr temperatures mapping $DEVICE-$READING</code><br>
|
<code>attr temperatures mapping $DEVICE-$READING</code><br>
|
||||||
<code>attr temperatures mapping {temperature => "%DEVICE Temperatur"}</code>
|
<code>attr temperatures mapping {temperature => "%DEVICE Temperatur"}</code>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user