2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fixed mapping

git-svn-id: https://svn.fhem.de/fhem/trunk@3867 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2013-09-07 08:04:20 +00:00
parent 51d92e4636
commit 61fa4ace9e

View File

@ -131,8 +131,8 @@ sub lookup($$$$$)
$default =~ s/\%READING/$reading/g;
$default =~ s/\$ALIAS/$alias/g;
$default =~ s/\$READING/$name/g;
$default =~ s/\$DEVICE/$reading/g;
$default =~ s/\$DEVICE/$name/g;
$default =~ s/\$READING/$reading/g;
}
return $default;
@ -242,9 +242,11 @@ readingsGroup_2html($)
my $m = "$a$separator$n";
my $txt = lookup($mapping,$name,$a,$n,$m);
if( my $icon = lookup($nameIcons,$name,$a,$n,$m) ) {
if( $nameIcons ) {
if( my $icon = lookup($nameIcons,$name,$a,$n,"") ) {
$txt = FW_makeImage( $icon, $txt, "icon" );
}
}
$ret .= sprintf("<tr class=\"%s\">", ($row&1)?"odd":"even");
$row++;
@ -305,9 +307,11 @@ readingsGroup_2html($)
my $m = "$a$separator$n";
my $txt = lookup($mapping,$name,$a,$n,$m);
if( my $icon = lookup($nameIcons,$name,$a,$n,$m) ) {
if( $nameIcons ) {
if( my $icon = lookup($nameIcons,$name,$a,$n,"") ) {
$txt = FW_makeImage( $icon, $txt, "icon" );
}
}
$ret .= sprintf("<tr class=\"%s\">", ($row&1)?"odd":"even");
$row++;
@ -558,6 +562,10 @@ readingsGroup_Get($@)
<code>attr temperatures valueFormat %.1f &deg;C</code></br>
<code>attr temperatures valueFormat { temperature => "%.1f &deg;C", humidity => "%.1f %" }</code></br>
<code>attr temperatures valueFormat { ($READING eq 'temperature')?"%.1f &deg;C":undef }</code></li>
<li>nameIcon<br>
Specify an icon to be used instead of the reading name. Can be a simple string or a perl expression enclosed
in {} that returns a hash that maps reading names to the icon name. e.g.:<br>
<code>attr devices nameIcon $DEVICE</code></li>
</ul><br>
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.:<br>