@zwave-js/cc 15.26.0 → 15.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/UserCodeCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./UserCodeCC._validateArgs.js\";\nconst { validateArgs_UserCodeCCAPI_get, validateArgs_UserCodeCCAPI_set, validateArgs_UserCodeCCAPI_setMany, validateArgs_UserCodeCCAPI_clear, validateArgs_UserCodeCCAPI_setKeypadMode, validateArgs_UserCodeCCAPI_setAdminCode } = __validateArgs;\nimport { CommandClasses, type EndpointId, type GetSupportedCCVersion, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeBitMask, enumValuesToMetadataStates, logList, parseBitMask, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, type BytesView, getEnumMemberName, isPrintableASCII, isPrintableASCIIWithWhitespace, isUint8Array, num2hex, pick, uint8ArrayToString, } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport type { NotificationEventPayload } from \"../lib/NotificationEventPayload.js\";\nimport { V } from \"../lib/Values.js\";\nimport { KeypadMode, UserCodeCommand, UserIDStatus } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { UserCredentialCC } from \"./UserCredentialCC.js\";\nimport { UserCodeCCValues } from \"./_CCValues.generated.js\";\nexport { UserCodeCCValues };\nfunction parseExtendedUserCode(payload: Bytes): {\n code: UserCode;\n bytesRead: number;\n} {\n validatePayload(payload.length >= 4);\n const userId = payload.readUInt16BE(0);\n const status: UserIDStatus = payload[2];\n const codeLength = payload[3] & 0b1111;\n validatePayload(payload.length >= 4 + codeLength);\n const code = payload.subarray(4, 4 + codeLength).toString(\"ascii\");\n return {\n code: {\n userId,\n userIdStatus: status,\n userCode: code,\n },\n bytesRead: 4 + codeLength,\n };\n}\nfunction validateCode(code: string, supportedChars: string): boolean {\n if (code.length < 4 || code.length > 10)\n return false;\n return code.split(\"\").every((char) => supportedChars.includes(char));\n}\nfunction setUserCodeMetadata(this: UserCodeCC, ctx: GetValueDB & GetSupportedCCVersion, userId: number, userCode?: string | BytesView) {\n const statusValue = UserCodeCCValues.userIdStatus(userId);\n const codeValue = UserCodeCCValues.userCode(userId);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n const supportedUserIDStatuses: UserIDStatus[] = this.getValue(ctx, UserCodeCCValues.supportedUserIDStatuses)\n ?? (ccVersion === 1\n ? [\n UserIDStatus.Available,\n UserIDStatus.Enabled,\n UserIDStatus.Disabled,\n ]\n : [\n UserIDStatus.Available,\n UserIDStatus.Enabled,\n UserIDStatus.Disabled,\n UserIDStatus.Messaging,\n UserIDStatus.PassageMode,\n ]);\n this.ensureMetadata(ctx, statusValue, {\n ...statusValue.meta,\n states: enumValuesToMetadataStates(UserIDStatus, supportedUserIDStatuses),\n });\n const codeMetadata: ValueMetadata = {\n ...(isUint8Array(userCode)\n ? ValueMetadata.Buffer\n : ValueMetadata.String),\n minLength: 4,\n maxLength: 10,\n label: `User Code (${userId})`,\n };\n if (this.getMetadata(ctx, codeValue)?.type !== codeMetadata.type) {\n this.setMetadata(ctx, codeValue, codeMetadata);\n }\n}\nfunction persistUserCode(this: UserCodeCC, ctx: GetValueDB & GetSupportedCCVersion, userId: number, userIdStatus: UserIDStatus, userCode: string | Bytes) {\n const statusValue = UserCodeCCValues.userIdStatus(userId);\n const codeValue = UserCodeCCValues.userCode(userId);\n // Check if this code is supported\n if (userIdStatus === UserIDStatus.StatusNotAvailable) {\n // It is not, remove all values if any exist\n this.removeValue(ctx, statusValue);\n this.removeValue(ctx, codeValue);\n this.removeMetadata(ctx, statusValue);\n this.removeMetadata(ctx, codeValue);\n }\n else {\n // Always create metadata in case it does not exist\n setUserCodeMetadata.call(this, ctx, userId, userCode);\n this.setValue(ctx, statusValue, userIdStatus);\n this.setValue(ctx, codeValue, userCode);\n }\n return true;\n}\n/** Formats a user code in a way that's safe to print in public logs */\nexport function userCodeToLogString(userCode: string | BytesView): string {\n if (userCode.length === 0)\n return \"(empty)\";\n return \"*\".repeat(userCode.length);\n}\n@API(CommandClasses[\"User Code\"])\nexport class UserCodeCCAPI extends PhysicalCCAPI {\n public supportsCommand(cmd: UserCodeCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case UserCodeCommand.Get:\n case UserCodeCommand.Set:\n case UserCodeCommand.UsersNumberGet:\n return true; // This is mandatory\n case UserCodeCommand.CapabilitiesGet:\n case UserCodeCommand.KeypadModeSet:\n case UserCodeCommand.KeypadModeGet:\n case UserCodeCommand.ExtendedUserCodeSet:\n case UserCodeCommand.ExtendedUserCodeGet:\n return this.version >= 2;\n case UserCodeCommand.AdminCodeSet:\n case UserCodeCommand.AdminCodeGet: {\n if (this.version < 2)\n return false;\n return this.tryGetValueDB()?.getValue<boolean>(UserCodeCCValues.supportsAdminCode.endpoint(this.endpoint.index));\n }\n case UserCodeCommand.UserCodeChecksumGet: {\n if (this.version < 2)\n return false;\n return this.tryGetValueDB()?.getValue<boolean>(UserCodeCCValues.supportsUserCodeChecksum.endpoint(this.endpoint.index));\n }\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: UserCodeCCAPI, { property, propertyKey }, value) {\n let result: SupervisionResult | undefined;\n if (property === \"keypadMode\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n result = await this.setKeypadMode(value);\n }\n else if (property === \"adminCode\"\n // Support devices that were interviewed before the rename to adminCode\n || property === \"masterCode\") {\n if (typeof value !== \"string\") {\n throwWrongValueType(this.ccId, property, \"string\", typeof value);\n }\n result = await this.setAdminCode(value);\n }\n else if (property === \"userIdStatus\") {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n if (value === UserIDStatus.Available) {\n // Clear Code\n result = await this.clear(propertyKey);\n }\n else {\n // We need to set the user code along with the status\n const userCode = this.getValueDB().getValue<string>(UserCodeCCValues.userCode(propertyKey).endpoint(this.endpoint.index));\n result = await this.set(propertyKey, value, userCode!);\n }\n }\n else if (property === \"userCode\") {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (typeof value !== \"string\" && !isUint8Array(value)) {\n throwWrongValueType(this.ccId, property, \"string or Buffer\", typeof value);\n }\n // We need to set the user id status along with the code\n let userIdStatus = this.getValueDB().getValue<UserIDStatus>(UserCodeCCValues.userIdStatus(propertyKey).endpoint(this.endpoint.index));\n if (userIdStatus === UserIDStatus.Available\n || userIdStatus == undefined) {\n userIdStatus = UserIDStatus.Enabled;\n }\n result = await this.set(propertyKey, userIdStatus as any, value);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n return result;\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property, propertyKey }, value) => {\n const valueId = {\n commandClass: this.ccId,\n endpoint: this.endpoint.index,\n property,\n propertyKey,\n };\n if (UserCodeCCValues.keypadMode.is(valueId)\n || UserCodeCCValues.adminCode.is(valueId)\n // Support devices that were interviewed before the rename to adminCode\n || UserCodeCCValues._deprecated_masterCode.is(valueId)) {\n // Keypad mode, admin/master code should update immediately.\n // Optimistically update when supervised successfully, otherwise verify\n // For the deprecated masterCode, the canonical target is adminCode\n return {\n forceVerifyChanges: () => true,\n verifyChanges: (result) => {\n if (supervisedCommandSucceeded(result)) {\n this.tryGetValueDB()?.setValue(valueId, value);\n }\n else if (this.isSinglecast()) {\n this.schedulePoll(valueId, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n else if (UserCodeCCValues.userCode.is(valueId)\n || UserCodeCCValues.userIdStatus.is(valueId)) {\n // Simply verify the change in any case\n return {\n forceVerifyChanges: () => true,\n verifyChanges: (_result) => {\n if (this.isSinglecast()) {\n this.schedulePoll(valueId, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n };\n public isSetValueOptimistic(_valueId: ValueID): boolean {\n return false; // Always verify changes, do not assume changes were applied\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: UserCodeCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"keypadMode\":\n return this.getKeypadMode();\n case \"adminCode\":\n return this.getAdminCode();\n case \"userIdStatus\":\n case \"userCode\": {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return (await this.get(propertyKey))?.[property];\n }\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n public async getUsersCount(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.UsersNumberGet);\n const cc = new UserCodeCCUsersNumberGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCUsersNumberReport>(cc, this.commandOptions);\n return response?.supportedUsers;\n }\n public async get(userId: number, multiple?: false): Promise<MaybeNotKnown<Pick<UserCode, \"userIdStatus\" | \"userCode\">>>;\n public async get(userId: number, multiple: true): Promise<MaybeNotKnown<{\n userCodes: readonly UserCode[];\n nextUserId: number;\n }>>;\n @validateArgs_UserCodeCCAPI_get()\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get(userId: number, multiple: boolean = false) {\n if (userId > 255 || multiple) {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.ExtendedUserCodeGet);\n const cc = new UserCodeCCExtendedUserCodeGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userId,\n reportMore: multiple,\n });\n const response = await this.host.sendCommand<UserCodeCCExtendedUserCodeReport>(cc, this.commandOptions);\n if (!response) {\n return;\n }\n else if (multiple) {\n return pick(response, [\"userCodes\", \"nextUserId\"]);\n }\n else {\n return pick(response.userCodes[0], [\n \"userIdStatus\",\n \"userCode\",\n ]);\n }\n }\n else {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Get);\n const cc = new UserCodeCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userId,\n });\n const response = await this.host.sendCommand<UserCodeCCReport>(cc, this.commandOptions);\n if (response)\n return pick(response, [\"userIdStatus\", \"userCode\"]);\n }\n }\n /** Configures a single user code */\n @validateArgs_UserCodeCCAPI_set()\n public async set(userId: number, userIdStatus: Exclude<UserIDStatus, UserIDStatus.Available | UserIDStatus.StatusNotAvailable>, userCode: string | BytesView): Promise<SupervisionResult | undefined> {\n // CL:0063.01.31.02.1: V2+ nodes must use Extended User Code Set\n if (this.version >= 2 || userId > 255) {\n return this.setMany([{ userId, userIdStatus, userCode }]);\n }\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Set);\n const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);\n if (numUsers != undefined && userId > numUsers) {\n throw new ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new UserCodeCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userId,\n userIdStatus,\n userCode,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /** Configures multiple user codes */\n @validateArgs_UserCodeCCAPI_setMany()\n public async setMany(codes: UserCodeCCSetOptions[]): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.ExtendedUserCodeSet);\n const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);\n const supportedStatuses = UserCodeCC.getSupportedUserIDStatusesCached(this.host, this.endpoint);\n const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);\n const supportsMultipleUserCodeSet = UserCodeCC.supportsMultipleUserCodeSetCached(this.host, this.endpoint) ?? false;\n // Validate options\n if (numUsers != undefined) {\n if (codes.some((code) => code.userId < 0 || code.userId > numUsers)) {\n throw new ZWaveError(`All User IDs must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n else {\n if (codes.some((code) => code.userId < 0)) {\n throw new ZWaveError(`All User IDs must be greater than 0.`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n if (codes.some((code) => code.userId === 0) && codes.length > 1) {\n throw new ZWaveError(`If user ID 0 is used, only one code may be set`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (codes.some((code) => code.userId === 0\n && code.userIdStatus !== UserIDStatus.Available)) {\n throw new ZWaveError(`User ID 0 may only be used to clear all user codes`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (codes.length > 1 && !supportsMultipleUserCodeSet) {\n throw new ZWaveError(`The node does not support setting multiple user codes at once`, ZWaveErrorCodes.Argument_Invalid);\n }\n for (const code of codes) {\n if (supportedStatuses != undefined\n && !supportedStatuses.includes(code.userIdStatus)) {\n throw new ZWaveError(`The user ID status ${getEnumMemberName(UserIDStatus, code.userIdStatus)} is not supported by the node`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (code.userIdStatus === UserIDStatus.Available) {\n code.userCode = undefined;\n }\n else if (supportedASCIIChars) {\n const userCodeString = typeof code.userCode === \"string\"\n ? code.userCode\n : uint8ArrayToString(code.userCode);\n if (!validateCode(userCodeString, supportedASCIIChars)) {\n throw new ZWaveError(`The user code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n }\n const cc = new UserCodeCCExtendedUserCodeSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userCodes: codes,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Clears one or all user code\n * @param userId The user code to clear. If none or 0 is given, all codes are cleared\n */\n @validateArgs_UserCodeCCAPI_clear()\n public async clear(userId: number = 0): Promise<SupervisionResult | undefined> {\n // CL:0063.01.31.02.1: V2+ nodes must use Extended User Code Set\n if (this.version >= 2 || userId > 255) {\n return this.setMany([\n { userId, userIdStatus: UserIDStatus.Available },\n ]);\n }\n else {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Set);\n const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);\n if (numUsers != undefined && userId > numUsers) {\n throw new ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new UserCodeCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userId,\n userIdStatus: UserIDStatus.Available,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getCapabilities() {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.CapabilitiesGet);\n const cc = new UserCodeCCCapabilitiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCCapabilitiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsAdminCode\",\n \"supportsAdminCodeDeactivation\",\n \"supportsUserCodeChecksum\",\n \"supportsMultipleUserCodeReport\",\n \"supportsMultipleUserCodeSet\",\n \"supportedUserIDStatuses\",\n \"supportedKeypadModes\",\n \"supportedASCIIChars\",\n ]);\n }\n }\n public async getKeypadMode(): Promise<MaybeNotKnown<KeypadMode>> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.KeypadModeGet);\n const cc = new UserCodeCCKeypadModeGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCKeypadModeReport>(cc, this.commandOptions);\n return response?.keypadMode;\n }\n @validateArgs_UserCodeCCAPI_setKeypadMode()\n public async setKeypadMode(keypadMode: KeypadMode): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.KeypadModeSet);\n const supportedModes = UserCodeCC.getSupportedKeypadModesCached(this.host, this.endpoint);\n if (!supportedModes) {\n throw new ZWaveError(`The keypad mode can only be set after the interview is complete!`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (!supportedModes.includes(keypadMode)) {\n throw new ZWaveError(`The keypad mode ${getEnumMemberName(KeypadMode, keypadMode)} is not supported by the node!`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new UserCodeCCKeypadModeSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n keypadMode,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getAdminCode(): Promise<MaybeNotKnown<string>> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.AdminCodeGet);\n const cc = new UserCodeCCAdminCodeGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCAdminCodeReport>(cc, this.commandOptions);\n return response?.adminCode;\n }\n @validateArgs_UserCodeCCAPI_setAdminCode()\n public async setAdminCode(adminCode: string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.AdminCodeSet);\n const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);\n if (!supportedASCIIChars) {\n throw new ZWaveError(`The admin code can only be set after the interview is complete!`, ZWaveErrorCodes.Argument_Invalid);\n }\n // Validate the code\n if (!adminCode) {\n const supportsDeactivation = UserCodeCC\n .supportsAdminCodeDeactivationCached(this.host, this.endpoint);\n if (!supportsDeactivation) {\n throw new ZWaveError(`The node does not support deactivating the admin code!`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n else if (!validateCode(adminCode, supportedASCIIChars)) {\n throw new ZWaveError(`The admin code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new UserCodeCCAdminCodeSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n adminCode,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getUserCodeChecksum(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.UserCodeChecksumGet);\n const cc = new UserCodeCCUserCodeChecksumGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCUserCodeChecksumReport>(cc, this.commandOptions);\n return response?.userCodeChecksum;\n }\n}\n@commandClass(CommandClasses[\"User Code\"])\n@implementedVersion(2)\n@ccValues(UserCodeCCValues)\nexport class UserCodeCC extends CommandClass {\n declare ccCommand: UserCodeCommand;\n public determineRequiredCCInterviews(): readonly CommandClasses[] {\n return [\n ...super.determineRequiredCCInterviews(),\n // CL:0083.01.21.00.2 ff: The controlling node MUST only use ONE of\n // the User Management Command Classes to control a supporting node,\n // and cache which User Management CC is used for each node.\n //\n // We determine this by interviewing U3C first, and then optionally\n // User Code CC.\n CommandClasses[\"User Credential\"],\n ];\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n // CL:0083.01.21.00.6: A controlling node MUST NOT control the User\n // Code on a supporting node that otherwise supports User Credential\n // unless no Users are currently supported on the supporting node.\n if (endpoint.supportsCC(CommandClasses[\"User Credential\"])) {\n const u3cUsers = UserCredentialCC.getSupportedUsersCached(ctx, endpoint);\n if (u3cUsers == undefined) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Cannot determine if the node uses User Credential CC for user management, skipping User Code CC interview...\",\n level: \"warn\",\n });\n return;\n }\n else if (u3cUsers > 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Node uses User Credential CC for user management, skipping User Code CC interview...\",\n direction: \"none\",\n });\n this.setInterviewComplete(ctx, true);\n return;\n }\n }\n const api = CCAPI.create(CommandClasses[\"User Code\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // Query capabilities first to determine what needs to be done when refreshing\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n message: \"querying capabilities...\",\n direction: \"outbound\",\n });\n const caps = await api.getCapabilities();\n if (!caps) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"User Code capabilities query timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n }\n ctx.logNode(node.id, {\n message: \"querying number of user codes...\",\n direction: \"outbound\",\n });\n const supportedUsers = await api.getUsersCount();\n if (supportedUsers == undefined) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying number of user codes timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n for (let userId = 1; userId <= supportedUsers; userId++) {\n setUserCodeMetadata.call(this, ctx, userId);\n }\n // Synchronize user codes and settings\n await this.refreshValues(ctx, {\n queryAllUserCodes: ctx.getInterviewOptions()?.queryAllUserCodes\n ?? false,\n onProgress: (completed, total) => node.reportInterviewProgress(completed, total),\n });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void>;\n /** @internal */\n public async refreshValues(ctx: RefreshValuesContext, options: RefreshValuesOptions & {\n queryAllUserCodes: boolean;\n }): Promise<void>;\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions & {\n queryAllUserCodes: boolean;\n }): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n // CL:0083.01.21.00.6: A controlling node MUST NOT control the User\n // Code on a supporting node that otherwise supports User Credential\n // unless no Users are currently supported on the supporting node.\n // This includes the case where that is not determined yet:\n if (endpoint.supportsCC(CommandClasses[\"User Credential\"])\n && UserCredentialCC.getSupportedUsersCached(ctx, endpoint) !== 0) {\n return;\n }\n const api = CCAPI.create(CommandClasses[\"User Code\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const { queryAllUserCodes = false } = options ?? {};\n const supportsAdminCode: boolean = UserCodeCC.supportsAdminCodeCached(ctx, endpoint);\n const supportsUserCodeChecksum: boolean = this.getValue(ctx, UserCodeCCValues.supportsUserCodeChecksum) ?? false;\n const supportedKeypadModes: readonly KeypadMode[] = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes)\n ?? [];\n const supportedUsers: number = this.getValue(ctx, UserCodeCCValues.supportedUsers) ?? 0;\n const supportsMultipleUserCodeReport = !!this.getValue(ctx, UserCodeCCValues.supportsMultipleUserCodeReport);\n // CL:0063.01.22.01.1:\n // A controlling node SHOULD NOT automatically delete any user code unless it is the initial interview\n // right after having included the supporting node in the network.\n //\n // We assume that the user wants to query all codes if they call this method directly\n // During the initial interview (node.bootstrapped === false), we either delete\n // all codes, or query them depending on the driver option.\n const userCodeAction = (!node.bootstrapped && !queryAllUserCodes)\n ? \"delete\"\n : \"query\";\n // Check for changed values and codes\n if (api.version >= 2) {\n if (supportsAdminCode) {\n ctx.logNode(node.id, {\n message: \"querying admin code...\",\n direction: \"outbound\",\n });\n await api.getAdminCode();\n }\n if (supportedKeypadModes.length > 1) {\n ctx.logNode(node.id, {\n message: \"querying active keypad mode...\",\n direction: \"outbound\",\n });\n await api.getKeypadMode();\n }\n const storedUserCodeChecksum: number = this.getValue(ctx, UserCodeCCValues.userCodeChecksum) ?? 0;\n let currentUserCodeChecksum: number | undefined = 0;\n if (supportsUserCodeChecksum) {\n ctx.logNode(node.id, {\n message: \"retrieving current user code checksum...\",\n direction: \"outbound\",\n });\n currentUserCodeChecksum = await api.getUserCodeChecksum();\n }\n // For a node controlling version 2 or newer:\n // \u2022 It is OPTIONAL to send an Extended User Code Get Command for every User Identifier to a\n // node supporting version 2 or newer if:\n // \u2013 The controlling node requested the checksum and it is set to 0, or\n // \u2013 The controlling node issues an Extended User Code Set Command (User ID = 0, User ID\n // Status = 0) to delete all user codes, or\n // \u2013 The supporting node reports that no more User Identifiers are set in the Extended User\n // Code Report Command with the Next User Identifier field.\n if (userCodeAction === \"delete\") {\n ctx.logNode(node.id, {\n message: \"Initial interview, clearing all user codes...\",\n direction: \"outbound\",\n });\n await api.clear();\n }\n else if (userCodeAction === \"query\") {\n if (!supportsUserCodeChecksum\n || currentUserCodeChecksum !== storedUserCodeChecksum) {\n ctx.logNode(node.id, {\n message: \"checksum changed or is not supported, querying all user codes...\",\n direction: \"outbound\",\n });\n if (supportsMultipleUserCodeReport) {\n // Query the user codes in bulk\n let nextUserId = 1;\n while (nextUserId > 0 && nextUserId <= supportedUsers) {\n const response = await api.get(nextUserId, true);\n options?.onProgress?.(nextUserId, supportedUsers);\n if (response) {\n nextUserId = response.nextUserId;\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Querying user code #${nextUserId} timed out, skipping the remaining interview...`,\n level: \"warn\",\n });\n break;\n }\n }\n }\n else {\n // Query one user code at a time\n for (let userId = 1; userId <= supportedUsers; userId++) {\n await api.get(userId);\n options?.onProgress?.(userId, supportedUsers);\n }\n }\n }\n }\n }\n else {\n // V1\n // \u2022 It is OPTIONAL to send a User Code Get Command for every User Identifier to a node sup-\n // porting version 1 if the controlling node issues a User Code Set Command (User ID = 0, User\n // ID Status = 0) to delete all user codes.\n if (userCodeAction === \"delete\") {\n ctx.logNode(node.id, {\n message: \"Initial interview, clearing all user codes...\",\n direction: \"outbound\",\n });\n await api.clear();\n }\n else if (userCodeAction === \"query\") {\n ctx.logNode(node.id, {\n message: \"querying all user codes...\",\n direction: \"outbound\",\n });\n for (let userId = 1; userId <= supportedUsers; userId++) {\n await api.get(userId);\n options?.onProgress?.(userId, supportedUsers);\n }\n }\n }\n }\n /**\n * Returns the number of supported users.\n * This only works AFTER the interview process\n */\n public static getSupportedUsersCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<number> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(UserCodeCCValues.supportedUsers.endpoint(endpoint.index));\n }\n /**\n * Returns the supported keypad modes.\n * This only works AFTER the interview process\n */\n public static getSupportedKeypadModesCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<KeypadMode[]> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(UserCodeCCValues.supportedKeypadModes.endpoint(endpoint.index));\n }\n /**\n * Returns the supported user ID statuses.\n * This only works AFTER the interview process\n */\n public static getSupportedUserIDStatusesCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<UserIDStatus[]> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(UserCodeCCValues.supportedUserIDStatuses.endpoint(endpoint.index));\n }\n /**\n * Returns the supported ASCII characters.\n * This only works AFTER the interview process\n */\n public static getSupportedASCIICharsCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<string> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(UserCodeCCValues.supportedASCIIChars.endpoint(endpoint.index));\n }\n /**\n * Returns whether the admin code functionality is supported.\n * This only works AFTER the interview process\n */\n public static supportsAdminCodeCached(ctx: GetValueDB, endpoint: EndpointId): boolean {\n const valueDB = ctx\n .getValueDB(endpoint.nodeId);\n return valueDB.getValue<boolean>(UserCodeCCValues.supportsAdminCode.endpoint(endpoint.index)) ?? valueDB.getValue<boolean>(UserCodeCCValues._deprecated_supportsMasterCode.endpoint(endpoint.index)) ?? false;\n }\n /**\n * Returns whether deactivating the admin code is supported.\n * This only works AFTER the interview process\n */\n public static supportsAdminCodeDeactivationCached(ctx: GetValueDB, endpoint: EndpointId): boolean {\n const valueDB = ctx\n .getValueDB(endpoint.nodeId);\n return valueDB.getValue<boolean>(UserCodeCCValues.supportsAdminCodeDeactivation.endpoint(endpoint.index)) ?? valueDB.getValue<boolean>(UserCodeCCValues._deprecated_supportsMasterCodeDeactivation\n .endpoint(endpoint.index)) ?? false;\n }\n /**\n * Returns whether setting multiple user codes at once is supported.\n * This only works AFTER the interview process\n */\n public static supportsMultipleUserCodeSetCached(ctx: GetValueDB, endpoint: EndpointId): boolean {\n return !!ctx\n .getValueDB(endpoint.nodeId)\n .getValue<boolean>(UserCodeCCValues.supportsMultipleUserCodeSet.endpoint(endpoint.index));\n }\n /**\n * Returns the current status of a user ID.\n * This only works AFTER the user IDs have been queried.\n */\n public static getUserIdStatusCached(ctx: GetValueDB, endpoint: EndpointId, userId: number): MaybeNotKnown<UserIDStatus> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue<UserIDStatus>(UserCodeCCValues.userIdStatus(userId).endpoint(endpoint.index));\n }\n /**\n * Returns the current code belonging to a user ID.\n * This only works AFTER the user IDs have been queried.\n */\n public static getUserCodeCached(ctx: GetValueDB, endpoint: EndpointId, userId: number): MaybeNotKnown<string | BytesView> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue<string | BytesView>(UserCodeCCValues.userCode(userId).endpoint(endpoint.index));\n }\n /**\n * Sets the status of a user ID in the cache.\n */\n public static setUserIdStatusCached(ctx: GetValueDB, endpoint: EndpointId, userId: number, status: UserIDStatus): void {\n ctx\n .getValueDB(endpoint.nodeId)\n .setValue(UserCodeCCValues.userIdStatus(userId).endpoint(endpoint.index), status);\n }\n /**\n * Sets the code belonging to a user ID in the cache.\n */\n public static setUserCodeCached(ctx: GetValueDB, endpoint: EndpointId, userId: number, code: string | BytesView): void {\n ctx\n .getValueDB(endpoint.nodeId)\n .setValue(UserCodeCCValues.userCode(userId).endpoint(endpoint.index), code);\n }\n}\n// @publicAPI\nexport type UserCodeCCSetOptions = {\n userId: 0;\n userIdStatus: UserIDStatus.Available;\n userCode?: undefined;\n} | {\n userId: number;\n userIdStatus: UserIDStatus.Available;\n userCode?: undefined;\n} | {\n userId: number;\n userIdStatus: Exclude<UserIDStatus, UserIDStatus.Available | UserIDStatus.StatusNotAvailable>;\n userCode: string | BytesView;\n};\n@CCCommand(UserCodeCommand.Set)\n@useSupervision()\nexport class UserCodeCCSet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCSetOptions>) {\n super(options);\n this.userId = options.userId;\n this.userIdStatus = options.userIdStatus;\n // Validate options\n if (this.userId < 0) {\n throw new ZWaveError(`${this.constructor.name}: The user ID must be between greater than 0.`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (this.userId === 0\n && this.userIdStatus !== UserIDStatus.Available) {\n throw new ZWaveError(`${this.constructor.name}: User ID 0 may only be used to clear all user codes`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (this.userIdStatus === UserIDStatus.Available) {\n this.userCode = \"\\0\".repeat(4);\n }\n else {\n this.userCode = options.userCode!;\n // Specs say ASCII 0-9, manufacturers don't care :)\n if (this.userCode.length < 4 || this.userCode.length > 10) {\n throw new ZWaveError(`${this.constructor.name}: The user code must have a length of 4 to 10 ${typeof this.userCode === \"string\"\n ? \"characters\"\n : \"bytes\"}`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCSet {\n validatePayload(raw.payload.length >= 2);\n const userId = raw.payload[0];\n const userIdStatus: UserIDStatus = raw.payload[1];\n if (userIdStatus === UserIDStatus.StatusNotAvailable) {\n validatePayload.fail(\"Invalid user ID status\");\n }\n if (userIdStatus === UserIDStatus.Available) {\n return new this({\n nodeId: ctx.sourceNodeId,\n userId,\n userIdStatus,\n });\n }\n const userCode = raw.payload.subarray(2);\n return new this({\n nodeId: ctx.sourceNodeId,\n userId,\n userIdStatus,\n userCode,\n });\n }\n public userId: number;\n public userIdStatus: UserIDStatus;\n public userCode: string | BytesView;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.userId, this.userIdStatus],\n typeof this.userCode === \"string\"\n ? Bytes.from(this.userCode, \"ascii\")\n : this.userCode,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"user id\": this.userId,\n \"id status\": getEnumMemberName(UserIDStatus, this.userIdStatus),\n \"user code\": userCodeToLogString(this.userCode),\n },\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCReportOptions {\n userId: number;\n userIdStatus: UserIDStatus;\n userCode?: string | Bytes;\n}\n@CCCommand(UserCodeCommand.Report)\nexport class UserCodeCCReport extends UserCodeCC implements NotificationEventPayload {\n public constructor(options: WithAddress<UserCodeCCReportOptions>) {\n super(options);\n this.userId = options.userId;\n this.userIdStatus = options.userIdStatus;\n this.userCode = options.userCode ?? \"\";\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCReport {\n validatePayload(raw.payload.length >= 2);\n const userId = raw.payload[0];\n const userIdStatus: UserIDStatus = raw.payload[1];\n let userCode: string | Bytes;\n if (raw.payload.length === 2\n && (userIdStatus === UserIDStatus.Available\n || userIdStatus === UserIDStatus.StatusNotAvailable)) {\n // The user code is not set or not available and this report contains no user code\n userCode = \"\";\n }\n else {\n // The specs require the user code to be at least 4 digits\n validatePayload(raw.payload.length >= 6);\n let userCodeBuffer = raw.payload.subarray(2);\n // Specs say infer user code from payload length, manufacturers send zero-padded strings\n while (userCodeBuffer.at(-1) === 0) {\n userCodeBuffer = userCodeBuffer.subarray(0, -1);\n }\n // Specs say ASCII 0-9, manufacturers don't care :)\n // Thus we check if the code is printable using ASCII, if not keep it as a Buffer\n const userCodeString = userCodeBuffer.toString(\"utf8\");\n if (isPrintableASCII(userCodeString)) {\n userCode = userCodeString;\n }\n else if (isPrintableASCIIWithWhitespace(userCodeString)) {\n // Ignore leading and trailing whitespace in V1 reports if the rest is ASCII\n userCode = userCodeString.trim();\n }\n else {\n userCode = userCodeBuffer;\n }\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n userId,\n userIdStatus,\n userCode,\n });\n }\n public readonly userId: number;\n public readonly userIdStatus: UserIDStatus;\n public readonly userCode: string | Bytes;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n persistUserCode.call(this, ctx, this.userId, this.userIdStatus, this.userCode);\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n let userCodeBuffer: Bytes;\n if (typeof this.userCode === \"string\") {\n userCodeBuffer = Bytes.from(this.userCode, \"ascii\");\n }\n else {\n userCodeBuffer = this.userCode;\n }\n this.payload = Bytes.concat([\n [this.userId, this.userIdStatus],\n userCodeBuffer,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"user id\": this.userId,\n \"id status\": getEnumMemberName(UserIDStatus, this.userIdStatus),\n \"user code\": userCodeToLogString(this.userCode),\n },\n };\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public toNotificationEventParameters() {\n return { userId: this.userId };\n }\n}\n// @publicAPI\nexport interface UserCodeCCGetOptions {\n userId: number;\n}\n@CCCommand(UserCodeCommand.Get)\n@expectedCCResponse(UserCodeCCReport)\nexport class UserCodeCCGet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCGetOptions>) {\n super(options);\n this.userId = options.userId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCGet {\n validatePayload(raw.payload.length >= 1);\n const userId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n userId,\n });\n }\n public userId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.userId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"user id\": this.userId },\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCUsersNumberReportOptions {\n supportedUsers: number;\n}\n@CCCommand(UserCodeCommand.UsersNumberReport)\n@ccValueProperty(\"supportedUsers\", UserCodeCCValues.supportedUsers)\nexport class UserCodeCCUsersNumberReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCUsersNumberReportOptions>) {\n super(options);\n this.supportedUsers = options.supportedUsers;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCUsersNumberReport {\n validatePayload(raw.payload.length >= 1);\n let supportedUsers;\n if (raw.payload.length >= 3) {\n // V2+\n supportedUsers = raw.payload.readUInt16BE(1);\n }\n else {\n // V1\n supportedUsers = raw.payload[0];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedUsers,\n });\n }\n public readonly supportedUsers: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(3);\n // If the node implements more than 255 users, this field MUST be set to 255\n this.payload[0] = Math.min(255, this.supportedUsers);\n this.payload.writeUInt16BE(this.supportedUsers, 1);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"supported users\": this.supportedUsers },\n };\n }\n}\n@CCCommand(UserCodeCommand.UsersNumberGet)\n@expectedCCResponse(UserCodeCCUsersNumberReport)\nexport class UserCodeCCUsersNumberGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCCapabilitiesReportOptions {\n supportsAdminCode: boolean;\n supportsAdminCodeDeactivation: boolean;\n supportsUserCodeChecksum: boolean;\n supportsMultipleUserCodeReport: boolean;\n supportsMultipleUserCodeSet: boolean;\n supportedUserIDStatuses: readonly UserIDStatus[];\n supportedKeypadModes: readonly KeypadMode[];\n supportedASCIIChars: string;\n}\n@CCCommand(UserCodeCommand.CapabilitiesReport)\n@ccValueProperty(\"supportsAdminCode\", UserCodeCCValues.supportsAdminCode)\n@ccValueProperty(\"supportsAdminCodeDeactivation\", UserCodeCCValues.supportsAdminCodeDeactivation)\n@ccValueProperty(\"supportsUserCodeChecksum\", UserCodeCCValues.supportsUserCodeChecksum)\n@ccValueProperty(\"supportsMultipleUserCodeReport\", UserCodeCCValues.supportsMultipleUserCodeReport)\n@ccValueProperty(\"supportsMultipleUserCodeSet\", UserCodeCCValues.supportsMultipleUserCodeSet)\n@ccValueProperty(\"supportedUserIDStatuses\", UserCodeCCValues.supportedUserIDStatuses)\n@ccValueProperty(\"supportedKeypadModes\", UserCodeCCValues.supportedKeypadModes)\n@ccValueProperty(\"supportedASCIIChars\", UserCodeCCValues.supportedASCIIChars)\nexport class UserCodeCCCapabilitiesReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCCapabilitiesReportOptions>) {\n super(options);\n this.supportsAdminCode = options.supportsAdminCode;\n this.supportsAdminCodeDeactivation =\n options.supportsAdminCodeDeactivation;\n this.supportsUserCodeChecksum = options.supportsUserCodeChecksum;\n this.supportsMultipleUserCodeReport =\n options.supportsMultipleUserCodeReport;\n this.supportsMultipleUserCodeSet = options.supportsMultipleUserCodeSet;\n this.supportedUserIDStatuses = options.supportedUserIDStatuses;\n this.supportedKeypadModes = options.supportedKeypadModes;\n this.supportedASCIIChars = options.supportedASCIIChars;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCCapabilitiesReport {\n let offset = 0;\n validatePayload(raw.payload.length >= offset + 1);\n const supportsAdminCode = !!(raw.payload[offset] & 128);\n const supportsAdminCodeDeactivation = !!(raw.payload[offset] & 64);\n const statusBitMaskLength = raw.payload[offset] & 31;\n offset += 1;\n validatePayload(raw.payload.length >= offset + statusBitMaskLength + 1);\n const supportedUserIDStatuses: UserIDStatus[] = parseBitMask(raw.payload.subarray(offset, offset + statusBitMaskLength), UserIDStatus.Available);\n offset += statusBitMaskLength;\n const supportsUserCodeChecksum = !!(raw.payload[offset] & 128);\n const supportsMultipleUserCodeReport = !!(raw.payload[offset] & 64);\n const supportsMultipleUserCodeSet = !!(raw.payload[offset] & 32);\n const keypadModesBitMaskLength = raw.payload[offset] & 31;\n offset += 1;\n validatePayload(raw.payload.length >= offset + keypadModesBitMaskLength + 1);\n const supportedKeypadModes: KeypadMode[] = parseBitMask(raw.payload.subarray(offset, offset + keypadModesBitMaskLength), KeypadMode.Normal);\n offset += keypadModesBitMaskLength;\n const keysBitMaskLength = raw.payload[offset] & 31;\n offset += 1;\n validatePayload(raw.payload.length >= offset + keysBitMaskLength);\n const supportedASCIIChars = Bytes.from(parseBitMask(raw.payload.subarray(offset, offset + keysBitMaskLength), 0)).toString(\"ascii\");\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsAdminCode,\n supportsAdminCodeDeactivation,\n supportedUserIDStatuses,\n supportsUserCodeChecksum,\n supportsMultipleUserCodeReport,\n supportsMultipleUserCodeSet,\n supportedKeypadModes,\n supportedASCIIChars,\n });\n }\n public readonly supportsAdminCode: boolean;\n public readonly supportsAdminCodeDeactivation: boolean;\n public readonly supportsUserCodeChecksum: boolean;\n public readonly supportsMultipleUserCodeReport: boolean;\n public readonly supportsMultipleUserCodeSet: boolean;\n public readonly supportedUserIDStatuses: readonly UserIDStatus[];\n public readonly supportedKeypadModes: readonly KeypadMode[];\n public readonly supportedASCIIChars: string;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const supportedStatusesBitmask = encodeBitMask(this.supportedUserIDStatuses, undefined, UserIDStatus.Available);\n const controlByte1 = (this.supportsAdminCode ? 128 : 0)\n | (this.supportsAdminCodeDeactivation ? 64 : 0)\n | (supportedStatusesBitmask.length & 31);\n const supportedKeypadModesBitmask = encodeBitMask(this.supportedKeypadModes, undefined, KeypadMode.Normal);\n const controlByte2 = (this.supportsUserCodeChecksum ? 128 : 0)\n | (this.supportsMultipleUserCodeReport ? 64 : 0)\n | (this.supportsMultipleUserCodeSet ? 32 : 0)\n | (supportedKeypadModesBitmask.length & 31);\n const keysAsNumbers = this.supportedASCIIChars.split(\"\").map((char) => char.charCodeAt(0));\n const supportedKeysBitmask = encodeBitMask(keysAsNumbers, undefined, 0);\n const controlByte3 = supportedKeysBitmask.length & 31;\n this.payload = Bytes.concat([\n [controlByte1],\n supportedStatusesBitmask,\n [controlByte2],\n supportedKeypadModesBitmask,\n [controlByte3],\n supportedKeysBitmask,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports admin code\": this.supportsAdminCode,\n \"supports admin code deactivation\": this.supportsAdminCodeDeactivation,\n \"supports user code checksum\": this.supportsUserCodeChecksum,\n \"supports multiple codes in report\": this.supportsMultipleUserCodeReport,\n \"supports multiple codes in set\": this.supportsMultipleUserCodeSet,\n \"supported user id statuses\": logList(this.supportedUserIDStatuses.map((status) => getEnumMemberName(UserIDStatus, status))),\n \"supported keypad modes\": logList(this.supportedKeypadModes.map((mode) => getEnumMemberName(KeypadMode, mode))),\n \"supported ASCII chars\": this.supportedASCIIChars,\n },\n };\n }\n}\n@CCCommand(UserCodeCommand.CapabilitiesGet)\n@expectedCCResponse(UserCodeCCCapabilitiesReport)\nexport class UserCodeCCCapabilitiesGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCKeypadModeSetOptions {\n keypadMode: KeypadMode;\n}\n@CCCommand(UserCodeCommand.KeypadModeSet)\n@useSupervision()\nexport class UserCodeCCKeypadModeSet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCKeypadModeSetOptions>) {\n super(options);\n this.keypadMode = options.keypadMode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCKeypadModeSet {\n validatePayload(raw.payload.length >= 1);\n const keypadMode: KeypadMode = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n keypadMode,\n });\n }\n public keypadMode: KeypadMode;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.keypadMode]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { mode: getEnumMemberName(KeypadMode, this.keypadMode) },\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCKeypadModeReportOptions {\n keypadMode: KeypadMode;\n}\n@CCCommand(UserCodeCommand.KeypadModeReport)\n@ccValueProperty(\"keypadMode\", UserCodeCCValues.keypadMode)\nexport class UserCodeCCKeypadModeReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCKeypadModeReportOptions>) {\n super(options);\n this.keypadMode = options.keypadMode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCKeypadModeReport {\n validatePayload(raw.payload.length >= 1);\n const keypadMode: KeypadMode = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n keypadMode,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Update the keypad modes metadata\n const supportedKeypadModes: KeypadMode[] = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes) ?? [this.keypadMode];\n const keypadModeValue = UserCodeCCValues.keypadMode;\n this.setMetadata(ctx, keypadModeValue, {\n ...keypadModeValue.meta,\n states: enumValuesToMetadataStates(KeypadMode, supportedKeypadModes),\n });\n return true;\n }\n public readonly keypadMode: KeypadMode;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.keypadMode]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n keypadMode: getEnumMemberName(KeypadMode, this.keypadMode),\n },\n };\n }\n}\n@CCCommand(UserCodeCommand.KeypadModeGet)\n@expectedCCResponse(UserCodeCCKeypadModeReport)\nexport class UserCodeCCKeypadModeGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCAdminCodeSetOptions {\n adminCode: string;\n}\n@CCCommand(UserCodeCommand.AdminCodeSet)\n@useSupervision()\nexport class UserCodeCCAdminCodeSet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCAdminCodeSetOptions>) {\n super(options);\n this.adminCode = options.adminCode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCAdminCodeSet {\n validatePayload(raw.payload.length >= 1);\n const codeLength = raw.payload[0] & 0b1111;\n validatePayload(raw.payload.length >= 1 + codeLength);\n const adminCode = raw.payload\n .subarray(1, 1 + codeLength)\n .toString(\"ascii\");\n return new this({\n nodeId: ctx.sourceNodeId,\n adminCode,\n });\n }\n public adminCode: string;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.adminCode.length & 0b1111],\n Bytes.from(this.adminCode, \"ascii\"),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"admin code\": userCodeToLogString(this.adminCode) },\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCAdminCodeReportOptions {\n adminCode: string;\n}\n@CCCommand(UserCodeCommand.AdminCodeReport)\n@ccValueProperty(\"adminCode\", UserCodeCCValues.adminCode)\nexport class UserCodeCCAdminCodeReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCAdminCodeReportOptions>) {\n super(options);\n this.adminCode = options.adminCode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCAdminCodeReport {\n validatePayload(raw.payload.length >= 1);\n const codeLength = raw.payload[0] & 0b1111;\n validatePayload(raw.payload.length >= 1 + codeLength);\n const adminCode = raw.payload\n .subarray(1, 1 + codeLength)\n .toString(\"ascii\");\n return new this({\n nodeId: ctx.sourceNodeId,\n adminCode,\n });\n }\n public readonly adminCode: string;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.adminCode.length & 0b1111],\n Bytes.from(this.adminCode, \"ascii\"),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"admin code\": userCodeToLogString(this.adminCode) },\n };\n }\n}\n@CCCommand(UserCodeCommand.AdminCodeGet)\n@expectedCCResponse(UserCodeCCAdminCodeReport)\nexport class UserCodeCCAdminCodeGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCUserCodeChecksumReportOptions {\n userCodeChecksum: number;\n}\n@CCCommand(UserCodeCommand.UserCodeChecksumReport)\n@ccValueProperty(\"userCodeChecksum\", UserCodeCCValues.userCodeChecksum)\nexport class UserCodeCCUserCodeChecksumReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCUserCodeChecksumReportOptions>) {\n super(options);\n this.userCodeChecksum = options.userCodeChecksum;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCUserCodeChecksumReport {\n validatePayload(raw.payload.length >= 2);\n const userCodeChecksum = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n userCodeChecksum,\n });\n }\n public readonly userCodeChecksum: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.userCodeChecksum, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"user code checksum\": num2hex(this.userCodeChecksum) },\n };\n }\n}\n@CCCommand(UserCodeCommand.UserCodeChecksumGet)\n@expectedCCResponse(UserCodeCCUserCodeChecksumReport)\nexport class UserCodeCCUserCodeChecksumGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCExtendedUserCodeSetOptions {\n userCodes: UserCodeCCSetOptions[];\n}\n// @publicAPI\nexport interface UserCode {\n userId: number;\n userIdStatus: UserIDStatus;\n userCode: string;\n}\n@CCCommand(UserCodeCommand.ExtendedUserCodeSet)\n@useSupervision()\nexport class UserCodeCCExtendedUserCodeSet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCExtendedUserCodeSetOptions>) {\n super(options);\n this.userCodes = options.userCodes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCExtendedUserCodeSet {\n validatePayload(raw.payload.length >= 1);\n const numCodes = raw.payload[0];\n let offset = 1;\n const userCodes: UserCodeCCSetOptions[] = [];\n // Parse each user code\n for (let i = 0; i < numCodes; i++) {\n validatePayload(raw.payload.length >= offset + 4);\n const userId = raw.payload.readUInt16BE(offset);\n const userIdStatus: UserIDStatus = raw.payload[offset + 2];\n const codeLength = raw.payload[offset + 3];\n validatePayload(raw.payload.length >= offset + 4 + codeLength);\n if (userIdStatus === UserIDStatus.Available) {\n userCodes.push({\n userId,\n userIdStatus,\n });\n }\n else {\n const userCodeBuffer = raw.payload.subarray(offset + 4, offset + 4 + codeLength);\n // Try to convert to string if it's printable ASCII\n const userCodeString = userCodeBuffer.toString(\"utf8\");\n const userCode = isPrintableASCII(userCodeString)\n ? userCodeString\n : userCodeBuffer;\n userCodes.push({\n userId,\n userIdStatus,\n userCode,\n } as UserCodeCCSetOptions);\n }\n offset += 4 + codeLength;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n userCodes,\n });\n }\n public userCodes: UserCodeCCSetOptions[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const userCodeBuffers = this.userCodes.map((code) => {\n const ret = Bytes.concat([\n [\n 0,\n 0,\n code.userIdStatus,\n code.userCode?.length ?? 0,\n ],\n isUint8Array(code.userCode)\n ? code.userCode\n : Bytes.from(code.userCode ?? \"\", \"ascii\"),\n ]);\n ret.writeUInt16BE(code.userId, 0);\n return ret;\n });\n this.payload = Bytes.concat([\n [this.userCodes.length],\n ...userCodeBuffers,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n for (const { userId, userIdStatus, userCode } of this.userCodes) {\n message[`code #${userId}`] = `${userCodeToLogString(userCode ?? \"\")} (status: ${getEnumMemberName(UserIDStatus, userIdStatus)})`;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCExtendedUserCodeReportOptions {\n userCodes: UserCode[];\n nextUserId: number;\n}\n@CCCommand(UserCodeCommand.ExtendedUserCodeReport)\nexport class UserCodeCCExtendedUserCodeReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCExtendedUserCodeReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.userCodes = options.userCodes;\n this.nextUserId = options.nextUserId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCExtendedUserCodeReport {\n validatePayload(raw.payload.length >= 1);\n const numCodes = raw.payload[0];\n let offset = 1;\n const userCodes: UserCode[] = [];\n // parse each user code\n for (let i = 0; i < numCodes; i++) {\n const { code, bytesRead } = parseExtendedUserCode(raw.payload.subarray(offset));\n userCodes.push(code);\n offset += bytesRead;\n }\n validatePayload(raw.payload.length >= offset + 2);\n const nextUserId = raw.payload.readUInt16BE(offset);\n return new this({\n nodeId: ctx.sourceNodeId,\n userCodes,\n nextUserId,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n for (const { userId, userIdStatus, userCode } of this.userCodes) {\n persistUserCode.call(this, ctx, userId, userIdStatus, userCode);\n }\n return true;\n }\n public readonly userCodes: readonly UserCode[];\n public readonly nextUserId: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n for (const { userId, userIdStatus, userCode } of this.userCodes) {\n message[`code #${userId}`] = `${userCodeToLogString(userCode)} (status: ${getEnumMemberName(UserIDStatus, userIdStatus)})`;\n }\n message[\"next user id\"] = this.nextUserId;\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCExtendedUserCodeGetOptions {\n userId: number;\n reportMore?: boolean;\n}\n@CCCommand(UserCodeCommand.ExtendedUserCodeGet)\n@expectedCCResponse(UserCodeCCExtendedUserCodeReport)\nexport class UserCodeCCExtendedUserCodeGet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCExtendedUserCodeGetOptions>) {\n super(options);\n this.userId = options.userId;\n this.reportMore = !!options.reportMore;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): UserCodeCCExtendedUserCodeGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new UserCodeCCExtendedUserCodeGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public userId: number;\n public reportMore: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([0, 0, this.reportMore ? 1 : 0]);\n this.payload.writeUInt16BE(this.userId, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"user id\": this.userId,\n \"report more\": this.reportMore,\n },\n };\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAoY;AACpY,oBAA6J;AAC7J,iBAAuR;AACvR,0BAAyK;AACzK,oCAAiI;AAGjI,mBAA0D;AAE1D,8BAAiC;AACjC,gCAAiC;AAX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GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACT,YAAmB,SAA0D;AACzE,YAAM,OAAO;AACb,WAAK,SAAS,QAAQ;AACtB,WAAK,aAAa,CAAC,CAAC,QAAQ;IAChC;IACO,OAAO,KAAK,MAAa,MAAsB;AAElD,YAAM,IAAI,uBAAW,GAAG,KAAK,IAAI,qCAAqC,4BAAgB,8BAA8B;IAIxH;IACO;IACA;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,GAAG,GAAG,KAAK,aAAa,IAAI,CAAC,CAAC;AACzD,WAAK,QAAQ,cAAc,KAAK,QAAQ,CAAC;AACzC,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,WAAW,KAAK;UAChB,eAAe,KAAK;;;IAGhC;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./UserCodeCC._validateArgs.js\";\nconst { validateArgs_UserCodeCCAPI_get, validateArgs_UserCodeCCAPI_set, validateArgs_UserCodeCCAPI_setMany, validateArgs_UserCodeCCAPI_clear, validateArgs_UserCodeCCAPI_setKeypadMode, validateArgs_UserCodeCCAPI_setAdminCode } = __validateArgs;\nimport { CommandClasses, type EndpointId, type GetSupportedCCVersion, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeBitMask, enumValuesToMetadataStates, logList, parseBitMask, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, type BytesView, getEnumMemberName, isPrintableASCII, isPrintableASCIIWithWhitespace, isUint8Array, num2hex, pick, uint8ArrayToString, } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport type { NotificationEventPayload } from \"../lib/NotificationEventPayload.js\";\nimport { V } from \"../lib/Values.js\";\nimport { KeypadMode, UserCodeCommand, UserIDStatus } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { UserCredentialCC } from \"./UserCredentialCC.js\";\nimport { UserCodeCCValues } from \"./_CCValues.generated.js\";\nexport { UserCodeCCValues };\nfunction parseExtendedUserCode(payload: Bytes): {\n code: UserCode;\n bytesRead: number;\n} {\n validatePayload(payload.length >= 4);\n const userId = payload.readUInt16BE(0);\n const status: UserIDStatus = payload[2];\n const codeLength = payload[3] & 0b1111;\n validatePayload(payload.length >= 4 + codeLength);\n const code = payload.subarray(4, 4 + codeLength).toString(\"ascii\");\n return {\n code: {\n userId,\n userIdStatus: status,\n userCode: code,\n },\n bytesRead: 4 + codeLength,\n };\n}\nfunction validateCode(code: string, supportedChars: string): boolean {\n if (code.length < 4 || code.length > 10)\n return false;\n return code.split(\"\").every((char) => supportedChars.includes(char));\n}\nfunction setUserCodeMetadata(this: UserCodeCC, ctx: GetValueDB & GetSupportedCCVersion, userId: number, userCode?: string | BytesView) {\n const statusValue = UserCodeCCValues.userIdStatus(userId);\n const codeValue = UserCodeCCValues.userCode(userId);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n const supportedUserIDStatuses: UserIDStatus[] = this.getValue(ctx, UserCodeCCValues.supportedUserIDStatuses)\n ?? (ccVersion === 1\n ? [\n UserIDStatus.Available,\n UserIDStatus.Enabled,\n UserIDStatus.Disabled,\n ]\n : [\n UserIDStatus.Available,\n UserIDStatus.Enabled,\n UserIDStatus.Disabled,\n UserIDStatus.Messaging,\n UserIDStatus.PassageMode,\n ]);\n this.ensureMetadata(ctx, statusValue, {\n ...statusValue.meta,\n states: enumValuesToMetadataStates(UserIDStatus, supportedUserIDStatuses),\n });\n const codeMetadata: ValueMetadata = {\n ...(isUint8Array(userCode)\n ? ValueMetadata.Buffer\n : ValueMetadata.String),\n minLength: 4,\n maxLength: 10,\n label: `User Code (${userId})`,\n };\n if (this.getMetadata(ctx, codeValue)?.type !== codeMetadata.type) {\n this.setMetadata(ctx, codeValue, codeMetadata);\n }\n}\nfunction persistUserCode(this: UserCodeCC, ctx: GetValueDB & GetSupportedCCVersion, userId: number, userIdStatus: UserIDStatus, userCode: string | Bytes) {\n const statusValue = UserCodeCCValues.userIdStatus(userId);\n const codeValue = UserCodeCCValues.userCode(userId);\n // Check if this code is supported\n if (userIdStatus === UserIDStatus.StatusNotAvailable) {\n // It is not, remove all values if any exist\n this.removeValue(ctx, statusValue);\n this.removeValue(ctx, codeValue);\n this.removeMetadata(ctx, statusValue);\n this.removeMetadata(ctx, codeValue);\n }\n else {\n // Always create metadata in case it does not exist\n setUserCodeMetadata.call(this, ctx, userId, userCode);\n this.setValue(ctx, statusValue, userIdStatus);\n this.setValue(ctx, codeValue, userCode);\n }\n return true;\n}\n/** Formats a user code in a way that's safe to print in public logs */\nexport function userCodeToLogString(userCode: string | BytesView): string {\n if (userCode.length === 0)\n return \"(empty)\";\n return \"*\".repeat(userCode.length);\n}\n@API(CommandClasses[\"User Code\"])\nexport class UserCodeCCAPI extends PhysicalCCAPI {\n public supportsCommand(cmd: UserCodeCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case UserCodeCommand.Get:\n case UserCodeCommand.Set:\n case UserCodeCommand.UsersNumberGet:\n return true; // This is mandatory\n case UserCodeCommand.CapabilitiesGet:\n case UserCodeCommand.KeypadModeSet:\n case UserCodeCommand.KeypadModeGet:\n case UserCodeCommand.ExtendedUserCodeSet:\n case UserCodeCommand.ExtendedUserCodeGet:\n return this.version >= 2;\n case UserCodeCommand.AdminCodeSet:\n case UserCodeCommand.AdminCodeGet: {\n if (this.version < 2)\n return false;\n return this.tryGetValueDB()?.getValue<boolean>(UserCodeCCValues.supportsAdminCode.endpoint(this.endpoint.index));\n }\n case UserCodeCommand.UserCodeChecksumGet: {\n if (this.version < 2)\n return false;\n return this.tryGetValueDB()?.getValue<boolean>(UserCodeCCValues.supportsUserCodeChecksum.endpoint(this.endpoint.index));\n }\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: UserCodeCCAPI, { property, propertyKey }, value) {\n let result: SupervisionResult | undefined;\n if (property === \"keypadMode\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n result = await this.setKeypadMode(value);\n }\n else if (property === \"adminCode\"\n // Support devices that were interviewed before the rename to adminCode\n || property === \"masterCode\") {\n if (typeof value !== \"string\") {\n throwWrongValueType(this.ccId, property, \"string\", typeof value);\n }\n result = await this.setAdminCode(value);\n }\n else if (property === \"userIdStatus\") {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n if (value === UserIDStatus.Available) {\n // Clear Code\n result = await this.clear(propertyKey);\n }\n else {\n // We need to set the user code along with the status\n const userCode = this.getValueDB().getValue<string>(UserCodeCCValues.userCode(propertyKey).endpoint(this.endpoint.index));\n result = await this.set(propertyKey, value, userCode!);\n }\n }\n else if (property === \"userCode\") {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (typeof value !== \"string\" && !isUint8Array(value)) {\n throwWrongValueType(this.ccId, property, \"string or Buffer\", typeof value);\n }\n // We need to set the user id status along with the code\n let userIdStatus = this.getValueDB().getValue<UserIDStatus>(UserCodeCCValues.userIdStatus(propertyKey).endpoint(this.endpoint.index));\n if (userIdStatus === UserIDStatus.Available\n || userIdStatus == undefined) {\n userIdStatus = UserIDStatus.Enabled;\n }\n result = await this.set(propertyKey, userIdStatus as any, value);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n return result;\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property, propertyKey }, value) => {\n const valueId = {\n commandClass: this.ccId,\n endpoint: this.endpoint.index,\n property,\n propertyKey,\n };\n if (UserCodeCCValues.keypadMode.is(valueId)\n || UserCodeCCValues.adminCode.is(valueId)\n // Support devices that were interviewed before the rename to adminCode\n || UserCodeCCValues._deprecated_masterCode.is(valueId)) {\n // Keypad mode, admin/master code should update immediately.\n // Optimistically update when supervised successfully, otherwise verify\n // For the deprecated masterCode, the canonical target is adminCode\n return {\n forceVerifyChanges: () => true,\n verifyChanges: (result) => {\n if (supervisedCommandSucceeded(result)) {\n this.tryGetValueDB()?.setValue(valueId, value);\n }\n else if (this.isSinglecast()) {\n this.schedulePoll(valueId, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n else if (UserCodeCCValues.userCode.is(valueId)\n || UserCodeCCValues.userIdStatus.is(valueId)) {\n // Simply verify the change in any case\n return {\n forceVerifyChanges: () => true,\n verifyChanges: (_result) => {\n if (this.isSinglecast()) {\n this.schedulePoll(valueId, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n };\n public isSetValueOptimistic(_valueId: ValueID): boolean {\n return false; // Always verify changes, do not assume changes were applied\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: UserCodeCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"keypadMode\":\n return this.getKeypadMode();\n case \"adminCode\":\n return this.getAdminCode();\n case \"userIdStatus\":\n case \"userCode\": {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return (await this.get(propertyKey))?.[property];\n }\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n public async getUsersCount(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.UsersNumberGet);\n const cc = new UserCodeCCUsersNumberGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCUsersNumberReport>(cc, this.commandOptions);\n return response?.supportedUsers;\n }\n public async get(userId: number, multiple?: false): Promise<MaybeNotKnown<Pick<UserCode, \"userIdStatus\" | \"userCode\">>>;\n public async get(userId: number, multiple: true): Promise<MaybeNotKnown<{\n userCodes: readonly UserCode[];\n nextUserId: number;\n }>>;\n @validateArgs_UserCodeCCAPI_get()\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get(userId: number, multiple: boolean = false) {\n if (userId > 255 || multiple) {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.ExtendedUserCodeGet);\n const cc = new UserCodeCCExtendedUserCodeGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userId,\n reportMore: multiple,\n });\n const response = await this.host.sendCommand<UserCodeCCExtendedUserCodeReport>(cc, this.commandOptions);\n if (!response) {\n return;\n }\n else if (multiple) {\n return pick(response, [\"userCodes\", \"nextUserId\"]);\n }\n else {\n return pick(response.userCodes[0], [\n \"userIdStatus\",\n \"userCode\",\n ]);\n }\n }\n else {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Get);\n const cc = new UserCodeCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userId,\n });\n const response = await this.host.sendCommand<UserCodeCCReport>(cc, this.commandOptions);\n if (response)\n return pick(response, [\"userIdStatus\", \"userCode\"]);\n }\n }\n /** Configures a single user code */\n @validateArgs_UserCodeCCAPI_set()\n public async set(userId: number, userIdStatus: Exclude<UserIDStatus, UserIDStatus.Available | UserIDStatus.StatusNotAvailable>, userCode: string | BytesView): Promise<SupervisionResult | undefined> {\n // CL:0063.01.31.02.1: V2+ nodes must use Extended User Code Set\n if (this.version >= 2 || userId > 255) {\n return this.setMany([{ userId, userIdStatus, userCode }]);\n }\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Set);\n const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);\n if (numUsers != undefined && userId > numUsers) {\n throw new ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new UserCodeCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userId,\n userIdStatus,\n userCode,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /** Configures multiple user codes */\n @validateArgs_UserCodeCCAPI_setMany()\n public async setMany(codes: UserCodeCCSetOptions[]): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.ExtendedUserCodeSet);\n const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);\n const supportedStatuses = UserCodeCC.getSupportedUserIDStatusesCached(this.host, this.endpoint);\n const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);\n const supportsMultipleUserCodeSet = UserCodeCC.supportsMultipleUserCodeSetCached(this.host, this.endpoint) ?? false;\n // Validate options\n if (numUsers != undefined) {\n if (codes.some((code) => code.userId < 0 || code.userId > numUsers)) {\n throw new ZWaveError(`All User IDs must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n else {\n if (codes.some((code) => code.userId < 0)) {\n throw new ZWaveError(`All User IDs must be greater than 0.`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n if (codes.some((code) => code.userId === 0) && codes.length > 1) {\n throw new ZWaveError(`If user ID 0 is used, only one code may be set`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (codes.some((code) => code.userId === 0\n && code.userIdStatus !== UserIDStatus.Available)) {\n throw new ZWaveError(`User ID 0 may only be used to clear all user codes`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (codes.length > 1 && !supportsMultipleUserCodeSet) {\n throw new ZWaveError(`The node does not support setting multiple user codes at once`, ZWaveErrorCodes.Argument_Invalid);\n }\n for (const code of codes) {\n if (supportedStatuses != undefined\n && !supportedStatuses.includes(code.userIdStatus)) {\n throw new ZWaveError(`The user ID status ${getEnumMemberName(UserIDStatus, code.userIdStatus)} is not supported by the node`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (code.userIdStatus === UserIDStatus.Available) {\n code.userCode = undefined;\n }\n else if (supportedASCIIChars) {\n const userCodeString = typeof code.userCode === \"string\"\n ? code.userCode\n : uint8ArrayToString(code.userCode);\n if (!validateCode(userCodeString, supportedASCIIChars)) {\n throw new ZWaveError(`The user code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n }\n const cc = new UserCodeCCExtendedUserCodeSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userCodes: codes,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Clears one or all user code\n * @param userId The user code to clear. If none or 0 is given, all codes are cleared\n */\n @validateArgs_UserCodeCCAPI_clear()\n public async clear(userId: number = 0): Promise<SupervisionResult | undefined> {\n // CL:0063.01.31.02.1: V2+ nodes must use Extended User Code Set\n if (this.version >= 2 || userId > 255) {\n return this.setMany([\n { userId, userIdStatus: UserIDStatus.Available },\n ]);\n }\n else {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Set);\n const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);\n if (numUsers != undefined && userId > numUsers) {\n throw new ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new UserCodeCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n userId,\n userIdStatus: UserIDStatus.Available,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getCapabilities() {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.CapabilitiesGet);\n const cc = new UserCodeCCCapabilitiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCCapabilitiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsAdminCode\",\n \"supportsAdminCodeDeactivation\",\n \"supportsUserCodeChecksum\",\n \"supportsMultipleUserCodeReport\",\n \"supportsMultipleUserCodeSet\",\n \"supportedUserIDStatuses\",\n \"supportedKeypadModes\",\n \"supportedASCIIChars\",\n ]);\n }\n }\n public async getKeypadMode(): Promise<MaybeNotKnown<KeypadMode>> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.KeypadModeGet);\n const cc = new UserCodeCCKeypadModeGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCKeypadModeReport>(cc, this.commandOptions);\n return response?.keypadMode;\n }\n @validateArgs_UserCodeCCAPI_setKeypadMode()\n public async setKeypadMode(keypadMode: KeypadMode): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.KeypadModeSet);\n const supportedModes = UserCodeCC.getSupportedKeypadModesCached(this.host, this.endpoint);\n if (!supportedModes) {\n throw new ZWaveError(`The keypad mode can only be set after the interview is complete!`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (!supportedModes.includes(keypadMode)) {\n throw new ZWaveError(`The keypad mode ${getEnumMemberName(KeypadMode, keypadMode)} is not supported by the node!`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new UserCodeCCKeypadModeSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n keypadMode,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getAdminCode(): Promise<MaybeNotKnown<string>> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.AdminCodeGet);\n const cc = new UserCodeCCAdminCodeGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCAdminCodeReport>(cc, this.commandOptions);\n return response?.adminCode;\n }\n @validateArgs_UserCodeCCAPI_setAdminCode()\n public async setAdminCode(adminCode: string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.AdminCodeSet);\n const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);\n if (!supportedASCIIChars) {\n throw new ZWaveError(`The admin code can only be set after the interview is complete!`, ZWaveErrorCodes.Argument_Invalid);\n }\n // Validate the code\n if (!adminCode) {\n const supportsDeactivation = UserCodeCC\n .supportsAdminCodeDeactivationCached(this.host, this.endpoint);\n if (!supportsDeactivation) {\n throw new ZWaveError(`The node does not support deactivating the admin code!`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n else if (!validateCode(adminCode, supportedASCIIChars)) {\n throw new ZWaveError(`The admin code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new UserCodeCCAdminCodeSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n adminCode,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getUserCodeChecksum(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.UserCodeChecksumGet);\n const cc = new UserCodeCCUserCodeChecksumGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<UserCodeCCUserCodeChecksumReport>(cc, this.commandOptions);\n return response?.userCodeChecksum;\n }\n}\n@commandClass(CommandClasses[\"User Code\"])\n@implementedVersion(2)\n@ccValues(UserCodeCCValues)\nexport class UserCodeCC extends CommandClass {\n declare ccCommand: UserCodeCommand;\n public determineRequiredCCInterviews(): readonly CommandClasses[] {\n return [\n ...super.determineRequiredCCInterviews(),\n // CL:0083.01.21.00.2 ff: The controlling node MUST only use ONE of\n // the User Management Command Classes to control a supporting node,\n // and cache which User Management CC is used for each node.\n //\n // We determine this by interviewing U3C first, and then optionally\n // User Code CC.\n CommandClasses[\"User Credential\"],\n ];\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n // CL:0083.01.21.00.6: A controlling node MUST NOT control the User\n // Code on a supporting node that otherwise supports User Credential\n // unless no Users are currently supported on the supporting node.\n if (endpoint.supportsCC(CommandClasses[\"User Credential\"])) {\n const u3cUsers = UserCredentialCC.getSupportedUsersCached(ctx, endpoint);\n if (u3cUsers == undefined) {\n // The U3C interview may have timed out - proceed with the User Code CC interview\n // so credential management still works\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Could not determine if the node uses User Credential CC for user management, continuing with User Code CC interview...\",\n level: \"warn\",\n });\n }\n else if (u3cUsers > 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Node uses User Credential CC for user management, skipping User Code CC interview...\",\n direction: \"none\",\n });\n this.setInterviewComplete(ctx, true);\n return;\n }\n }\n const api = CCAPI.create(CommandClasses[\"User Code\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // Query capabilities first to determine what needs to be done when refreshing\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n message: \"querying capabilities...\",\n direction: \"outbound\",\n });\n const caps = await api.getCapabilities();\n if (!caps) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"User Code capabilities query timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n }\n ctx.logNode(node.id, {\n message: \"querying number of user codes...\",\n direction: \"outbound\",\n });\n const supportedUsers = await api.getUsersCount();\n if (supportedUsers == undefined) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying number of user codes timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n for (let userId = 1; userId <= supportedUsers; userId++) {\n setUserCodeMetadata.call(this, ctx, userId);\n }\n // Synchronize user codes and settings\n await this.refreshValues(ctx, {\n queryAllUserCodes: ctx.getInterviewOptions()?.queryAllUserCodes\n ?? false,\n onProgress: (completed, total) => node.reportInterviewProgress(completed, total),\n });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void>;\n /** @internal */\n public async refreshValues(ctx: RefreshValuesContext, options: RefreshValuesOptions & {\n queryAllUserCodes: boolean;\n }): Promise<void>;\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions & {\n queryAllUserCodes: boolean;\n }): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n // CL:0083.01.21.00.6: A controlling node MUST NOT control the User\n // Code on a supporting node that otherwise supports User Credential\n // unless no Users are currently supported on the supporting node.\n // This includes the case where that is not determined yet:\n if (endpoint.supportsCC(CommandClasses[\"User Credential\"])\n && UserCredentialCC.getSupportedUsersCached(ctx, endpoint) !== 0) {\n return;\n }\n const api = CCAPI.create(CommandClasses[\"User Code\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const { queryAllUserCodes = false } = options ?? {};\n const supportsAdminCode: boolean = UserCodeCC.supportsAdminCodeCached(ctx, endpoint);\n const supportsUserCodeChecksum: boolean = this.getValue(ctx, UserCodeCCValues.supportsUserCodeChecksum) ?? false;\n const supportedKeypadModes: readonly KeypadMode[] = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes)\n ?? [];\n const supportedUsers: number = this.getValue(ctx, UserCodeCCValues.supportedUsers) ?? 0;\n const supportsMultipleUserCodeReport = !!this.getValue(ctx, UserCodeCCValues.supportsMultipleUserCodeReport);\n // CL:0063.01.22.01.1:\n // A controlling node SHOULD NOT automatically delete any user code unless it is the initial interview\n // right after having included the supporting node in the network.\n //\n // We assume that the user wants to query all codes if they call this method directly\n // During the initial interview (node.bootstrapped === false), we either delete\n // all codes, or query them depending on the driver option.\n const userCodeAction = (!node.bootstrapped && !queryAllUserCodes)\n ? \"delete\"\n : \"query\";\n // Check for changed values and codes\n if (api.version >= 2) {\n if (supportsAdminCode) {\n ctx.logNode(node.id, {\n message: \"querying admin code...\",\n direction: \"outbound\",\n });\n await api.getAdminCode();\n }\n if (supportedKeypadModes.length > 1) {\n ctx.logNode(node.id, {\n message: \"querying active keypad mode...\",\n direction: \"outbound\",\n });\n await api.getKeypadMode();\n }\n const storedUserCodeChecksum: number = this.getValue(ctx, UserCodeCCValues.userCodeChecksum) ?? 0;\n let currentUserCodeChecksum: number | undefined = 0;\n if (supportsUserCodeChecksum) {\n ctx.logNode(node.id, {\n message: \"retrieving current user code checksum...\",\n direction: \"outbound\",\n });\n currentUserCodeChecksum = await api.getUserCodeChecksum();\n }\n // For a node controlling version 2 or newer:\n // \u2022 It is OPTIONAL to send an Extended User Code Get Command for every User Identifier to a\n // node supporting version 2 or newer if:\n // \u2013 The controlling node requested the checksum and it is set to 0, or\n // \u2013 The controlling node issues an Extended User Code Set Command (User ID = 0, User ID\n // Status = 0) to delete all user codes, or\n // \u2013 The supporting node reports that no more User Identifiers are set in the Extended User\n // Code Report Command with the Next User Identifier field.\n if (userCodeAction === \"delete\") {\n ctx.logNode(node.id, {\n message: \"Initial interview, clearing all user codes...\",\n direction: \"outbound\",\n });\n await api.clear();\n }\n else if (userCodeAction === \"query\") {\n if (!supportsUserCodeChecksum\n || currentUserCodeChecksum !== storedUserCodeChecksum) {\n ctx.logNode(node.id, {\n message: \"checksum changed or is not supported, querying all user codes...\",\n direction: \"outbound\",\n });\n if (supportsMultipleUserCodeReport) {\n // Query the user codes in bulk\n let nextUserId = 1;\n while (nextUserId > 0 && nextUserId <= supportedUsers) {\n const response = await api.get(nextUserId, true);\n options?.onProgress?.(nextUserId, supportedUsers);\n if (response) {\n nextUserId = response.nextUserId;\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Querying user code #${nextUserId} timed out, skipping the remaining interview...`,\n level: \"warn\",\n });\n break;\n }\n }\n }\n else {\n // Query one user code at a time\n for (let userId = 1; userId <= supportedUsers; userId++) {\n await api.get(userId);\n options?.onProgress?.(userId, supportedUsers);\n }\n }\n }\n }\n }\n else {\n // V1\n // \u2022 It is OPTIONAL to send a User Code Get Command for every User Identifier to a node sup-\n // porting version 1 if the controlling node issues a User Code Set Command (User ID = 0, User\n // ID Status = 0) to delete all user codes.\n if (userCodeAction === \"delete\") {\n ctx.logNode(node.id, {\n message: \"Initial interview, clearing all user codes...\",\n direction: \"outbound\",\n });\n await api.clear();\n }\n else if (userCodeAction === \"query\") {\n ctx.logNode(node.id, {\n message: \"querying all user codes...\",\n direction: \"outbound\",\n });\n for (let userId = 1; userId <= supportedUsers; userId++) {\n await api.get(userId);\n options?.onProgress?.(userId, supportedUsers);\n }\n }\n }\n }\n /**\n * Returns the number of supported users.\n * This only works AFTER the interview process\n */\n public static getSupportedUsersCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<number> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(UserCodeCCValues.supportedUsers.endpoint(endpoint.index));\n }\n /**\n * Returns the supported keypad modes.\n * This only works AFTER the interview process\n */\n public static getSupportedKeypadModesCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<KeypadMode[]> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(UserCodeCCValues.supportedKeypadModes.endpoint(endpoint.index));\n }\n /**\n * Returns the supported user ID statuses.\n * This only works AFTER the interview process\n */\n public static getSupportedUserIDStatusesCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<UserIDStatus[]> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(UserCodeCCValues.supportedUserIDStatuses.endpoint(endpoint.index));\n }\n /**\n * Returns the supported ASCII characters.\n * This only works AFTER the interview process\n */\n public static getSupportedASCIICharsCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<string> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(UserCodeCCValues.supportedASCIIChars.endpoint(endpoint.index));\n }\n /**\n * Returns whether the admin code functionality is supported.\n * This only works AFTER the interview process\n */\n public static supportsAdminCodeCached(ctx: GetValueDB, endpoint: EndpointId): boolean {\n const valueDB = ctx\n .getValueDB(endpoint.nodeId);\n return valueDB.getValue<boolean>(UserCodeCCValues.supportsAdminCode.endpoint(endpoint.index)) ?? valueDB.getValue<boolean>(UserCodeCCValues._deprecated_supportsMasterCode.endpoint(endpoint.index)) ?? false;\n }\n /**\n * Returns whether deactivating the admin code is supported.\n * This only works AFTER the interview process\n */\n public static supportsAdminCodeDeactivationCached(ctx: GetValueDB, endpoint: EndpointId): boolean {\n const valueDB = ctx\n .getValueDB(endpoint.nodeId);\n return valueDB.getValue<boolean>(UserCodeCCValues.supportsAdminCodeDeactivation.endpoint(endpoint.index)) ?? valueDB.getValue<boolean>(UserCodeCCValues._deprecated_supportsMasterCodeDeactivation\n .endpoint(endpoint.index)) ?? false;\n }\n /**\n * Returns whether setting multiple user codes at once is supported.\n * This only works AFTER the interview process\n */\n public static supportsMultipleUserCodeSetCached(ctx: GetValueDB, endpoint: EndpointId): boolean {\n return !!ctx\n .getValueDB(endpoint.nodeId)\n .getValue<boolean>(UserCodeCCValues.supportsMultipleUserCodeSet.endpoint(endpoint.index));\n }\n /**\n * Returns the current status of a user ID.\n * This only works AFTER the user IDs have been queried.\n */\n public static getUserIdStatusCached(ctx: GetValueDB, endpoint: EndpointId, userId: number): MaybeNotKnown<UserIDStatus> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue<UserIDStatus>(UserCodeCCValues.userIdStatus(userId).endpoint(endpoint.index));\n }\n /**\n * Returns the current code belonging to a user ID.\n * This only works AFTER the user IDs have been queried.\n */\n public static getUserCodeCached(ctx: GetValueDB, endpoint: EndpointId, userId: number): MaybeNotKnown<string | BytesView> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue<string | BytesView>(UserCodeCCValues.userCode(userId).endpoint(endpoint.index));\n }\n /**\n * Sets the status of a user ID in the cache.\n */\n public static setUserIdStatusCached(ctx: GetValueDB, endpoint: EndpointId, userId: number, status: UserIDStatus): void {\n ctx\n .getValueDB(endpoint.nodeId)\n .setValue(UserCodeCCValues.userIdStatus(userId).endpoint(endpoint.index), status);\n }\n /**\n * Sets the code belonging to a user ID in the cache.\n */\n public static setUserCodeCached(ctx: GetValueDB, endpoint: EndpointId, userId: number, code: string | BytesView): void {\n ctx\n .getValueDB(endpoint.nodeId)\n .setValue(UserCodeCCValues.userCode(userId).endpoint(endpoint.index), code);\n }\n}\n// @publicAPI\nexport type UserCodeCCSetOptions = {\n userId: 0;\n userIdStatus: UserIDStatus.Available;\n userCode?: undefined;\n} | {\n userId: number;\n userIdStatus: UserIDStatus.Available;\n userCode?: undefined;\n} | {\n userId: number;\n userIdStatus: Exclude<UserIDStatus, UserIDStatus.Available | UserIDStatus.StatusNotAvailable>;\n userCode: string | BytesView;\n};\n@CCCommand(UserCodeCommand.Set)\n@useSupervision()\nexport class UserCodeCCSet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCSetOptions>) {\n super(options);\n this.userId = options.userId;\n this.userIdStatus = options.userIdStatus;\n // Validate options\n if (this.userId < 0) {\n throw new ZWaveError(`${this.constructor.name}: The user ID must be between greater than 0.`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (this.userId === 0\n && this.userIdStatus !== UserIDStatus.Available) {\n throw new ZWaveError(`${this.constructor.name}: User ID 0 may only be used to clear all user codes`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (this.userIdStatus === UserIDStatus.Available) {\n this.userCode = \"\\0\".repeat(4);\n }\n else {\n this.userCode = options.userCode!;\n // Specs say ASCII 0-9, manufacturers don't care :)\n if (this.userCode.length < 4 || this.userCode.length > 10) {\n throw new ZWaveError(`${this.constructor.name}: The user code must have a length of 4 to 10 ${typeof this.userCode === \"string\"\n ? \"characters\"\n : \"bytes\"}`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCSet {\n validatePayload(raw.payload.length >= 2);\n const userId = raw.payload[0];\n const userIdStatus: UserIDStatus = raw.payload[1];\n if (userIdStatus === UserIDStatus.StatusNotAvailable) {\n validatePayload.fail(\"Invalid user ID status\");\n }\n if (userIdStatus === UserIDStatus.Available) {\n return new this({\n nodeId: ctx.sourceNodeId,\n userId,\n userIdStatus,\n });\n }\n const userCode = raw.payload.subarray(2);\n return new this({\n nodeId: ctx.sourceNodeId,\n userId,\n userIdStatus,\n userCode,\n });\n }\n public userId: number;\n public userIdStatus: UserIDStatus;\n public userCode: string | BytesView;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.userId, this.userIdStatus],\n typeof this.userCode === \"string\"\n ? Bytes.from(this.userCode, \"ascii\")\n : this.userCode,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"user id\": this.userId,\n \"id status\": getEnumMemberName(UserIDStatus, this.userIdStatus),\n \"user code\": userCodeToLogString(this.userCode),\n },\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCReportOptions {\n userId: number;\n userIdStatus: UserIDStatus;\n userCode?: string | Bytes;\n}\n@CCCommand(UserCodeCommand.Report)\nexport class UserCodeCCReport extends UserCodeCC implements NotificationEventPayload {\n public constructor(options: WithAddress<UserCodeCCReportOptions>) {\n super(options);\n this.userId = options.userId;\n this.userIdStatus = options.userIdStatus;\n this.userCode = options.userCode ?? \"\";\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCReport {\n validatePayload(raw.payload.length >= 2);\n const userId = raw.payload[0];\n const userIdStatus: UserIDStatus = raw.payload[1];\n let userCode: string | Bytes;\n if (raw.payload.length === 2\n && (userIdStatus === UserIDStatus.Available\n || userIdStatus === UserIDStatus.StatusNotAvailable)) {\n // The user code is not set or not available and this report contains no user code\n userCode = \"\";\n }\n else {\n // The specs require the user code to be at least 4 digits\n validatePayload(raw.payload.length >= 6);\n let userCodeBuffer = raw.payload.subarray(2);\n // Specs say infer user code from payload length, manufacturers send zero-padded strings\n while (userCodeBuffer.at(-1) === 0) {\n userCodeBuffer = userCodeBuffer.subarray(0, -1);\n }\n // Specs say ASCII 0-9, manufacturers don't care :)\n // Thus we check if the code is printable using ASCII, if not keep it as a Buffer\n const userCodeString = userCodeBuffer.toString(\"utf8\");\n if (isPrintableASCII(userCodeString)) {\n userCode = userCodeString;\n }\n else if (isPrintableASCIIWithWhitespace(userCodeString)) {\n // Ignore leading and trailing whitespace in V1 reports if the rest is ASCII\n userCode = userCodeString.trim();\n }\n else {\n userCode = userCodeBuffer;\n }\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n userId,\n userIdStatus,\n userCode,\n });\n }\n public readonly userId: number;\n public readonly userIdStatus: UserIDStatus;\n public readonly userCode: string | Bytes;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n persistUserCode.call(this, ctx, this.userId, this.userIdStatus, this.userCode);\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n let userCodeBuffer: Bytes;\n if (typeof this.userCode === \"string\") {\n userCodeBuffer = Bytes.from(this.userCode, \"ascii\");\n }\n else {\n userCodeBuffer = this.userCode;\n }\n this.payload = Bytes.concat([\n [this.userId, this.userIdStatus],\n userCodeBuffer,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"user id\": this.userId,\n \"id status\": getEnumMemberName(UserIDStatus, this.userIdStatus),\n \"user code\": userCodeToLogString(this.userCode),\n },\n };\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public toNotificationEventParameters() {\n return { userId: this.userId };\n }\n}\n// @publicAPI\nexport interface UserCodeCCGetOptions {\n userId: number;\n}\n@CCCommand(UserCodeCommand.Get)\n@expectedCCResponse(UserCodeCCReport)\nexport class UserCodeCCGet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCGetOptions>) {\n super(options);\n this.userId = options.userId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCGet {\n validatePayload(raw.payload.length >= 1);\n const userId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n userId,\n });\n }\n public userId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.userId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"user id\": this.userId },\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCUsersNumberReportOptions {\n supportedUsers: number;\n}\n@CCCommand(UserCodeCommand.UsersNumberReport)\n@ccValueProperty(\"supportedUsers\", UserCodeCCValues.supportedUsers)\nexport class UserCodeCCUsersNumberReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCUsersNumberReportOptions>) {\n super(options);\n this.supportedUsers = options.supportedUsers;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCUsersNumberReport {\n validatePayload(raw.payload.length >= 1);\n let supportedUsers;\n if (raw.payload.length >= 3) {\n // V2+\n supportedUsers = raw.payload.readUInt16BE(1);\n }\n else {\n // V1\n supportedUsers = raw.payload[0];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedUsers,\n });\n }\n public readonly supportedUsers: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(3);\n // If the node implements more than 255 users, this field MUST be set to 255\n this.payload[0] = Math.min(255, this.supportedUsers);\n this.payload.writeUInt16BE(this.supportedUsers, 1);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"supported users\": this.supportedUsers },\n };\n }\n}\n@CCCommand(UserCodeCommand.UsersNumberGet)\n@expectedCCResponse(UserCodeCCUsersNumberReport)\nexport class UserCodeCCUsersNumberGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCCapabilitiesReportOptions {\n supportsAdminCode: boolean;\n supportsAdminCodeDeactivation: boolean;\n supportsUserCodeChecksum: boolean;\n supportsMultipleUserCodeReport: boolean;\n supportsMultipleUserCodeSet: boolean;\n supportedUserIDStatuses: readonly UserIDStatus[];\n supportedKeypadModes: readonly KeypadMode[];\n supportedASCIIChars: string;\n}\n@CCCommand(UserCodeCommand.CapabilitiesReport)\n@ccValueProperty(\"supportsAdminCode\", UserCodeCCValues.supportsAdminCode)\n@ccValueProperty(\"supportsAdminCodeDeactivation\", UserCodeCCValues.supportsAdminCodeDeactivation)\n@ccValueProperty(\"supportsUserCodeChecksum\", UserCodeCCValues.supportsUserCodeChecksum)\n@ccValueProperty(\"supportsMultipleUserCodeReport\", UserCodeCCValues.supportsMultipleUserCodeReport)\n@ccValueProperty(\"supportsMultipleUserCodeSet\", UserCodeCCValues.supportsMultipleUserCodeSet)\n@ccValueProperty(\"supportedUserIDStatuses\", UserCodeCCValues.supportedUserIDStatuses)\n@ccValueProperty(\"supportedKeypadModes\", UserCodeCCValues.supportedKeypadModes)\n@ccValueProperty(\"supportedASCIIChars\", UserCodeCCValues.supportedASCIIChars)\nexport class UserCodeCCCapabilitiesReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCCapabilitiesReportOptions>) {\n super(options);\n this.supportsAdminCode = options.supportsAdminCode;\n this.supportsAdminCodeDeactivation =\n options.supportsAdminCodeDeactivation;\n this.supportsUserCodeChecksum = options.supportsUserCodeChecksum;\n this.supportsMultipleUserCodeReport =\n options.supportsMultipleUserCodeReport;\n this.supportsMultipleUserCodeSet = options.supportsMultipleUserCodeSet;\n this.supportedUserIDStatuses = options.supportedUserIDStatuses;\n this.supportedKeypadModes = options.supportedKeypadModes;\n this.supportedASCIIChars = options.supportedASCIIChars;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCCapabilitiesReport {\n let offset = 0;\n validatePayload(raw.payload.length >= offset + 1);\n const supportsAdminCode = !!(raw.payload[offset] & 128);\n const supportsAdminCodeDeactivation = !!(raw.payload[offset] & 64);\n const statusBitMaskLength = raw.payload[offset] & 31;\n offset += 1;\n validatePayload(raw.payload.length >= offset + statusBitMaskLength + 1);\n const supportedUserIDStatuses: UserIDStatus[] = parseBitMask(raw.payload.subarray(offset, offset + statusBitMaskLength), UserIDStatus.Available);\n offset += statusBitMaskLength;\n const supportsUserCodeChecksum = !!(raw.payload[offset] & 128);\n const supportsMultipleUserCodeReport = !!(raw.payload[offset] & 64);\n const supportsMultipleUserCodeSet = !!(raw.payload[offset] & 32);\n const keypadModesBitMaskLength = raw.payload[offset] & 31;\n offset += 1;\n validatePayload(raw.payload.length >= offset + keypadModesBitMaskLength + 1);\n const supportedKeypadModes: KeypadMode[] = parseBitMask(raw.payload.subarray(offset, offset + keypadModesBitMaskLength), KeypadMode.Normal);\n offset += keypadModesBitMaskLength;\n const keysBitMaskLength = raw.payload[offset] & 31;\n offset += 1;\n validatePayload(raw.payload.length >= offset + keysBitMaskLength);\n const supportedASCIIChars = Bytes.from(parseBitMask(raw.payload.subarray(offset, offset + keysBitMaskLength), 0)).toString(\"ascii\");\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsAdminCode,\n supportsAdminCodeDeactivation,\n supportedUserIDStatuses,\n supportsUserCodeChecksum,\n supportsMultipleUserCodeReport,\n supportsMultipleUserCodeSet,\n supportedKeypadModes,\n supportedASCIIChars,\n });\n }\n public readonly supportsAdminCode: boolean;\n public readonly supportsAdminCodeDeactivation: boolean;\n public readonly supportsUserCodeChecksum: boolean;\n public readonly supportsMultipleUserCodeReport: boolean;\n public readonly supportsMultipleUserCodeSet: boolean;\n public readonly supportedUserIDStatuses: readonly UserIDStatus[];\n public readonly supportedKeypadModes: readonly KeypadMode[];\n public readonly supportedASCIIChars: string;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const supportedStatusesBitmask = encodeBitMask(this.supportedUserIDStatuses, undefined, UserIDStatus.Available);\n const controlByte1 = (this.supportsAdminCode ? 128 : 0)\n | (this.supportsAdminCodeDeactivation ? 64 : 0)\n | (supportedStatusesBitmask.length & 31);\n const supportedKeypadModesBitmask = encodeBitMask(this.supportedKeypadModes, undefined, KeypadMode.Normal);\n const controlByte2 = (this.supportsUserCodeChecksum ? 128 : 0)\n | (this.supportsMultipleUserCodeReport ? 64 : 0)\n | (this.supportsMultipleUserCodeSet ? 32 : 0)\n | (supportedKeypadModesBitmask.length & 31);\n const keysAsNumbers = this.supportedASCIIChars.split(\"\").map((char) => char.charCodeAt(0));\n const supportedKeysBitmask = encodeBitMask(keysAsNumbers, undefined, 0);\n const controlByte3 = supportedKeysBitmask.length & 31;\n this.payload = Bytes.concat([\n [controlByte1],\n supportedStatusesBitmask,\n [controlByte2],\n supportedKeypadModesBitmask,\n [controlByte3],\n supportedKeysBitmask,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports admin code\": this.supportsAdminCode,\n \"supports admin code deactivation\": this.supportsAdminCodeDeactivation,\n \"supports user code checksum\": this.supportsUserCodeChecksum,\n \"supports multiple codes in report\": this.supportsMultipleUserCodeReport,\n \"supports multiple codes in set\": this.supportsMultipleUserCodeSet,\n \"supported user id statuses\": logList(this.supportedUserIDStatuses.map((status) => getEnumMemberName(UserIDStatus, status))),\n \"supported keypad modes\": logList(this.supportedKeypadModes.map((mode) => getEnumMemberName(KeypadMode, mode))),\n \"supported ASCII chars\": this.supportedASCIIChars,\n },\n };\n }\n}\n@CCCommand(UserCodeCommand.CapabilitiesGet)\n@expectedCCResponse(UserCodeCCCapabilitiesReport)\nexport class UserCodeCCCapabilitiesGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCKeypadModeSetOptions {\n keypadMode: KeypadMode;\n}\n@CCCommand(UserCodeCommand.KeypadModeSet)\n@useSupervision()\nexport class UserCodeCCKeypadModeSet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCKeypadModeSetOptions>) {\n super(options);\n this.keypadMode = options.keypadMode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCKeypadModeSet {\n validatePayload(raw.payload.length >= 1);\n const keypadMode: KeypadMode = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n keypadMode,\n });\n }\n public keypadMode: KeypadMode;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.keypadMode]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { mode: getEnumMemberName(KeypadMode, this.keypadMode) },\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCKeypadModeReportOptions {\n keypadMode: KeypadMode;\n}\n@CCCommand(UserCodeCommand.KeypadModeReport)\n@ccValueProperty(\"keypadMode\", UserCodeCCValues.keypadMode)\nexport class UserCodeCCKeypadModeReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCKeypadModeReportOptions>) {\n super(options);\n this.keypadMode = options.keypadMode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCKeypadModeReport {\n validatePayload(raw.payload.length >= 1);\n const keypadMode: KeypadMode = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n keypadMode,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Update the keypad modes metadata\n const supportedKeypadModes: KeypadMode[] = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes) ?? [this.keypadMode];\n const keypadModeValue = UserCodeCCValues.keypadMode;\n this.setMetadata(ctx, keypadModeValue, {\n ...keypadModeValue.meta,\n states: enumValuesToMetadataStates(KeypadMode, supportedKeypadModes),\n });\n return true;\n }\n public readonly keypadMode: KeypadMode;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.keypadMode]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n keypadMode: getEnumMemberName(KeypadMode, this.keypadMode),\n },\n };\n }\n}\n@CCCommand(UserCodeCommand.KeypadModeGet)\n@expectedCCResponse(UserCodeCCKeypadModeReport)\nexport class UserCodeCCKeypadModeGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCAdminCodeSetOptions {\n adminCode: string;\n}\n@CCCommand(UserCodeCommand.AdminCodeSet)\n@useSupervision()\nexport class UserCodeCCAdminCodeSet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCAdminCodeSetOptions>) {\n super(options);\n this.adminCode = options.adminCode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCAdminCodeSet {\n validatePayload(raw.payload.length >= 1);\n const codeLength = raw.payload[0] & 0b1111;\n validatePayload(raw.payload.length >= 1 + codeLength);\n const adminCode = raw.payload\n .subarray(1, 1 + codeLength)\n .toString(\"ascii\");\n return new this({\n nodeId: ctx.sourceNodeId,\n adminCode,\n });\n }\n public adminCode: string;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.adminCode.length & 0b1111],\n Bytes.from(this.adminCode, \"ascii\"),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"admin code\": userCodeToLogString(this.adminCode) },\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCAdminCodeReportOptions {\n adminCode: string;\n}\n@CCCommand(UserCodeCommand.AdminCodeReport)\n@ccValueProperty(\"adminCode\", UserCodeCCValues.adminCode)\nexport class UserCodeCCAdminCodeReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCAdminCodeReportOptions>) {\n super(options);\n this.adminCode = options.adminCode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCAdminCodeReport {\n validatePayload(raw.payload.length >= 1);\n const codeLength = raw.payload[0] & 0b1111;\n validatePayload(raw.payload.length >= 1 + codeLength);\n const adminCode = raw.payload\n .subarray(1, 1 + codeLength)\n .toString(\"ascii\");\n return new this({\n nodeId: ctx.sourceNodeId,\n adminCode,\n });\n }\n public readonly adminCode: string;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.adminCode.length & 0b1111],\n Bytes.from(this.adminCode, \"ascii\"),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"admin code\": userCodeToLogString(this.adminCode) },\n };\n }\n}\n@CCCommand(UserCodeCommand.AdminCodeGet)\n@expectedCCResponse(UserCodeCCAdminCodeReport)\nexport class UserCodeCCAdminCodeGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCUserCodeChecksumReportOptions {\n userCodeChecksum: number;\n}\n@CCCommand(UserCodeCommand.UserCodeChecksumReport)\n@ccValueProperty(\"userCodeChecksum\", UserCodeCCValues.userCodeChecksum)\nexport class UserCodeCCUserCodeChecksumReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCUserCodeChecksumReportOptions>) {\n super(options);\n this.userCodeChecksum = options.userCodeChecksum;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCUserCodeChecksumReport {\n validatePayload(raw.payload.length >= 2);\n const userCodeChecksum = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n userCodeChecksum,\n });\n }\n public readonly userCodeChecksum: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.userCodeChecksum, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"user code checksum\": num2hex(this.userCodeChecksum) },\n };\n }\n}\n@CCCommand(UserCodeCommand.UserCodeChecksumGet)\n@expectedCCResponse(UserCodeCCUserCodeChecksumReport)\nexport class UserCodeCCUserCodeChecksumGet extends UserCodeCC {\n}\n// @publicAPI\nexport interface UserCodeCCExtendedUserCodeSetOptions {\n userCodes: UserCodeCCSetOptions[];\n}\n// @publicAPI\nexport interface UserCode {\n userId: number;\n userIdStatus: UserIDStatus;\n userCode: string;\n}\n@CCCommand(UserCodeCommand.ExtendedUserCodeSet)\n@useSupervision()\nexport class UserCodeCCExtendedUserCodeSet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCExtendedUserCodeSetOptions>) {\n super(options);\n this.userCodes = options.userCodes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCExtendedUserCodeSet {\n validatePayload(raw.payload.length >= 1);\n const numCodes = raw.payload[0];\n let offset = 1;\n const userCodes: UserCodeCCSetOptions[] = [];\n // Parse each user code\n for (let i = 0; i < numCodes; i++) {\n validatePayload(raw.payload.length >= offset + 4);\n const userId = raw.payload.readUInt16BE(offset);\n const userIdStatus: UserIDStatus = raw.payload[offset + 2];\n const codeLength = raw.payload[offset + 3];\n validatePayload(raw.payload.length >= offset + 4 + codeLength);\n if (userIdStatus === UserIDStatus.Available) {\n userCodes.push({\n userId,\n userIdStatus,\n });\n }\n else {\n const userCodeBuffer = raw.payload.subarray(offset + 4, offset + 4 + codeLength);\n // Try to convert to string if it's printable ASCII\n const userCodeString = userCodeBuffer.toString(\"utf8\");\n const userCode = isPrintableASCII(userCodeString)\n ? userCodeString\n : userCodeBuffer;\n userCodes.push({\n userId,\n userIdStatus,\n userCode,\n } as UserCodeCCSetOptions);\n }\n offset += 4 + codeLength;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n userCodes,\n });\n }\n public userCodes: UserCodeCCSetOptions[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const userCodeBuffers = this.userCodes.map((code) => {\n const ret = Bytes.concat([\n [\n 0,\n 0,\n code.userIdStatus,\n code.userCode?.length ?? 0,\n ],\n isUint8Array(code.userCode)\n ? code.userCode\n : Bytes.from(code.userCode ?? \"\", \"ascii\"),\n ]);\n ret.writeUInt16BE(code.userId, 0);\n return ret;\n });\n this.payload = Bytes.concat([\n [this.userCodes.length],\n ...userCodeBuffers,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n for (const { userId, userIdStatus, userCode } of this.userCodes) {\n message[`code #${userId}`] = `${userCodeToLogString(userCode ?? \"\")} (status: ${getEnumMemberName(UserIDStatus, userIdStatus)})`;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCExtendedUserCodeReportOptions {\n userCodes: UserCode[];\n nextUserId: number;\n}\n@CCCommand(UserCodeCommand.ExtendedUserCodeReport)\nexport class UserCodeCCExtendedUserCodeReport extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCExtendedUserCodeReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.userCodes = options.userCodes;\n this.nextUserId = options.nextUserId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): UserCodeCCExtendedUserCodeReport {\n validatePayload(raw.payload.length >= 1);\n const numCodes = raw.payload[0];\n let offset = 1;\n const userCodes: UserCode[] = [];\n // parse each user code\n for (let i = 0; i < numCodes; i++) {\n const { code, bytesRead } = parseExtendedUserCode(raw.payload.subarray(offset));\n userCodes.push(code);\n offset += bytesRead;\n }\n validatePayload(raw.payload.length >= offset + 2);\n const nextUserId = raw.payload.readUInt16BE(offset);\n return new this({\n nodeId: ctx.sourceNodeId,\n userCodes,\n nextUserId,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n for (const { userId, userIdStatus, userCode } of this.userCodes) {\n persistUserCode.call(this, ctx, userId, userIdStatus, userCode);\n }\n return true;\n }\n public readonly userCodes: readonly UserCode[];\n public readonly nextUserId: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n for (const { userId, userIdStatus, userCode } of this.userCodes) {\n message[`code #${userId}`] = `${userCodeToLogString(userCode)} (status: ${getEnumMemberName(UserIDStatus, userIdStatus)})`;\n }\n message[\"next user id\"] = this.nextUserId;\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface UserCodeCCExtendedUserCodeGetOptions {\n userId: number;\n reportMore?: boolean;\n}\n@CCCommand(UserCodeCommand.ExtendedUserCodeGet)\n@expectedCCResponse(UserCodeCCExtendedUserCodeReport)\nexport class UserCodeCCExtendedUserCodeGet extends UserCodeCC {\n public constructor(options: WithAddress<UserCodeCCExtendedUserCodeGetOptions>) {\n super(options);\n this.userId = options.userId;\n this.reportMore = !!options.reportMore;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): UserCodeCCExtendedUserCodeGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new UserCodeCCExtendedUserCodeGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public userId: number;\n public reportMore: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([0, 0, this.reportMore ? 1 : 0]);\n this.payload.writeUInt16BE(this.userId, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"user id\": this.userId,\n \"report more\": this.reportMore,\n },\n };\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAoY;AACpY,oBAA6J;AAC7J,iBAAuR;AACvR,0BAAyK;AACzK,oCAAiI;AAGjI,mBAA0D;AAE1D,8BAAiC;AACjC,gCAAiC;AAXjC,MAAM,EAAE,gCAAgC,gCAAgC,oCAAoC,kCAAkC,0CAA0C,wCAAuC,IAAK;AAapO,SAAS,sBAAsB,SAAc;AAIzC,mCAAgB,QAAQ,UAAU,CAAC;AACnC,QAAM,SAAS,QAAQ,aAAa,CAAC;AACrC,QAAM,SAAuB,QAAQ,CAAC;AACtC,QAAM,aAAa,QAAQ,CAAC,IAAI;AAChC,mCAAgB,QAAQ,UAAU,IAAI,UAAU;AAChD,QAAM,OAAO,QAAQ,SAAS,GAAG,IAAI,UAAU,EAAE,SAAS,OAAO;AACjE,SAAO;IACH,MAAM;MACF;MACA,cAAc;MACd,UAAU;;IAEd,WAAW,IAAI;;AAEvB;AAlBS;AAmBT,SAAS,aAAa,MAAc,gBAAsB;AACtD,MAAI,KAAK,SAAS,KAAK,KAAK,SAAS;AACjC,WAAO;AACX,SAAO,KAAK,MAAM,EAAE,EAAE,MAAM,CAAC,SAAS,eAAe,SAAS,IAAI,CAAC;AACvE;AAJS;AAKT,SAAS,oBAAsC,KAAyC,QAAgB,UAA6B;AACjI,QAAM,cAAc,2CAAiB,aAAa,MAAM;AACxD,QAAM,YAAY,2CAAiB,SAAS,MAAM;AAClD,QAAM,gBAAY,2CAAsB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B;IACA;IACT,WAAW,KAAgB;AAC9B,YAAM,UAAyB,CAAA;AAC/B,iBAAW,EAAE,QAAQ,cAAc,SAAQ,KAAM,KAAK,WAAW;AAC7D,gBAAQ,SAAS,MAAM,EAAE,IAAI,GAAG,oBAAoB,QAAQ,CAAC,iBAAa,iCAAkB,2BAAc,YAAY,CAAC;MAC3H;AACA,cAAQ,cAAc,IAAI,KAAK;AAC/B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB;;IAER;;;;IASS,iCAA6B,MAAA;8BAFzC,yCAAU,6BAAgB,mBAAmB,OAC7C,kDAAmB,gCAAgC,CAAC;;;;oBACF;qDAAA,YAAU;WAAA;;;;;;;;AAA7D,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACT,YAAmB,SAA0D;AACzE,YAAM,OAAO;AACb,WAAK,SAAS,QAAQ;AACtB,WAAK,aAAa,CAAC,CAAC,QAAQ;IAChC;IACO,OAAO,KAAK,MAAa,MAAsB;AAElD,YAAM,IAAI,uBAAW,GAAG,KAAK,IAAI,qCAAqC,4BAAgB,8BAA8B;IAIxH;IACO;IACA;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,GAAG,GAAG,KAAK,aAAa,IAAI,CAAC,CAAC;AACzD,WAAK,QAAQ,cAAc,KAAK,QAAQ,CAAC;AACzC,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,WAAW,KAAK;UAChB,eAAe,KAAK;;;IAGhC;;;;",
6
6
  "names": ["UserCodeCC"]
7
7
  }
@@ -303,7 +303,7 @@ let MPANExtension = (() => {
303
303
  return super.serialize(moreToFollow);
304
304
  }
305
305
  toLogEntryDict() {
306
- const mpanState = process.env.NODE_ENV === "test" || process.env.NODE_ENV === "development" ? (0, import_shared.buffer2hex)(this.innerMPANState) : "(hidden)";
306
+ const mpanState = (0, import_shared.getenv)("NODE_ENV") === "test" || (0, import_shared.getenv)("NODE_ENV") === "development" ? (0, import_shared.buffer2hex)(this.innerMPANState) : "(hidden)";
307
307
  return {
308
308
  "group ID": this.groupId,
309
309
  "MPAN state": mpanState