优化远程开锁
This commit is contained in:
parent
ab18b60a3c
commit
261c166ec3
@ -133,8 +133,8 @@ class S {
|
|||||||
? 'Make sure it is safe to unlock the door.'
|
? 'Make sure it is safe to unlock the door.'
|
||||||
: '请确认现场安全后再远程开锁。';
|
: '请确认现场安全后再远程开锁。';
|
||||||
static String get remoteUnlockUnavailable => isEn
|
static String get remoteUnlockUnavailable => isEn
|
||||||
? 'The lock service reports remote unlock as unsupported or disabled. Enable remote unlock for this lock, then refresh its details and try again.'
|
? 'Remote unlock could not be enabled on this lock. Check the lock Bluetooth connection and permissions, then try again.'
|
||||||
: '云端锁详情显示不支持或未开启远程开锁。请在锁端/管理端开启该锁的远程开锁权限,刷新锁详情后重试。';
|
: '远程开锁未能在当前锁上开启,请检查锁的蓝牙连接和操作权限后重试。';
|
||||||
static String get remoteUnlockNeedsGateway => isEn
|
static String get remoteUnlockNeedsGateway => isEn
|
||||||
? 'This lock is not connected to a gateway for remote unlock.'
|
? 'This lock is not connected to a gateway for remote unlock.'
|
||||||
: '该锁未绑定网关,无法使用网关远程开锁。';
|
: '该锁未绑定网关,无法使用网关远程开锁。';
|
||||||
|
|||||||
@ -888,7 +888,7 @@ class _VideoTalkTabState extends State<VideoTalkTab> {
|
|||||||
if (token.isEmpty) {
|
if (token.isEmpty) {
|
||||||
throw StateError(S.remoteUnlockNeedsLogin);
|
throw StateError(S.remoteUnlockNeedsLogin);
|
||||||
}
|
}
|
||||||
if (fresh.isOnline != true) {
|
if (enabledLock.isOnline != true) {
|
||||||
throw StateError(S.remoteUnlockNeedsOnline);
|
throw StateError(S.remoteUnlockNeedsOnline);
|
||||||
}
|
}
|
||||||
await StarCloudClient.instance.device.remoteOpenLock(
|
await StarCloudClient.instance.device.remoteOpenLock(
|
||||||
|
|||||||
@ -83,6 +83,26 @@ class _WifiConfigTabState extends State<WifiConfigTab> {
|
|||||||
wifiConfiguredLockId.value = lock.lockId;
|
wifiConfiguredLockId.value = lock.lockId;
|
||||||
_log_(S.logWifiConfigCompleted);
|
_log_(S.logWifiConfigCompleted);
|
||||||
|
|
||||||
|
try {
|
||||||
|
final remoteUnlockReply = await StarCloudClient.instance.lockSetting
|
||||||
|
.setRemoteUnlockByContext(ctx, enabled: true);
|
||||||
|
if (remoteUnlockReply.status == 0) {
|
||||||
|
lock.lockFeature['remoteUnlock'] = 1;
|
||||||
|
lock.lockSetting.remoteUnlock = 1;
|
||||||
|
pairedLock.value = null;
|
||||||
|
pairedLock.value = lock;
|
||||||
|
_log_(S.isEn
|
||||||
|
? 'Remote unlock enabled by default.'
|
||||||
|
: '远程开锁已默认开启。');
|
||||||
|
} else {
|
||||||
|
final status = remoteUnlockReply.status;
|
||||||
|
_log_('Remote unlock default enable failed: '
|
||||||
|
'status=$status.');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
_log_('Remote unlock default enable failed: $e');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final gatewayStatus =
|
final gatewayStatus =
|
||||||
await StarCloudClient.instance.wifi.getGatewayStatus(
|
await StarCloudClient.instance.wifi.getGatewayStatus(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user