From d82cbed8470b72539d287dc4d6347a94b96ea7e7 Mon Sep 17 00:00:00 2001 From: SoftWareCrash Date: Thu, 1 Aug 2024 00:02:43 +0200 Subject: [PATCH] Fix mqtt switch control when json style is activated --- platformio.ini | 2 +- src/main.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/platformio.ini b/platformio.ini index 1fc11fb..2d32ca2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -18,7 +18,7 @@ monitor_filters = esp8266_exception_decoder, default, time, printable, colorize board_build.ldscript = eagle.flash.4m.ld ; 4MB (FS:4MB OTA:~3600KB) upload_speed = 921600 -custom_prog_version = 1.2.1 +custom_prog_version = 1.2.2B1 build_flags = -DVERSION=${this.custom_prog_version} diff --git a/src/main.cpp b/src/main.cpp index 2991a4c..dd04ce3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -655,19 +655,19 @@ void mqttCallback(char *top, byte *payload, unsigned int length) // Need rework { String messageTemp; // updateProgress = true; // stop servicing data - if (!_settings.data.mqttJson) - { +// if (!_settings.data.mqttJson) + // { for (unsigned int i = 0; i < length; i++) { messageTemp += (char)payload[i]; } - } - else - { - StaticJsonDocument<1024> mqttJsonAnswer; - deserializeJson(mqttJsonAnswer, (const byte *)payload, length); - } + // } + // else + // { + // StaticJsonDocument<1024> mqttJsonAnswer; + // deserializeJson(mqttJsonAnswer, (const byte *)payload, length); + // } if (strlen(_settings.data.mqttTriggerPath) > 0 && strcmp(top, _settings.data.mqttTriggerPath) == 0) {