From 6fa90f784fa1dfbd089fbe6285cd73d8d78a3265 Mon Sep 17 00:00:00 2001 From: justme1968 Date: Wed, 28 May 2014 12:50:21 +0000 Subject: [PATCH] allow {...} perl expression for style attribute git-svn-id: https://svn.fhem.de/fhem/trunk@5992 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/33_readingsGroup.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/33_readingsGroup.pm b/fhem/FHEM/33_readingsGroup.pm index ddac241a6..5cd2af941 100644 --- a/fhem/FHEM/33_readingsGroup.pm +++ b/fhem/FHEM/33_readingsGroup.pm @@ -314,6 +314,11 @@ readingsGroup_2html($) my $separator = AttrVal( $d, "separator", ":" ); my $style = AttrVal( $d, "style", "" ); + if( $style =~ m/^{.*}$/ ) { + my $s = eval $style; + $style = $s if( $s ); + } + my $name_style = AttrVal( $d, "nameStyle", "" ); my $value_style = AttrVal( $d, "valueStyle", "" ); my $timestamp_style = AttrVal( $d, "timestampStyle", "" ); @@ -1077,8 +1082,8 @@ readingsGroup_Attr($$$)
- The nameStyle and valueStyle attributes can also contain a perl expression enclosed in {} that returns the style - string to use. The perl code can use $DEVICE,$READING and $VALUE, e.g.:
+ The style, nameStyle and valueStyle attributes can also contain a perl expression enclosed in {} that returns the style + string to use. For nameStyle and valueStyle The perl code can use $DEVICE,$READING and $VALUE, e.g.: