From 80b7570540533d5f43568cff0eac59ed455e7740 Mon Sep 17 00:00:00 2001 From: Alex Schwantes Date: Fri, 21 Apr 2017 13:32:16 +0200 Subject: [PATCH] Fixing issue #18 where color was not being sent on MQTT state when in JSON mode --- Arilux_AL-LC0X.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Arilux_AL-LC0X.ino b/Arilux_AL-LC0X.ino index d2c7dd6..5d56500 100644 --- a/Arilux_AL-LC0X.ino +++ b/Arilux_AL-LC0X.ino @@ -810,9 +810,10 @@ void handleCMD(void) { root["brightness"] = arilux.getBrightness(); // root["transition"] = root["white_value"] = arilux.getWhite1Value(); - root["color"]["r"] = arilux.getRedValue(); - root["color"]["g"] = arilux.getGreenValue(); - root["color"]["b"] = arilux.getBlueValue(); + JsonObject& color = root.createNestedObject("color"); + color["r"] = arilux.getRedValue(); + color["g"] = arilux.getGreenValue(); + color["b"] = arilux.getBlueValue(); root.printTo(outgoingJsonBuffer); publishToMQTT(ARILUX_MQTT_JSON_STATE_TOPIC, outgoingJsonBuffer); };