getUnbindLockList()

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

Description

Get the list of locks that can be bound to the current accessory; each item includes a bindability check

Parameters

None

Return Value

Type: Promise<UnbindLockListItem[]>
List of bindable locks
UnbindLockListItem
PropertyTypeDescription
bindablebooleanWhether this lock can be bound to the current accessory (both protocol and security versions match)
unbindableReason"ble_version_mismatch" | "security_version_mismatch"Reason not bindable; not present when `bindable` is true
devNamestringDevice name
devIdstringDevice ID
devUnlockIdstringDevice unlock ID
devUuidstringDevice UUID
fittingIdstringAccessory ID
fittingUnlockIdstringAccessory unlock ID
iconstringIcon
isSupportScybooleanWhether scy is supported
onlinebooleanWhether online
protocolVersionstringProtocol version
randomStrstringRandom string

Valid Values

return.unbindableReason
ValueDescriptionSince
ble_version_mismatch--
security_version_mismatch--

Examples

import { getUnbindLockList } from '@ray-js/lock-sdk';
const lockList = await getUnbindLockList();
lockList.forEach(item => {
  if (!item.bindable) {
    console.log(item.devName, item.unbindableReason);
  }
});