getFitUnlockMethodList(params: GetFitUnlockMethodListParams)

Requires:
@ray-js/lock-sdk≥1.2.0

Description

Get the list of unlock methods of the specified type for the accessory.

Parameters

ParameterTypeRequiredDescription
YesList query params (type required, lockDevId optional)

Return Value

Type: Promise<FitUnlockMethodItem[]>
Parsed unlock-method list (sensitive fields such as passWord have been stripped)
FitUnlockMethodItem
PropertyTypeDescription
idnumberCloud unlock-method record ID (from `unlockBindingId`)
unlockIdnumberLock-side unlock instance ID
unlockNamestringUnlock method name
photoUnlockbooleanWhether an image-based unlock method
isSpecialbooleanWhether it is a special unlock method (not supported on the accessory edition, fixed to false)
type"finger" | "face" | "password" | "card" | "fingerVein" | "hand" | "eye"Unlock method type, consistent with the input parameter
userNamestringUsername the password belongs to
lockUserIdnumberUser's lock-side user ID
userTypenumberUser type
List of lock devices that can be unlocked

Error Code

Error CodeError Message
1014The current device does not support this type or lacks the corresponding DP ID

Referenced Types

interfaceFitUnlockMethodDevice
PropertyTypeDescription
devIdstringDoor lock device ID
devNamestringDoor lock device name

Valid Values

GetFitUnlockMethodListParams.type
ValueDescriptionSince
finger--
face--
password--
card--
fingerVein--
hand--
eye--
return.type
ValueDescriptionSince
finger--
face--
password--
card--
fingerVein--
hand--
eye--

Examples

import { getFitUnlockMethodList } from '@ray-js/lock-sdk';
const list = await getFitUnlockMethodList({ type: 'password' });
const lockOnly = await getFitUnlockMethodList({
  type: 'password',
  lockDevId: 'lock_xxx',
});