From b93d6c5fc0abe2e3643042d566f9977c3ed542af Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Wed, 12 Feb 2014 15:09:51 +0000 Subject: [PATCH] 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 --- fhem/FHEM/33_readingsGroup.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/33_readingsGroup.pm b/fhem/FHEM/33_readingsGroup.pm index 0fdfeefc8..5ee3816ff 100644 --- a/fhem/FHEM/33_readingsGroup.pm +++ b/fhem/FHEM/33_readingsGroup.pm @@ -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($$$)
  • notime
    If set to 1 the reading timestamp is not displayed.
  • mapping
    - 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 <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 - also prefix these keywords with $ instead of %. Examples:
    + 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 <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 also prefix these keywords with $ instead of %. Examples:
    attr temperatures mapping $DEVICE-$READING
    attr temperatures mapping {temperature => "%DEVICE Temperatur"}