mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-11 20:48:16 +08:00
修复总开关逻辑问题
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user