fix:蓝牙同步名称报错解决
This commit is contained in:
@@ -10,10 +10,7 @@ import { updateDeviceSettings } from '@/pages/device/settings/device-settings.ap
|
||||
import { buildBleDeviceName, isStandardBleDeviceName } from '@/utils/ble-device-name'
|
||||
import { releaseBleDevice } from '@/utils/bluetooth'
|
||||
import { clearZ2BleHandleCache, sendZ2BleRenameCommand } from '@/utils/z2-ble'
|
||||
import {
|
||||
getZ2RenameProgressLabel,
|
||||
isZ2RenameSuccessful,
|
||||
} from '@/utils/z2-ble-protocol'
|
||||
import { getZ2RenameProgressLabel } from '@/utils/z2-ble-protocol'
|
||||
import { bindDevice } from '../add-device.api'
|
||||
import { parseId, sameId } from '@/utils/device-id'
|
||||
import { readStoredHomeId, saveSelectedHomeId } from '@/utils/selected-home'
|
||||
@@ -253,7 +250,7 @@ export function useCompleteDevice() {
|
||||
if (needRename) {
|
||||
uni.showLoading({ title: '正在同步蓝牙名称…', mask: true })
|
||||
try {
|
||||
const renameProgress = await sendZ2BleRenameCommand(bleDeviceId.value, bleName, {
|
||||
await sendZ2BleRenameCommand(bleDeviceId.value, bleName, {
|
||||
timeoutMs: 25000,
|
||||
onProgress: (progress) => {
|
||||
uni.showLoading({
|
||||
@@ -262,17 +259,8 @@ export function useCompleteDevice() {
|
||||
})
|
||||
},
|
||||
})
|
||||
if (!isZ2RenameSuccessful(renameProgress)) {
|
||||
uni.showToast({
|
||||
title: '蓝牙名称同步未完成,将继续添加设备',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
} catch {
|
||||
uni.showToast({
|
||||
title: '蓝牙名称同步失败,将继续添加设备',
|
||||
icon: 'none',
|
||||
})
|
||||
// 蓝牙名称同步失败不影响云端绑定,静默继续
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user