mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-27 20:34:52 +00:00
10_MQTT2_DEVICE.pm: fix zigbee2mqtt_RGB2JSON (Forum #91394)
git-svn-id: https://svn.fhem.de/fhem/trunk@17947 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a91c2ab869
commit
2fd09ceafb
@ -427,10 +427,7 @@ zigbee2mqtt_RGB2JSON($)
|
||||
{
|
||||
my $rgb = shift(@_);
|
||||
$rgb =~ m/^(..)(..)(..)/;
|
||||
my( $r, $g, $b ) = (hex($1)/255.0, hex($2)/255.0, hex($3)/255.0);
|
||||
my %color_hash = (r => $r, g => $g, b => $b);
|
||||
my %set_hash = ('transition' => 1, 'color' => \%color_hash);
|
||||
return toJSON(\%set_hash);
|
||||
return toJSON({'transition'=>1, 'color'=>{r=>hex($1),g=>hex($2),b=>hex($3)}});
|
||||
}
|
||||
|
||||
sub
|
||||
|
Loading…
x
Reference in New Issue
Block a user