From 21b0ac04df9e6c675d36cdc76b0425f81fd4f3e8 Mon Sep 17 00:00:00 2001 From: copyrights <219009+copyrights@users.noreply.github.com> Date: Tue, 4 Jun 2019 08:24:08 +0200 Subject: [PATCH] MQTT: send mired if cct in use (#1742) --- code/espurna/light.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/espurna/light.ino b/code/espurna/light.ino index 9440ca16..88a4a122 100644 --- a/code/espurna/light.ino +++ b/code/espurna/light.ino @@ -665,10 +665,14 @@ void lightMQTT() { _toHSV(buffer, sizeof(buffer), true); mqttSend(MQTT_TOPIC_COLOR_HSV, buffer); - // Mireds - snprintf_P(buffer, sizeof(buffer), PSTR("%d"), _light_mireds); - mqttSend(MQTT_TOPIC_MIRED, buffer); - + } + + if (_light_has_color || _light_use_cct) { + + // Mireds + snprintf_P(buffer, sizeof(buffer), PSTR("%d"), _light_mireds); + mqttSend(MQTT_TOPIC_MIRED, buffer); + } // Channels