fitAddPassword(params: FitAddPasswordParams)

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

Description

Add a password on the accessory side

Parameters

ParameterTypeRequiredDescription
YesAdd parameter

Return Value

Type: Promise<void>
None (resolves after the cloud addFitOpenMode succeeds)

Error Code

Error CodeError Message
1054Password is empty
1014This unlock method type is not supported
1088Accessory is not bound to a lock
1089Target lock not found
1002Operation timed out
1015~1025 Device-reported add failure (status 0~10)
1026Device-reported add failure (status 0xfe)
1053Failed to sync adding the unlock method to the cloud

Examples

import { fitAddPassword } from '@ray-js/lock-sdk';
await fitAddPassword({
  lockDevId: 'lock_xxx',
  userId: 'user_001',
  name: 'Daily password',
  password: '123456',
});