From 9ed8fb717d894f032d2dc73ae0d740203f17570d Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Wed, 15 Dec 2021 11:15:30 +0100
Subject: [PATCH] Add webserver function FUNC_WEB_GET_ARG
- Add webserver function FUNC_WEB_GET_ARG allowing better modular support of web arguments
- Add gui function buttons to LSC MCL
---
tasmota/tasmota.h | 2 +-
tasmota/xdrv_01_webserver.ino | 3 ++
tasmota/xdrv_04_light.ino | 8 ++++
tasmota/xlgt_07_lsc_mcsl.ino | 69 +++++++++++++++++++++++++++++++++++
4 files changed, 81 insertions(+), 1 deletion(-)
diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h
index 77cbd00ce..9aa5c1b27 100644
--- a/tasmota/tasmota.h
+++ b/tasmota/tasmota.h
@@ -343,7 +343,7 @@ enum XsnsFunctions {FUNC_SETTINGS_OVERRIDE, FUNC_PIN_STATE, FUNC_MODULE_INIT, FU
FUNC_ENERGY_EVERY_SECOND, FUNC_ENERGY_RESET,
FUNC_RULES_PROCESS, FUNC_TELEPERIOD_RULES_PROCESS, FUNC_SERIAL, FUNC_FREE_MEM, FUNC_BUTTON_PRESSED, FUNC_BUTTON_MULTI_PRESSED,
FUNC_WEB_ADD_BUTTON, FUNC_WEB_ADD_CONSOLE_BUTTON, FUNC_WEB_ADD_MANAGEMENT_BUTTON, FUNC_WEB_ADD_MAIN_BUTTON,
- FUNC_WEB_ADD_HANDLER, FUNC_SET_CHANNELS, FUNC_SET_SCHEME, FUNC_HOTPLUG_SCAN,
+ FUNC_WEB_GET_ARG, FUNC_WEB_ADD_HANDLER, FUNC_SET_CHANNELS, FUNC_SET_SCHEME, FUNC_HOTPLUG_SCAN,
FUNC_DEVICE_GROUP_ITEM };
enum AddressConfigSteps { ADDR_IDLE, ADDR_RECEIVE, ADDR_SEND };
diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino
index ec28f4f23..1f76a66f6 100644
--- a/tasmota/xdrv_01_webserver.ino
+++ b/tasmota/xdrv_01_webserver.ino
@@ -1425,6 +1425,9 @@ bool HandleRootStatusRefresh(void)
}
#endif // USE_ZIGBEE
+ XsnsCall(FUNC_WEB_GET_ARG);
+ XdrvCall(FUNC_WEB_GET_ARG);
+
#ifdef USE_WEB_SSE
WSContentBegin(200, CT_STREAM);
WSContentSend_P(PSTR("data: "));
diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino
index b05386f4a..a5db3d58a 100644
--- a/tasmota/xdrv_04_light.ino
+++ b/tasmota/xdrv_04_light.ino
@@ -3214,6 +3214,14 @@ bool Xdrv04(uint8_t function)
case FUNC_BUTTON_MULTI_PRESSED:
result = XlgtCall(FUNC_BUTTON_MULTI_PRESSED);
break;
+#ifdef USE_WEBSERVER
+ case FUNC_WEB_ADD_MAIN_BUTTON:
+ XlgtCall(FUNC_WEB_ADD_MAIN_BUTTON);
+ break;
+ case FUNC_WEB_GET_ARG:
+ XlgtCall(FUNC_WEB_GET_ARG);
+ break;
+#endif // USE_WEBSERVER
case FUNC_COMMAND:
result = DecodeCommand(kLightCommands, LightCommand, kLightSynonyms);
if (!result) {
diff --git a/tasmota/xlgt_07_lsc_mcsl.ino b/tasmota/xlgt_07_lsc_mcsl.ino
index 9e8ec00e6..4b9abb6c0 100644
--- a/tasmota/xlgt_07_lsc_mcsl.ino
+++ b/tasmota/xlgt_07_lsc_mcsl.ino
@@ -17,6 +17,8 @@
along with this program. If not, see