fix: 修复半自动锁远程无法开锁问题

This commit is contained in:
Liuyf 2025-03-10 18:12:35 +08:00
parent 0794b2fe75
commit cdc83eb400

View File

@ -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);
}
}