2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

10_MQTT2_DEVICE.pm:use ReadingsNum in zigbee2mqtt_devStateIcon255 (Forum #96262)

git-svn-id: https://svn.fhem.de/fhem/trunk@18363 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-01-21 20:57:58 +00:00
parent 09aaddb07c
commit ea2f928591

View File

@ -625,7 +625,7 @@ zigbee2mqtt_devStateIcon255($)
{
my ($name) = @_;
return ".*:off:toggle" if(lc(ReadingsVal($name,"state","ON")) eq "off" );
my $pct = ReadingsVal($name,"brightness","255");
my $pct = ReadingsNum($name,"brightness","255");
my $s = $pct > 253 ? "on" : sprintf("dim%02d%%",int((1+int($pct/18))*6.25));
return ".*:$s:off";
}