develop_sky #1
@ -438,22 +438,42 @@ class SpeechLanguageSettingsLogic extends BaseGetXController {
|
||||
final int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
await BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
await BlueManage().writeCharacteristicWithResponse(
|
||||
SetVoicePackageFinalResult(
|
||||
lockID: BlueManage().connectDeviceName,
|
||||
languageCode: state.tempLangStr.value,
|
||||
).packageData(),
|
||||
);
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
});
|
||||
// await BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
// (BluetoothConnectionState deviceConnectionState) async {
|
||||
// if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
// await BlueManage().writeCharacteristicWithResponse(
|
||||
// SetVoicePackageFinalResult(
|
||||
// lockID: BlueManage().connectDeviceName,
|
||||
// languageCode: state.tempLangStr.value,
|
||||
// ).packageData(),
|
||||
// );
|
||||
// } else if (deviceConnectionState ==
|
||||
// BluetoothConnectionState.disconnected) {
|
||||
// dismissEasyLoading();
|
||||
// cancelBlueConnetctToastTimer();
|
||||
// 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;
|
||||
default:
|
||||
showToast('设置'.tr + '失败'.tr);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user