From d1d62515b6ff5fe8e82f1595359a48dfec6ae091 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Thu, 2 Apr 2020 02:40:26 +0300 Subject: [PATCH] Legacy input rcmd bug fixed --- build-flags/build_flags_lighthub21 | 2 ++ lighthub/inputs.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build-flags/build_flags_lighthub21 b/build-flags/build_flags_lighthub21 index 34e4ee1..f644898 100644 --- a/build-flags/build_flags_lighthub21 +++ b/build-flags/build_flags_lighthub21 @@ -2,3 +2,5 @@ -DW5500_CS_PIN=53 -DARTNET_ENABLE -DDMX_SMOOTH +-DMODBUS_DIMMER_PARAM=SERIAL_8N1 +-DMODBUS_SERIAL_BAUD=9600 diff --git a/lighthub/inputs.cpp b/lighthub/inputs.cpp index a16dc9f..829d7ac 100644 --- a/lighthub/inputs.cpp +++ b/lighthub/inputs.cpp @@ -934,7 +934,7 @@ if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestri else if (strlen(scmd->valuestring)) it.Ctrl(scmd->valuestring, true); } else { //send reset command - if (!rcmd || rcmd->type == aJson_String) it.Ctrl(CMD_OFF, 0, NULL, true); + if (!rcmd || rcmd->type != aJson_String) it.Ctrl(CMD_OFF, 0, NULL, true); else if (strlen(rcmd->valuestring)) it.Ctrl(rcmd->valuestring, true); }