diff --git a/TC1/http_server/web/index.html b/TC1/http_server/web/index.html
index 8d2ca98..e68187a 100644
--- a/TC1/http_server/web/index.html
+++ b/TC1/http_server/web/index.html
@@ -809,9 +809,12 @@
}, sockets_st);
HttpPost("/led", function (re) {
}, checkboxs[0].checked ? "1" : "0");
- HttpPost("/socketAll", function (re) {
- }, checkboxs[1].checked ? "1" : "0");
+
});
+ document.getElementById("list-switch-all").addEventListener("click", function() {
+ HttpPost("/socketAll", function (re) {
+ }, checkboxs[1].checked ? "1" : "0");});
+
//Socket-end
//Config-start
diff --git a/TC1/mqtt_server/user_mqtt_client.c b/TC1/mqtt_server/user_mqtt_client.c
index 2ce2697..6f12bbc 100644
--- a/TC1/mqtt_server/user_mqtt_client.c
+++ b/TC1/mqtt_server/user_mqtt_client.c
@@ -399,6 +399,7 @@ void ProcessHaCmd(char* cmd)
mqtt_log("set socket[%d] on[%d]", i, on);
UserRelaySet(i, on);
UserMqttSendSocketState(i);
+ UserMqttSendTotalSocketState();
mico_system_context_update(sys_config);
}else if(strcmp(cmd, "set led") == ' '){
int on;
@@ -419,6 +420,11 @@ void ProcessHaCmd(char* cmd)
if (strcmp(mac, str_mac)) return;
mqtt_log("set total_socket on[%d]", on);
UserRelaySetAll(on);
+ for (i = 0; i < SOCKET_NUM; i++)
+ {
+ UserRelaySet(i, user_config->socket_status[i]);
+ UserMqttSendSocketState(i);
+ }
UserMqttSendTotalSocketState();
}
}