update:新增ota

This commit is contained in:
2026-09-21 14:56:43 +08:00
parent b060d8f987
commit 4bd7599cc0
11 changed files with 652 additions and 410 deletions
+6 -1
View File
@@ -87,7 +87,12 @@ function createWebSocket(token, onMessage) {
const { data, event, code, timestamp } = response || {};
if (event === "pong") return;
if (event === "/addons/shoot/battery") {
const passthroughEvents = [
"/addons/shoot/battery",
"/addons/shoot/otaProgress",
"/addons/shoot/otaResult",
];
if (passthroughEvents.includes(event)) {
if ((code == null || Number(code) === 0) && onMessage && data && typeof data === "object") {
onMessage({ event, data, code, timestamp });
}