From a97aeeedb73c6ff60fc9351bf39054f14e7014af Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Sun, 10 Nov 2024 12:46:56 +0100
Subject: [PATCH] Add Tuya support
---
tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino | 3 +--
tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
index 9e8e4d462..519a5fa0e 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
@@ -1623,10 +1623,9 @@ void TuyaSensorsShow(bool json)
void TuyaAddButton(void) {
if (AsModuleTuyaMS()) {
WSContentSend_P(HTTP_TABLE100);
- WSContentSend_P(PSTR("
"));
char stemp[33];
snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE ""));
- WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1,
+ WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1, TasmotaGlobal.devices_present + 1,
(strlen(GetWebButton(TasmotaGlobal.devices_present))) ? HtmlEscape(GetWebButton(TasmotaGlobal.devices_present)).c_str() : stemp, "");
WSContentSend_P(PSTR("
"));
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
index 9d4364552..58eec8637 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
@@ -2416,10 +2416,9 @@ void TuyaSensorsShow(bool json)
void TuyaAddButton(void) {
if (AsModuleTuyaMS()) {
WSContentSend_P(HTTP_TABLE100);
- WSContentSend_P(PSTR(""));
char stemp[33];
snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE ""));
- WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1,
+ WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1, TasmotaGlobal.devices_present + 1,
(strlen(GetWebButton(TasmotaGlobal.devices_present))) ? HtmlEscape(GetWebButton(TasmotaGlobal.devices_present)).c_str() : stemp, "");
WSContentSend_P(PSTR("
"));
}