addFitTempPwd(params: AddFitTempPwdParams)

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

Description

Add a temporary password on the accessory.

Parameters

ParameterTypeRequiredDescription
YesAdd parameters

Return Value

Type: Promise<AddFitTempPwdResult>
Parsed result reported by the device
AddFitTempPwdResult
PropertyTypeDescription
pwdIdnumberCloud password ID; used to locate this password for subsequent delete/update/rename operations.

Referenced Types

typeWeekWeekly repeat bitmap: indices 0–6 correspond to Sun–Sat; 0 inactive, 1 active
export type Week = [
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
];

Valid Values

AddFitTempPwdParams.type
ValueDescriptionSince
once--
limit--
EffectiveConfig.repeat
ValueDescriptionSince
none--
week--
Week
ValueDescriptionSince
0--
1--

Examples

import { addFitTempPwd } from '@ray-js/lock-sdk';
const result = await addFitTempPwd({
  lockDevId: '1234567890',
  type: 'once',
  password: '123456',
  name: 'Guest password',
  effective: { effectiveDate: 1700000000, expiredDate: 1700003600, repeat: 'none' },
});