Skip to content

Commit

Permalink
Fix mqtt switch control when json style is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarecrash committed Jul 31, 2024
1 parent 7be20a0 commit d82cbed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
16 changes: 8 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit d82cbed

Please sign in to comment.