From 961d23e2a1caecb936030a387e426a245365c790 Mon Sep 17 00:00:00 2001 From: Yeon Vinzenz Varapragasam Date: Mon, 15 Apr 2019 20:43:32 +0200 Subject: [PATCH] Fixed MQTT color response Leading zeros are not trimmed on /c topic anymore :) Before blue: #FF After blue: #0000FF --- wled00/wled17_mqtt.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/wled17_mqtt.ino b/wled00/wled17_mqtt.ino index 92b203ac..09ffd5fe 100644 --- a/wled00/wled17_mqtt.ino +++ b/wled00/wled17_mqtt.ino @@ -85,7 +85,7 @@ void publishMqtt() strcat(subuf, "/g"); mqtt->publish(subuf, 0, true, s); - sprintf(s, "#%X", col[3]*16777216 + col[0]*65536 + col[1]*256 + col[2]); + sprintf(s, "#%06X", col[3]*16777216 + col[0]*65536 + col[1]*256 + col[2]); strcpy(subuf, mqttDeviceTopic); strcat(subuf, "/c"); mqtt->publish(subuf, 0, true, s);