fix: 修复半自动锁远程无法开锁问题
This commit is contained in:
parent
0794b2fe75
commit
cdc83eb400
@ -639,18 +639,18 @@ class LockDetailLogic extends BaseGetXController {
|
||||
// 远程开锁
|
||||
Future<void> remoteOpenLock() async {
|
||||
final catEyeConfig = state.keyInfos.value.lockSetting?.catEyeConfig ?? [];
|
||||
if (catEyeConfig.isNotEmpty &&
|
||||
catEyeConfig.length > 0 &&
|
||||
catEyeConfig[0].catEyeMode != 0) {
|
||||
final LoginEntity entity = await ApiRepository.to.remoteOpenLock(
|
||||
lockId: state.keyInfos.value.lockId.toString(),
|
||||
timeOut: 60,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('已开锁'.tr);
|
||||
}
|
||||
} else {
|
||||
// 支持猫眼功能时,才需要判断是否是省电模式
|
||||
if (state.keyInfos.value.lockFeature?.isSupportCatEye == 1 &&
|
||||
catEyeConfig[0].catEyeMode == 0) {
|
||||
showToast('猫眼设置为省电模式时无法进行远程开锁,请在猫眼设置中切换为其他模式'.tr);
|
||||
return;
|
||||
}
|
||||
final LoginEntity entity = await ApiRepository.to.remoteOpenLock(
|
||||
lockId: state.keyInfos.value.lockId.toString(),
|
||||
timeOut: 60,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('已开锁'.tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user