From 74d99c669a863cfeacd80e8e570980889ea6081a Mon Sep 17 00:00:00 2001 From: Yves De Muyter Date: Wed, 10 Feb 2021 11:15:23 +0100 Subject: [PATCH] Bring ModeSet value out of the for loop, this ModeSet is repeated for every other value on the webpage. --- tasmota/xdrv_16_tuyamcu.ino | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index 98e3370e8..5f94e576d 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -1336,13 +1336,16 @@ void TuyaSensorsShow(bool json) break; } } - if (AsModuleTuyaMS()) { - WSContentSend_P(PSTR("{s}" D_JSON_IRHVAC_MODE "{m}%d{e}"), Tuya.ModeSet); - } #endif // USE_WEBSERVER } } + #ifdef USE_WEBSERVER + if (AsModuleTuyaMS()) { + WSContentSend_P(PSTR("{s}" D_JSON_IRHVAC_MODE "{m}%d{e}"), Tuya.ModeSet); + } + #endif // USE_WEBSERVER + if (RootName) { ResponseJsonEnd();} }