Add Tuya support

This commit is contained in:
Theo Arends 2024-11-10 12:46:56 +01:00
parent 7e3f093dc9
commit a97aeeedb7
2 changed files with 2 additions and 4 deletions

View File

@ -1623,10 +1623,9 @@ void TuyaSensorsShow(bool json)
void TuyaAddButton(void) { void TuyaAddButton(void) {
if (AsModuleTuyaMS()) { if (AsModuleTuyaMS()) {
WSContentSend_P(HTTP_TABLE100); WSContentSend_P(HTTP_TABLE100);
WSContentSend_P(PSTR("<tr><div></div>"));
char stemp[33]; char stemp[33];
snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE "")); 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, ""); (strlen(GetWebButton(TasmotaGlobal.devices_present))) ? HtmlEscape(GetWebButton(TasmotaGlobal.devices_present)).c_str() : stemp, "");
WSContentSend_P(PSTR("</tr></table>")); WSContentSend_P(PSTR("</tr></table>"));
} }

View File

@ -2416,10 +2416,9 @@ void TuyaSensorsShow(bool json)
void TuyaAddButton(void) { void TuyaAddButton(void) {
if (AsModuleTuyaMS()) { if (AsModuleTuyaMS()) {
WSContentSend_P(HTTP_TABLE100); WSContentSend_P(HTTP_TABLE100);
WSContentSend_P(PSTR("<tr><div></div>"));
char stemp[33]; char stemp[33];
snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE "")); 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, ""); (strlen(GetWebButton(TasmotaGlobal.devices_present))) ? HtmlEscape(GetWebButton(TasmotaGlobal.devices_present)).c_str() : stemp, "");
WSContentSend_P(PSTR("</tr></table>")); WSContentSend_P(PSTR("</tr></table>"));
} }