Merge branch 'develop_sky_liyi' into 'develop_sky'
fix:调整语音设置 See merge request StarlockTeam/app-starlock!266
This commit is contained in:
commit
fbbf68c840
@ -438,22 +438,42 @@ class SpeechLanguageSettingsLogic extends BaseGetXController {
|
|||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
await BlueManage().blueSendData(BlueManage().connectDeviceName,
|
// await BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
(BluetoothConnectionState deviceConnectionState) async {
|
// (BluetoothConnectionState deviceConnectionState) async {
|
||||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
// if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||||
await BlueManage().writeCharacteristicWithResponse(
|
// await BlueManage().writeCharacteristicWithResponse(
|
||||||
SetVoicePackageFinalResult(
|
// SetVoicePackageFinalResult(
|
||||||
lockID: BlueManage().connectDeviceName,
|
// lockID: BlueManage().connectDeviceName,
|
||||||
languageCode: state.tempLangStr.value,
|
// languageCode: state.tempLangStr.value,
|
||||||
).packageData(),
|
// ).packageData(),
|
||||||
);
|
// );
|
||||||
} else if (deviceConnectionState ==
|
// } else if (deviceConnectionState ==
|
||||||
BluetoothConnectionState.disconnected) {
|
// BluetoothConnectionState.disconnected) {
|
||||||
dismissEasyLoading();
|
// dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
// cancelBlueConnetctToastTimer();
|
||||||
showBlueConnetctToast();
|
// showBlueConnetctToast();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
cancelBlueConnetctToastTimer();
|
||||||
|
final LoginEntity entity =
|
||||||
|
await ApiRepository.to.settingCurrentVoiceTimbre(
|
||||||
|
data: {
|
||||||
|
'lang': state.tempLangStr.value,
|
||||||
|
'timbre': state.tempTimbreStr.value,
|
||||||
|
},
|
||||||
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
|
);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
showSuccess('设置成功'.tr, something: () {
|
||||||
|
state.lockSetInfoData.value.lockSettingInfo?.currentVoiceTimbre
|
||||||
|
?.lang = state.tempLangStr.value;
|
||||||
|
state.lockSetInfoData.value.lockSettingInfo?.currentVoiceTimbre
|
||||||
|
?.timbre = state.tempTimbreStr.value;
|
||||||
|
eventBus.fire(
|
||||||
|
PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dismissEasyLoading();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
showToast('设置'.tr + '失败'.tr);
|
showToast('设置'.tr + '失败'.tr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user