update:新增ota
This commit is contained in:
+6
-1
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user