From 9b758350b580542f556e1815c56f7f679eb2f759 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 23 Feb 2020 20:49:54 +0100 Subject: [PATCH] Fix Domoticz compile error Fix compile error when Domoticz is enabled but Lights is disabled --- tasmota/xdrv_07_domoticz.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_07_domoticz.ino b/tasmota/xdrv_07_domoticz.ino index 49e546b65..90563eeed 100644 --- a/tasmota/xdrv_07_domoticz.ino +++ b/tasmota/xdrv_07_domoticz.ino @@ -296,6 +296,7 @@ bool DomoticzMqttData(void) found = true; } else #endif // USE_SHUTTER +#ifdef USE_LIGHT if (iscolordimmer && 10 == nvalue) { // Color_SetColor // https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s#Set_a_light_to_a_certain_color_or_color_temperature JsonObject& color = domoticz["Color"]; @@ -333,8 +334,9 @@ bool DomoticzMqttData(void) snprintf_P(XdrvMailbox.topic, XdrvMailbox.index, PSTR("/" D_CMND_DIMMER)); snprintf_P(XdrvMailbox.data, XdrvMailbox.data_len, PSTR("%d"), nvalue); found = true; - } - else if (1 == nvalue || 0 == nvalue) { + } else +#endif // USE_LIGHT + if (1 == nvalue || 0 == nvalue) { if (((power >> i) &1) == (power_t)nvalue) { return true; // Stop loop }