Skip to content

电子钥匙

说明:主要对电子钥匙进行一些基础操作,例如添加电子钥匙、编辑电子钥匙、冻结电子钥匙、删除电子钥匙、重置电子钥匙、获取电子钥匙列表等。

添加电子钥匙

  • 调用方法
Dart
Future<void> addElectricKeys({
  int? cloudUid,
  required ElectricKeyModel electricKeyModel,
  TCallback<ApiResponse?>? onSuccess,
  ErrCallback<Object?>? onError,
})
  • 参数说明
名称类型是否必需示例描述
cloudUidint?N123云账号id
electricKeyModelElectricKeyModelYelectricKeyModel电子钥匙基本信息
onSuccessTCallback<ApiResponse?>?N(response) {}添加电子钥匙成功回调
onErrorErrCallback<Object?>?N(error) {}添加电子钥匙失败回调

编辑电子钥匙

  • 调用方法
Dart
Future<void> editElectricKeys({
  int? cloudUid,
  required ElectricKeyItem electricKeyItem,
  TCallback<ApiResponse?>? onSuccess,
  ErrCallback<Object?>? onError,
})
  • 参数说明
名称类型是否必需示例描述
cloudUidint?N123云账号id
electricKeyItemElectricKeyItemYelectricKeyItem电子钥匙基本信息
onSuccessTCallback<ApiResponse?>?N(response) {}编辑电子钥匙成功回调
onErrorErrCallback<Object?>?N(error) {}编辑电子钥匙失败回调

冻结电子钥匙

  • 调用方法
Dart
Future<void> freezeElectricKeys({
  required int keyId,
  required bool isFreeze,
  int? cloudUid,
  TCallback<ApiResponse?>? onSuccess,
  ErrCallback<Object?>? onError,
})
  • 参数说明
名称类型是否必需示例描述
keyIdintY500电子钥匙id
isFreezeboolYtrue是否冻结
cloudUidint?N123云账号id
onSuccessTCallback<ApiResponse?>?N(response) {}冻结电子钥匙成功回调
onErrorErrCallback<Object?>?N(error) {}冻结电子钥匙失败回调

删除电子钥匙

  • 调用方法
Dart
Future<void> deletElectricKeys({
  int? cloudUid,
  required int keyId,
  required int includeUnderlings,
  TCallback<ApiResponse?>? onSuccess,
  ErrCallback<Object?>? onError,
})
  • 参数说明
名称类型是否必需示例描述
cloudUidint?N123云账号id
keyIdintY500电子钥匙id
includeUnderlingsintY1是否级联删除
onSuccessTCallback<ApiResponse?>?N(response) {}删除电子钥匙成功回调
onErrorErrCallback<Object?>?N(error) {}删除电子钥匙失败回调

重置电子钥匙

  • 调用方法
Dart
Future<void> resetElectricKeys({
  int? cloudUid,
  required int lockId,
  TCallback<ApiResponse?>? onSuccess,
  ErrCallback<Object?>? onError,
})
  • 参数说明
名称类型是否必需示例描述
cloudUidint?N123云账号id
lockIdintY500锁id
onSuccessTCallback<ApiResponse?>?N(response) {}重置电子钥匙成功回调
onErrorErrCallback<Object?>?N(error) {}重置电子钥匙失败回调

获取电子钥匙列表

  • 调用方法
Dart
Future<void> getElectricKeysList({
  int? cloudUid,
  required int lockId,
  required int pageNo,
  required int pageSize,
  TCallback<ElectricKeyList>? onSuccess,
  ErrCallback<Object?>? onError,
})
  • 参数说明
名称类型是否必需示例描述
cloudUidint?N123云账号id
lockIdintY500锁id
pageNointY1第几页数据
pageSizeintY10每页多少条数据
onSuccessTCallback<ElectricKeyList>?N(list) {}获取电子钥匙列表成功回调
onErrorErrCallback<Object?>?N(error) {}获取电子钥匙列表失败回调

物联网设备通信协议文档