color::devStateIcon: accept on and off in reading for $pct

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@8135 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2015-03-02 19:07:01 +00:00
parent c482ca033a
commit 8618401129

View File

@@ -387,10 +387,13 @@ devStateIcon($$@)
$percent = ::Value($name);
}
$percent =~ s/[^\d]//g if( $percent );
return ".*:light_question" if( !defined($percent) );
return ".*:on:toggle" if( $percent eq "on" );
return ".*:off:toggle" if( $percent eq "off" );
$percent =~ s/[^\d]//g if( $percent );
my $s = $dim_values{int($percent/7)};
$s="off" if( $percent eq "0" );
$s="on" if( $percent eq "100" );