2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 16:05:19 +00:00

FHEM/10_MQTT2_DEVICE.pm: second try (Forum #129932)

git-svn-id: https://svn.fhem.de/fhem/trunk@26609 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2022-10-28 12:19:47 +00:00
parent 4522128649
commit 54adc3bbc3

View File

@ -857,7 +857,7 @@ MQTT2_DEVICE_addPos($@)
sub sub
zigbee2mqtt_RGB2JSON($;$) zigbee2mqtt_RGB2JSON($;$)
{ {
my ($rgb,$trans) = shift(@_); my ($rgb,$trans) = (@_);
$rgb =~ m/^(..)(..)(..)/; $rgb =~ m/^(..)(..)(..)/;
return toJSON({'transition'=>defined($trans) ? $trans : 1, return toJSON({'transition'=>defined($trans) ? $trans : 1,
'color'=>{r=>hex($1),g=>hex($2),b=>hex($3)}}); 'color'=>{r=>hex($1),g=>hex($2),b=>hex($3)}});