mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-01 07:19:24 +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:
parent
09aaddb07c
commit
ea2f928591
@ -625,7 +625,7 @@ zigbee2mqtt_devStateIcon255($)
|
|||||||
{
|
{
|
||||||
my ($name) = @_;
|
my ($name) = @_;
|
||||||
return ".*:off:toggle" if(lc(ReadingsVal($name,"state","ON")) eq "off" );
|
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));
|
my $s = $pct > 253 ? "on" : sprintf("dim%02d%%",int((1+int($pct/18))*6.25));
|
||||||
return ".*:$s:off";
|
return ".*:$s:off";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user