修复LED控制无效的问题

This commit is contained in:
Your Name
2025-03-11 20:03:03 +08:00
parent 5189e53e6d
commit a493b83c4e
4 changed files with 716 additions and 681 deletions

View File

@@ -795,7 +795,7 @@
HttpPost("/socket", function (re) {
}, sockets_st);
HttpPost("/led", function (re) {
}, checkboxs[0].checked ? 1 : 0);
}, checkboxs[0].checked ? "1" : "0");
});
//Socket-end

File diff suppressed because it is too large Load Diff

View File

@@ -245,6 +245,8 @@ void MqttClientThread(mico_thread_arg_t arg)
mqtt_log("MQTT client connect success!");
UserLedSet(user_config->power_led_enabled);
/* 4. mqtt client subscribe */
rc = MQTTSubscribe(&c, topic_set, QOS0, MessageArrived);
require_noerr_string(rc, MQTT_reconnect, "ERROR: MQTT client subscribe err.");

View File

@@ -124,7 +124,7 @@ static void WifiLedTimerCallback(void* arg)
case WIFI_STATE_CONNECTED:
UserLedSet(0);
mico_rtos_stop_timer(&wifi_led_timer);
if (RelayOut())
if (RelayOut()&&user_config->power_led_enabled)
UserLedSet(1);
else
UserLedSet(0);