2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-23 14:46:24 +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:
justme-1968 2014-02-12 15:09:51 +00:00
parent 2aef2f9c27
commit b93d6c5fc0

View File

@ -210,7 +210,9 @@ lookup2($$$$)
$vf = $lookup->{$name.".".$reading} if( exists($lookup->{$name.".".$reading}) );
$vf = $lookup->{$reading.".".$value} if( defined($value) && exists($lookup->{$reading.".".$value}) );
$lookup = $vf;
} elsif($lookup =~ m/^{.*}$/) {
}
if( !ref($lookup) && $lookup =~ m/^{.*}$/) {
my $DEVICE = $name;
my $READING = $reading;
my $VALUE = $value;
@ -928,10 +930,10 @@ readingsGroup_Attr($$$)
<li>notime<br>
If set to 1 the reading timestamp is not displayed.</li>
<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.
The keys can be either the name of the reading or &lt;device&gt;.&lt;reading&gt;.
%DEVICE, %ALIAS, %ROOM, %GROUP and %READING are replaced by the device name, device alias, room attribute, group attribute and reading name respectively. You can
also prefix these keywords with $ instead of %. Examples:<br>
Can be a simple string or a perl expression enclosed in {} that returns a hash that maps reading names
to the displayed name. The keys can be either the name of the reading or &lt;device&gt;.&lt;reading&gt;.
%DEVICE, %ALIAS, %ROOM, %GROUP and %READING are replaced by the device name, device alias, room attribute,
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 {temperature => "%DEVICE Temperatur"}</code>
</li>