@honor-claw/yoyo 1.2.0-beta.6 → 1.2.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -361,20 +361,16 @@ export class MessageHandler {
|
|
|
361
361
|
|
|
362
362
|
// 收到NOT_PAIRED错误时,自动获取待配对设备并审批
|
|
363
363
|
if (!gatewayRawData.ok && gatewayRawData.error?.code === "NOT_PAIRED") {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
useClawLogger().info(`${LOG_PREFIX} auto pair succeefully`);
|
|
375
|
-
} catch (error) {
|
|
376
|
-
useClawLogger().error(`${LOG_PREFIX} auto pair failed: ${String(error)}`);
|
|
377
|
-
}
|
|
364
|
+
await this.handleAutoPair();
|
|
365
|
+
cloudData = JSON.stringify({
|
|
366
|
+
ok: true,
|
|
367
|
+
type: "res",
|
|
368
|
+
id: gatewayRawData.id,
|
|
369
|
+
payload: { type: "hello-ok" },
|
|
370
|
+
});
|
|
371
|
+
useClawLogger().info(
|
|
372
|
+
`${LOG_PREFIX} auto pairing is completed, ${JSON.stringify(cloudData)}`,
|
|
373
|
+
);
|
|
378
374
|
}
|
|
379
375
|
|
|
380
376
|
useClawLogger().debug?.(
|
|
@@ -416,7 +412,11 @@ export class MessageHandler {
|
|
|
416
412
|
useClawLogger().info(
|
|
417
413
|
`${LOG_PREFIX} auto approving device: ${device.deviceId}, requestId: ${device.requestId}`,
|
|
418
414
|
);
|
|
419
|
-
|
|
415
|
+
try {
|
|
416
|
+
await adminClient.devicePairApprove(device.requestId);
|
|
417
|
+
} catch (error) {
|
|
418
|
+
useClawLogger().error(`${LOG_PREFIX} auto pair failed: ${String(error)}, ignore...`);
|
|
419
|
+
}
|
|
420
420
|
}
|
|
421
421
|
|
|
422
422
|
if (pendingDevices.length === 0) {
|