修复100J

This commit is contained in:
微微一笑
2026-03-26 15:39:50 +08:00
parent a18b2b81e8
commit e7b40dbed6
3 changed files with 90 additions and 16 deletions

View File

@ -684,10 +684,20 @@ export function deviceUpdateVolume(data) {
);
}
// 语音播放
/** 蓝牙侧语音播报:自定义音(mode=7)部分固件需先 0x0C 带模式再 0x06否则无声音 */
function bleVoiceBroadcastChain(data) {
const on = Number(data.voiceBroadcast) === 1;
const mode = data.mode != null ? String(data.mode) : '';
if (on && mode === '7') {
return protocolInstance.setForceAlarm(0, 7).then(() => protocolInstance.setVoiceBroadcast(1));
}
return protocolInstance.setVoiceBroadcast(on ? 1 : 0);
}
// 语音播放HTTP 透传 data便于后端识别 mode
export function deviceVoiceBroadcast(data) {
return execWithBleFirst(
() => protocolInstance.setVoiceBroadcast(data.voiceBroadcast).then(() => ({ code: 200, msg: '操作成功(蓝牙)' })),
() => bleVoiceBroadcastChain(data).then(() => ({ code: 200, msg: '操作成功(蓝牙)' })),
() => request({ url: `/app/hby100j/device/voiceBroadcast`, method: 'post', data }),
'语音播报'
);