diff --git a/src/cmnds/cmd_newLEDDriver.c b/src/cmnds/cmd_newLEDDriver.c index 9b0122b16..a383a1ce6 100644 --- a/src/cmnds/cmd_newLEDDriver.c +++ b/src/cmnds/cmd_newLEDDriver.c @@ -662,7 +662,9 @@ void apply_smart_light() { // I am not sure if it's the best place to do it // NOTE: this will broadcast MQTT only if a flag is set +#if ENABLE_MQTT sendFullRGBCW_IfEnabled(); +#endif } void led_gamma_list (void) { // list RGB gamma settings @@ -1352,7 +1354,9 @@ commandResult_t LED_SetBaseColor(const void *context, const char *cmd, const cha if (CFG_HasFlag(OBK_FLAG_LED_SETTING_WHITE_RGB_ENABLES_CW)) { if (!stricmp(c, "FFFFFF")) { SET_LightMode(Light_Temperature); +#if ENABLE_MQTT sendTemperatureChange(); +#endif apply_smart_light(); return CMD_RES_OK; } diff --git a/src/driver/drv_battery.c b/src/driver/drv_battery.c index 84002608d..e9579afc5 100644 --- a/src/driver/drv_battery.c +++ b/src/driver/drv_battery.c @@ -74,8 +74,10 @@ static void Batt_Measure() { if (g_battlevel > 100) g_battlevel = 100; +#if ENABLE_MQTT MQTT_PublishMain_StringInt("voltage", (int)g_battvoltage, 0); MQTT_PublishMain_StringInt("battery", (int)g_battlevel, 0); +#endif g_lastbattlevel = (int)g_battlevel; g_lastbattvoltage = (int)g_battvoltage; ADDLOG_INFO(LOG_FEATURE_DRV, "DRV_BATTERY : battery voltage : %f and percentage %f%%", g_battvoltage, g_battlevel); diff --git a/src/driver/drv_doorSensorWithDeepSleep.c b/src/driver/drv_doorSensorWithDeepSleep.c index 084769873..2afa42b76 100644 --- a/src/driver/drv_doorSensorWithDeepSleep.c +++ b/src/driver/drv_doorSensorWithDeepSleep.c @@ -121,7 +121,9 @@ void DoorDeepSleep_OnEverySecond() { } else if (Main_HasMQTTConnected() && Main_HasWiFiConnected()) { // executes every second when connection is established DoorDeepSleep_QueueNewEvents(); +#if ENABLE_MQTT PublishQueuedItems(); // publish those items that were queued when device was offline +#endif g_noChangeTimePassed++; if (g_noChangeTimePassed >= setting_timeRequiredUntilDeepSleep) {