@zwave-js/cc 15.27.1 → 15.28.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.
- package/build/cjs/cc/AssociationGroupInfoCC.js +1 -0
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.js +2 -1
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.js +5 -1
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.js +15 -4
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.js +1 -1
- package/build/cjs/cc/DoorLockCC.js.map +1 -1
- package/build/cjs/cc/IndicatorCC.js +4 -3
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.d.ts +1 -0
- package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.js +13 -0
- package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +6 -4
- package/build/cjs/cc/ManufacturerSpecificCC.js +41 -7
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.js +10 -8
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.js +2 -0
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SecurityCC.d.ts +1 -1
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.js +2 -0
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/UserCredentialCC.js +4 -0
- package/build/cjs/cc/UserCredentialCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.d.ts +2 -2
- package/build/cjs/cc/_CCValues.generated.js +1 -1
- package/build/cjs/cc/_CCValues.generated.js.map +1 -1
- package/build/cjs/lib/CommandClass.d.ts +3 -1
- package/build/cjs/lib/CommandClass.js +11 -4
- package/build/cjs/lib/CommandClass.js.map +2 -2
- package/build/cjs/lib/_Types.d.ts +4 -0
- package/build/cjs/lib/_Types.js +7 -0
- package/build/cjs/lib/_Types.js.map +3 -3
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +5 -2
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +8 -2
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +17 -4
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.js +1 -1
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +8 -4
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.d.ts +1 -0
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.js +10 -0
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +6 -4
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +54 -14
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +13 -9
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +3 -0
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +1 -1
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +3 -0
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/UserCredentialCC.d.ts.map +1 -1
- package/build/esm/cc/UserCredentialCC.js +7 -1
- package/build/esm/cc/UserCredentialCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts +2 -2
- package/build/esm/cc/_CCValues.generated.js +1 -1
- package/build/esm/lib/CommandClass.d.ts +3 -1
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +11 -4
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/_Types.d.ts +4 -0
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js +5 -0
- package/build/esm/lib/_Types.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src_gen/cc/ConfigurationCC.ts"],
|
|
4
|
-
"sourcesContent": ["import * as __validateArgs from \"./ConfigurationCC._validateArgs.js\";\nconst { validateArgs_ConfigurationCCAPI_get, validateArgs_ConfigurationCCAPI_getBulk, validateArgs_ConfigurationCCAPI_set, validateArgs_ConfigurationCCAPI_setBulk, validateArgs_ConfigurationCCAPI_reset, validateArgs_ConfigurationCCAPI_resetBulk, validateArgs_ConfigurationCCAPI_getProperties, validateArgs_ConfigurationCCAPI_getName, validateArgs_ConfigurationCCAPI_getInfo } = __validateArgs;\nimport type { GetDeviceConfig, ParamInfoMap, ParamInformation, } from \"@zwave-js/config\";\nimport { CommandClasses, ConfigValueFormat, type ConfigurationMetadata, type ControlsCC, type EndpointId, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type LogPayload, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type NodeId, type SupervisionResult, SupervisionStatus, type SupportsCC, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, encodePartial, getBitMaskWidth, getIntegerLimits, getMinIntegerSize, isConsecutiveArray, logDict, logList, logText, mergeSupervisionResults, parsePartial, stripUndefined, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, num2hex, pick } from \"@zwave-js/shared\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { CCAPI, type CCAPIEndpoint, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, 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, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type ConfigValue, ConfigurationCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nfunction configValueToString(value: ConfigValue): string {\n if (typeof value === \"number\")\n return value.toString();\n else\n return [...value].join(\", \");\n}\nexport class ConfigurationCCError extends ZWaveError {\n public constructor(public readonly message: string, public readonly code: ZWaveErrorCodes, public readonly argument: number) {\n super(message, code);\n // We need to set the prototype explicitly\n Object.setPrototypeOf(this, ConfigurationCCError.prototype);\n }\n}\nimport { ConfigurationCCValues } from \"./_CCValues.generated.js\";\nexport { ConfigurationCCValues };\n/** @publicAPI */\nexport type ConfigurationCCAPISetOptions = {\n parameter: number;\n} & ({\n // Variant 1: Normal parameter, defined in a config file\n bitMask?: undefined;\n value: ConfigValue;\n} | {\n // Variant 2: Normal parameter, not defined in a config file\n bitMask?: undefined;\n value: ConfigValue;\n valueSize: 1 | 2 | 4;\n valueFormat: ConfigValueFormat;\n} | {\n // Variant 3: Partial parameter, must be defined in a config file\n bitMask: number;\n value: number;\n});\ntype NormalizedConfigurationCCAPISetOptions = {\n parameter: number;\n valueSize: 1 | 2 | 4;\n valueFormat: ConfigValueFormat;\n} & ({\n bitMask?: undefined;\n value: ConfigValue;\n} | {\n bitMask: number;\n value: number;\n});\nfunction createConfigurationCCInstance(endpoint: CCAPIEndpoint): ConfigurationCC {\n return CommandClass.createInstanceUnchecked(endpoint.virtual ? endpoint.node.physicalNodes[0] : endpoint, ConfigurationCC)!;\n}\nfunction normalizeConfigurationCCAPISetOptions(ctx: GetValueDB, endpoint: CCAPIEndpoint, options: ConfigurationCCAPISetOptions): NormalizedConfigurationCCAPISetOptions {\n if (\"bitMask\" in options && options.bitMask) {\n // Variant 3: Partial param, look it up in the device config\n const ccc = createConfigurationCCInstance(endpoint);\n const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);\n if (!paramInfo.isFromConfig) {\n throw new ZWaveError(\"Setting a partial configuration parameter requires it to be defined in a device config file!\", ZWaveErrorCodes.Argument_Invalid);\n }\n return {\n parameter: options.parameter,\n bitMask: options.bitMask,\n value: options.value,\n valueSize: paramInfo.valueSize as any,\n valueFormat: paramInfo.format!,\n };\n }\n else if (\"valueSize\" in options) {\n // Variant 2: Normal parameter, not defined in a config file\n return pick(options, [\n \"parameter\",\n \"value\",\n \"valueSize\",\n \"valueFormat\",\n ]);\n }\n else {\n // Variant 1: Normal parameter, defined in a config file\n const ccc = createConfigurationCCInstance(endpoint);\n const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);\n if (!paramInfo.isFromConfig) {\n throw new ZWaveError(\"Setting a configuration parameter without specifying a value size and format requires it to be defined in a device config file!\", ZWaveErrorCodes.Argument_Invalid);\n }\n return {\n parameter: options.parameter,\n value: options.value,\n valueSize: paramInfo.valueSize as any,\n valueFormat: paramInfo.format!,\n };\n }\n}\nfunction bulkMergePartialParamValues(ctx: GetValueDB, endpoint: CCAPIEndpoint, options: NormalizedConfigurationCCAPISetOptions[]): (NormalizedConfigurationCCAPISetOptions & {\n bitMask?: undefined;\n})[] {\n // Merge partial parameters before doing anything else. Therefore, take the non-partials, ...\n const allParams = options.filter((o) => o.bitMask == undefined);\n // ... group the partials by parameter\n const unmergedPartials = new Map<number, NormalizedConfigurationCCAPISetOptions[]>();\n for (const partial of options.filter((o) => o.bitMask != undefined)) {\n if (!unmergedPartials.has(partial.parameter)) {\n unmergedPartials.set(partial.parameter, []);\n }\n unmergedPartials.get(partial.parameter)!.push(partial);\n }\n // and push the merged result into the array we'll be working with\n if (unmergedPartials.size) {\n const ccc = createConfigurationCCInstance(endpoint);\n for (const [parameter, partials] of unmergedPartials) {\n allParams.push({\n parameter,\n value: ccc.composePartialParamValues(ctx, parameter, partials.map((p) => ({\n bitMask: p.bitMask!,\n partialValue: p.value,\n }))),\n valueSize: partials[0].valueSize,\n valueFormat: partials[0].valueFormat,\n });\n }\n }\n return allParams as any;\n}\n/** Determines whether a partial parameter needs to be interpreted as signed */\nfunction isSignedPartial(bitMask: number, format: ConfigValueFormat | undefined): boolean {\n // Only treat partial params as signed if they span more than 1 bit.\n // Otherwise we cannot model 0/1 properly.\n return (getBitMaskWidth(bitMask) > 1\n && (format ?? ConfigValueFormat.SignedInteger)\n === ConfigValueFormat.SignedInteger);\n}\nfunction reInterpretSignedValue(value: ConfigValue, valueSize: number, targetFormat: ConfigValueFormat): ConfigValue {\n // Re-interpret the value with the new format\n const raw = new Bytes(valueSize);\n serializeValue(raw, 0, valueSize, ConfigValueFormat.SignedInteger, value);\n return parseValue(raw, valueSize, targetFormat);\n}\nfunction getParamInformationFromConfigFile(ctx: GetDeviceConfig, nodeId: number, endpointIndex: number): ParamInfoMap | undefined {\n const deviceConfig = ctx.getDeviceConfig?.(nodeId);\n if (endpointIndex === 0) {\n return (deviceConfig?.paramInformation\n ?? deviceConfig?.endpoints?.get(0)?.paramInformation);\n }\n else {\n return deviceConfig?.endpoints?.get(endpointIndex)?.paramInformation;\n }\n}\n/**\n * Returns the distinct parameter numbers in a ParamInfoMap. Partial parameters share a\n * parameter number and are collapsed to a single entry, since they are queried together.\n */\nexport function getDistinctConfigParameters(paramInfo: ParamInfoMap): number[] {\n return distinct([...paramInfo.keys()].map((key) => key.parameter));\n}\n/**\n * Returns the distinct readable (non-write-only) parameter numbers in a ParamInfoMap.\n * These are the parameters whose value is queried during the interview.\n */\nexport function getReadableConfigParameters(paramInfo: ParamInfoMap): number[] {\n return distinct([...paramInfo.keys()]\n .filter((key) => !paramInfo.get(key)?.writeOnly)\n .map((key) => key.parameter));\n}\n/**\n * Estimates the number of device queries the Configuration interview performs,\n * depending on CC versions, availability of a config files, and compat flags.\n */\nfunction estimateConfigurationInterviewQueryCount(paramInfo: ParamInfoMap | undefined, ccVersion: number, assumedParamCount: number, skipNameQuery: boolean, skipInfoQuery: boolean): number {\n if (paramInfo?.size) {\n // Before V3, only the value of each readable parameter is queried\n if (ccVersion < 3)\n return getReadableConfigParameters(paramInfo).length;\n // On V3+, the properties of every parameter are queried (including write-only\n // ones, whose value is not), plus the value of each readable parameter. Name and\n // info are skipped for parameters documented in a config file.\n return getDistinctConfigParameters(paramInfo).length\n + getReadableConfigParameters(paramInfo).length;\n }\n // Before V3, only the value of each parameter is queried\n if (ccVersion < 3)\n return assumedParamCount;\n // On V3+, we query properties + value,\n const queriesPerParam = 2\n // optionally the name\n + (skipNameQuery ? 0 : 1)\n // and optionally the description\n + (skipInfoQuery ? 0 : 1);\n return assumedParamCount * queriesPerParam;\n}\n/** Builds a ConfigurationMetadata object from a ParamInformation entry */\nfunction configParamInfoToMetadata(info: ParamInformation): ConfigurationMetadata {\n return stripUndefined({\n // TODO: Make this smarter! (0...1 ==> boolean)\n type: \"number\",\n valueSize: info.valueSize,\n min: info.minValue,\n max: info.maxValue,\n allowed: info.allowed,\n default: info.defaultValue,\n recommended: info.recommendedValue,\n unit: info.unit,\n format: info.unsigned\n ? ConfigValueFormat.UnsignedInteger\n : ConfigValueFormat.SignedInteger,\n readable: !info.writeOnly,\n writeable: !info.readOnly,\n allowManualEntry: info.allowManualEntry,\n states: info.options.length > 0\n ? Object.fromEntries(info.options.map(({ label, value }) => [\n value.toString(),\n label,\n ]))\n : undefined,\n label: info.label,\n description: info.description,\n isFromConfig: true,\n destructive: info.destructive,\n purpose: info.purpose,\n } satisfies ConfigurationMetadata) as unknown as ConfigurationMetadata;\n}\n/**\n * Refreshes all stored configuration parameter metadata from the device config file.\n * This handles updates to existing params, addition of new params,\n * and removal/hiding of old params.\n */\nexport function refreshConfigParamMetadataFromConfigFile(ctx: GetValueDB & GetDeviceConfig, nodeId: number, endpointIndex: number): void {\n const paramInfo = getParamInformationFromConfigFile(ctx, nodeId, endpointIndex);\n const valueDB = ctx.getValueDB(nodeId);\n // Track which param keys exist in the current config\n const configParamKeys = new Set<string>();\n if (paramInfo) {\n for (const [param, info] of paramInfo.entries()) {\n const paramKey = `${param.parameter}:${param.valueBitMask ?? \"\"}`;\n configParamKeys.add(paramKey);\n const valueId = ConfigurationCCValues.paramInformation(param.parameter, param.valueBitMask).endpoint(endpointIndex);\n const existing = valueDB.getMetadata(valueId) as ConfigurationMetadata | undefined;\n if (info.hidden) {\n // Param is now hidden - remove metadata and value\n if (existing) {\n valueDB.setMetadata(valueId, undefined);\n valueDB.removeValue(valueId);\n }\n continue;\n }\n const newMeta = configParamInfoToMetadata(info);\n if (!existing || existing.isFromConfig) {\n // New param, or existing parameter that was previously populated\n // from the configuration file. Replace it entirely\n valueDB.setMetadata(valueId, newMeta);\n }\n else {\n // Device-reported param - overwrite informational fields\n // but preserve the device-reported valueSize and format\n const merged: ConfigurationMetadata = {\n ...existing,\n ...newMeta,\n valueSize: existing.valueSize,\n format: existing.format,\n };\n valueDB.setMetadata(valueId, merged);\n }\n }\n }\n // Remove params that are in ValueDB with isFromConfig but no longer in config\n for (const meta of valueDB.getAllMetadata(CommandClasses.Configuration)) {\n if (typeof meta.property !== \"number\"\n || (meta.endpoint ?? 0) !== endpointIndex) {\n continue;\n }\n const existing = meta.metadata as ConfigurationMetadata;\n if (!existing.isFromConfig)\n continue;\n const paramKey = `${meta.property}:${meta.propertyKey ?? \"\"}`;\n if (!configParamKeys.has(paramKey)) {\n valueDB.setMetadata(meta, undefined);\n valueDB.removeValue(meta);\n }\n }\n}\n@API(CommandClasses.Configuration)\nexport class ConfigurationCCAPI extends CCAPI {\n public supportsCommand(cmd: ConfigurationCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ConfigurationCommand.Get:\n case ConfigurationCommand.Set:\n return true; // This is mandatory\n case ConfigurationCommand.BulkGet:\n case ConfigurationCommand.BulkSet:\n return this.version >= 2;\n case ConfigurationCommand.NameGet:\n case ConfigurationCommand.InfoGet:\n case ConfigurationCommand.PropertiesGet:\n return this.version >= 3;\n case ConfigurationCommand.DefaultReset:\n return this.version >= 4;\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ConfigurationCCAPI, { property, propertyKey }, value) {\n // Config parameters are addressed with numeric properties/keys\n if (typeof property !== \"number\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (propertyKey != undefined && 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 let ccInstance: ConfigurationCC;\n const applHost = this.host;\n if (this.isSinglecast()) {\n ccInstance = createConfigurationCCInstance(this.endpoint);\n }\n else if (this.isMulticast()) {\n // Multicast is only possible if the parameter definition is the same on all target nodes\n const nodes = this.endpoint.node.physicalNodes;\n if (!nodes.every((node) => node\n .getEndpoint(this.endpoint.index)\n ?.supportsCC(CommandClasses.Configuration))) {\n throw new ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target endpoints to support Configuration CC!`, ZWaveErrorCodes.CC_Invalid);\n }\n // Figure out if all the relevant info is the same\n const paramInfos = this.endpoint.node.physicalNodes.map((node) => createConfigurationCCInstance(node.getEndpoint(this.endpoint.index)!).getParamInformation(this.host, property, propertyKey));\n if (!paramInfos.length\n || !paramInfos.every((info, index) => {\n if (index === 0)\n return true;\n return (info.valueSize === paramInfos[0].valueSize\n && info.format === paramInfos[0].format);\n })) {\n throw new ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target nodes to have the same parameter definition!`, ZWaveErrorCodes.CC_Invalid);\n }\n // If it is, just use the first node to create the CC instance\n ccInstance = createConfigurationCCInstance(this.endpoint);\n }\n else {\n throw new ZWaveError(`The setValue API for Configuration CC is not supported via broadcast!`, ZWaveErrorCodes.CC_NotSupported);\n }\n let { valueSize, format: valueFormat = ConfigValueFormat.SignedInteger, } = ccInstance.getParamInformation(applHost, property);\n let targetValue: number;\n if (propertyKey) {\n // This is a partial value, we need to update some bits only\n // Find out the correct value size\n if (!valueSize) {\n valueSize = ccInstance.getParamInformation(applHost, property, propertyKey).valueSize;\n }\n // Add the target value to the remaining partial values\n targetValue = ccInstance.composePartialParamValue(applHost, property, propertyKey, value);\n // Partial parameters are internally converted to unsigned values - update the valueFormat accordingly\n valueFormat = ConfigValueFormat.UnsignedInteger;\n }\n else {\n targetValue = value;\n }\n if (!valueSize) {\n // If there's no value size configured, figure out a matching value size\n valueSize = getMinIntegerSize(targetValue, valueFormat === ConfigValueFormat.SignedInteger);\n // Throw if the value is too large or too small\n if (!valueSize) {\n throw new ZWaveError(`The value ${targetValue} is not valid for configuration parameters!`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n // Make sure that the given value fits into the value size\n if (!isSafeValue(targetValue, valueSize, valueFormat)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(targetValue, property, valueSize, valueFormat);\n }\n const result = await this.set({\n parameter: property,\n value: targetValue,\n valueSize: valueSize as any,\n valueFormat,\n });\n if (!supervisedCommandSucceeded(result)\n && (this as ConfigurationCCAPI).isSinglecast()) {\n // Verify the current value after a delay, unless the command was supervised and successful\n (this as ConfigurationCCAPI).schedulePoll({ property, propertyKey }, targetValue, \n // Configuration changes are instant\n { transition: \"fast\" });\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ConfigurationCCAPI, { property, propertyKey }) {\n // Config parameters are addressed with numeric properties/keys\n if (typeof property !== \"number\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (propertyKey != undefined && typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return this.get(property, { valueBitMask: propertyKey });\n };\n }\n /**\n * Requests the current value of a given config parameter from the device.\n * This may timeout and return `undefined` if the node does not respond.\n * If the node replied with a different parameter number, a `ConfigurationCCError`\n * is thrown with the `argument` property set to the reported parameter number.\n */\n @validateArgs_ConfigurationCCAPI_get()\n public async get(parameter: number, options?: {\n valueBitMask?: number;\n allowUnexpectedResponse?: boolean;\n }): Promise<MaybeNotKnown<ConfigValue>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n // Two-byte parameter numbers can only be read using the BulkGet command\n if (parameter > 255) {\n const result = await this.getBulk([\n {\n parameter,\n bitMask: options?.valueBitMask,\n },\n ]);\n return result.find((r) => r.parameter === parameter)?.value;\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Get);\n const { valueBitMask, allowUnexpectedResponse } = options ?? {};\n const cc = new ConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n allowUnexpectedResponse,\n });\n const response = await this.host.sendCommand<ConfigurationCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n // Nodes may respond with a different parameter, e.g. if we\n // requested a non-existing one\n if (response.parameter === parameter) {\n if (!valueBitMask)\n return response.value;\n // If a partial parameter was requested, extract that value\n const paramInfo = cc.getParamInformation(this.host, response.parameter, valueBitMask);\n return parsePartial(response.value as any, valueBitMask, isSignedPartial(valueBitMask, paramInfo.format));\n }\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: `Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,\n direction: \"inbound\",\n level: \"error\",\n });\n throw new ConfigurationCCError(`The first existing parameter on this node is ${response.parameter}`, ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber, response.parameter);\n }\n /**\n * Requests the current value of the config parameters from the device.\n * When the node does not respond due to a timeout, the `value` in the returned array will be `undefined`.\n */\n @validateArgs_ConfigurationCCAPI_getBulk()\n public async getBulk(options: {\n parameter: number;\n bitMask?: number;\n }[]): Promise<{\n parameter: number;\n bitMask?: number;\n value: MaybeNotKnown<ConfigValue>;\n }[]> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n let values: ReadonlyMap<number, ConfigValue> | undefined;\n // If the parameters are consecutive, we may use BulkGet\n const distinctParameters = distinct(options.map((o) => o.parameter));\n if (this.supportsCommand(ConfigurationCommand.BulkGet)\n && isConsecutiveArray(distinctParameters)) {\n const cc = new ConfigurationCCBulkGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters: distinctParameters,\n });\n const response = await this.host.sendCommand<ConfigurationCCBulkReport>(cc, this.commandOptions);\n if (response)\n values = response.values;\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Get);\n const _values = new Map<number, ConfigValue>();\n for (const parameter of distinctParameters) {\n const cc = new ConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCReport>(cc, this.commandOptions);\n if (response) {\n _values.set(response.parameter, response.value);\n }\n }\n values = _values;\n }\n // Combine the returned values with the requested ones\n const cc = createConfigurationCCInstance(this.endpoint);\n return options.map((o) => {\n let value = values?.get(o.parameter);\n if (typeof value === \"number\" && o.bitMask) {\n const paramInfo = cc.getParamInformation(this.host, o.parameter, o.bitMask);\n value = parsePartial(value, o.bitMask, isSignedPartial(o.bitMask, paramInfo.format));\n }\n return { ...o, value };\n });\n }\n /**\n * Sets a new value for a given config parameter of the device.\n */\n @validateArgs_ConfigurationCCAPI_set()\n public async set(options: ConfigurationCCAPISetOptions): Promise<SupervisionResult | undefined> {\n // Two-byte parameter numbers can only be set using the BulkSet command\n if (options.parameter > 255) {\n return this.setBulk([options]);\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const normalized = normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, options);\n let value = normalized.value;\n if (normalized.bitMask) {\n const ccc = createConfigurationCCInstance(this.endpoint);\n value = ccc.composePartialParamValue(this.host, normalized.parameter, normalized.bitMask, normalized.value);\n }\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n resetToDefault: false,\n parameter: normalized.parameter,\n value,\n valueSize: normalized.valueSize,\n valueFormat: normalized.valueFormat,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Sets new values for multiple config parameters of the device. Uses the `BulkSet` command if supported, otherwise falls back to individual `Set` commands.\n */\n @validateArgs_ConfigurationCCAPI_setBulk()\n public async setBulk(values: ConfigurationCCAPISetOptions[]): Promise<SupervisionResult | undefined> {\n // Normalize the values so we can better work with them\n const normalized = values.map((v) => normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, v));\n // And merge multiple partials that belong the same \"full\" value\n const allParams = bulkMergePartialParamValues(this.host, this.endpoint, normalized);\n const canUseBulkSet = this.supportsCommand(ConfigurationCommand.BulkSet)\n // For Bulk Set we need consecutive parameters\n && isConsecutiveArray(allParams.map((v) => v.parameter))\n // and identical format\n && new Set(allParams.map((v) => v.valueFormat)).size === 1\n // and identical size\n && new Set(allParams.map((v) => v.valueSize)).size === 1;\n if (canUseBulkSet) {\n const cc = new ConfigurationCCBulkSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters: allParams.map((v) => v.parameter),\n valueSize: allParams[0].valueSize,\n valueFormat: allParams[0].valueFormat,\n values: allParams.map((v) => v.value),\n handshake: true,\n });\n // The handshake flag is set, so we expect a BulkReport in response\n const result = await this.host.sendCommand<ConfigurationCCBulkReport>(cc, this.commandOptions);\n // If we did receive a response, we also received the updated parameters,\n // so if any one was not accepted, we know by looking at the values.\n // Translate the result into a SupervisionResult by comparing the values\n if (result) {\n const sentValues = cc.values;\n const receivedValues = [...result.values.values()];\n const success = sentValues.length === receivedValues.length\n && sentValues.every((v, i) => v === receivedValues[i]);\n return {\n status: success\n ? SupervisionStatus.Success\n : SupervisionStatus.Fail,\n };\n }\n else {\n return undefined;\n }\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const supervisionResults: (SupervisionResult | undefined)[] = [];\n for (const { parameter, value, valueSize, valueFormat, } of allParams) {\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n value,\n valueSize,\n valueFormat,\n });\n supervisionResults.push(await this.host.sendCommand(cc, this.commandOptions));\n }\n return mergeSupervisionResults(supervisionResults);\n }\n }\n /**\n * Resets a configuration parameter to its default value.\n *\n * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)\n */\n @validateArgs_ConfigurationCCAPI_reset()\n public async reset(parameter: number): Promise<SupervisionResult | undefined> {\n // Two-byte parameter numbers can only be reset using the BulkSet command\n if (parameter > 255) {\n return this.resetBulk([parameter]);\n }\n // According to SDS14223 this flag SHOULD NOT be set\n // Because we don't want to test the behavior, we enforce that it MUST not be set\n // on legacy nodes\n if (this.version <= 3) {\n throw new ZWaveError(`Resetting configuration parameters to default MUST not be done on nodes implementing ConfigurationCC V3 or below!`, ZWaveErrorCodes\n .ConfigurationCC_NoResetToDefaultOnLegacyDevices);\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n resetToDefault: true,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Resets multiple configuration parameters to their default value. Uses BulkSet if supported, otherwise falls back to individual Set commands.\n *\n * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)\n */\n @validateArgs_ConfigurationCCAPI_resetBulk()\n public async resetBulk(parameters: number[]): Promise<SupervisionResult | undefined> {\n if (isConsecutiveArray(parameters)\n && this.supportsCommand(ConfigurationCommand.BulkSet)) {\n const cc = new ConfigurationCCBulkSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters,\n resetToDefault: true,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const CCs = distinct(parameters).map((parameter) => new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n resetToDefault: true,\n }));\n for (const cc of CCs) {\n await this.host.sendCommand(cc, this.commandOptions);\n }\n }\n }\n /** Resets all configuration parameters to their default value */\n public async resetAll(): Promise<void> {\n // This is dangerous - don't allow resetting all parameters via multicast\n this.assertPhysicalEndpoint(this.endpoint);\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.DefaultReset);\n const cc = new ConfigurationCCDefaultReset({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_ConfigurationCCAPI_getProperties()\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getProperties(parameter: number) {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCPropertiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCPropertiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"valueSize\",\n \"valueFormat\",\n \"minValue\",\n \"maxValue\",\n \"defaultValue\",\n \"nextParameter\",\n \"altersCapabilities\",\n \"isReadonly\",\n \"isAdvanced\",\n \"noBulkSupport\",\n ]);\n }\n }\n /** Requests the name of a configuration parameter from the node */\n @validateArgs_ConfigurationCCAPI_getName()\n public async getName(parameter: number): Promise<MaybeNotKnown<string>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCNameGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCNameReport>(cc, this.commandOptions);\n return response?.name;\n }\n /** Requests usage info for a configuration parameter from the node */\n @validateArgs_ConfigurationCCAPI_getInfo()\n public async getInfo(parameter: number): Promise<MaybeNotKnown<string>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCInfoGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCInfoReport>(cc, this.commandOptions);\n return response?.info;\n }\n /**\n * This scans the node for the existing parameters. Found parameters will be reported\n * through the `value added` and `value updated` events.\n *\n * WARNING: This method throws for newer devices.\n *\n * WARNING: On nodes implementing V1 and V2, this process may take\n * **up to an hour**, depending on the configured timeout.\n *\n * WARNING: On nodes implementing V2, all parameters after 255 will be ignored.\n */\n public async scanParametersLegacy(): Promise<void> {\n if (this.version >= 3) {\n throw new ZWaveError(\"Use ConfigurationCC.interview instead of scanning parameters for versions 3 and above.\", ZWaveErrorCodes.ConfigurationCC_NoLegacyScanOnNewDevices);\n }\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n // TODO: Reduce the priority of the messages\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: `Scanning available parameters...`,\n });\n const ccInstance = createConfigurationCCInstance(this.endpoint);\n for (let param = 1; param <= 255; param++) {\n // Check if the parameter is readable\n let originalValue: ConfigValue | undefined;\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: ` trying param ${param}...`,\n direction: \"outbound\",\n });\n try {\n originalValue = await this.get(param, {\n // When requesting a non-existing parameter, a node SHOULD respond with the\n // first available parameter. We use this for the first param only,\n // because delayed responses might otherwise confuse the interview process\n allowUnexpectedResponse: param === 1,\n });\n if (originalValue != undefined) {\n const logMessage = ` Param ${param}:\n readable = true\n valueSize = ${ccInstance.getParamInformation(this.host, param)\n .valueSize}\n value = ${originalValue.toString()}`;\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n catch (e) {\n if (e instanceof ConfigurationCCError\n && e.code\n === ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber) {\n // Continue iterating with the next param\n if (e.argument - 1 > param)\n param = e.argument - 1;\n continue;\n }\n throw e;\n }\n }\n }\n}\n@commandClass(CommandClasses.Configuration)\n@implementedVersion(4)\n@ccValues(ConfigurationCCValues)\nexport class ConfigurationCC extends CommandClass {\n declare ccCommand: ConfigurationCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Configuration, 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 const deviceConfig = ctx.getDeviceConfig?.(node.id);\n const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);\n if (paramInfo) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `${this.constructor.name}: Loading configuration parameters from device config`,\n direction: \"none\",\n });\n this.deserializeParamInformationFromConfig(ctx, paramInfo);\n }\n const documentedParamNumbers = new Set(Array.from(paramInfo?.keys() ?? []).map((k) => k.parameter));\n // Fraction of the Configuration progress slice filled by the v3+ parameter scan.\n // The value refresh below fills the remainder, so each value query advances progress.\n let configScanProgress = 0;\n if (api.version >= 3) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"finding first configuration parameter...\",\n direction: \"outbound\",\n });\n const param0props = await api.getProperties(0);\n let param: number;\n if (param0props) {\n param = param0props.nextParameter;\n if (param === 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `didn't report any config params, trying #1 just to be sure...`,\n direction: \"inbound\",\n });\n param = 1;\n }\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Finding first configuration parameter timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n // Estimate (or calculate) the total number of queries needed during the interview.\n const expectedQueryCount = estimateConfigurationInterviewQueryCount(paramInfo, api.version, node.getInterviewProgressWeight(CommandClasses.Configuration), !!deviceConfig?.compat?.skipConfigurationNameQuery, !!deviceConfig?.compat?.skipConfigurationInfoQuery);\n let scannedQueries = 0;\n while (param > 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${param} information...`,\n direction: \"outbound\",\n });\n // Query properties and the next param\n const props = await api.getProperties(param).catch(\n // If querying the properties fails, don't abort the entire interview\n () => undefined);\n if (!props) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Querying parameter #${param} information timed out, skipping scan...`,\n level: \"warn\",\n });\n break;\n }\n const { nextParameter, ...properties } = props;\n node.reportInterviewProgress(++scannedQueries, expectedQueryCount);\n let logMessage: string | LogPayload;\n if (properties.valueSize === 0) {\n logMessage =\n `Parameter #${param} is unsupported. Next parameter: ${nextParameter}`;\n }\n else {\n let name: string | undefined;\n // Query the name and info for parameters that are NOT defined in a config file\n if (!documentedParamNumbers.has(param)) {\n // Skip the name query for bugged devices\n if (!deviceConfig?.compat?.skipConfigurationNameQuery) {\n name = await api.getName(param).catch(\n // If querying the name fails, don't abort the entire interview\n () => undefined);\n node.reportInterviewProgress(++scannedQueries, expectedQueryCount);\n }\n // Skip the info query for bugged devices\n if (!deviceConfig?.compat?.skipConfigurationInfoQuery) {\n await api.getInfo(param).catch(\n // If querying the info fails, don't abort the entire interview\n () => undefined);\n node.reportInterviewProgress(++scannedQueries, expectedQueryCount);\n }\n }\n logMessage = logText(`received information for parameter #${param}:`, {\n nested: logDict({\n \"parameter name\": name || undefined,\n \"value format\": getEnumMemberName(ConfigValueFormat, properties.valueFormat),\n \"value size\": `${properties.valueSize} bytes`,\n \"min value\": properties.minValue?.toString()\n ?? \"undefined\",\n \"max value\": properties.maxValue?.toString()\n ?? \"undefined\",\n \"default value\": properties.defaultValue?.toString()\n ?? \"undefined\",\n \"is read-only\": !!properties.isReadonly,\n \"is advanced (UI)\": !!properties.isAdvanced,\n \"has bulk support\": !properties.noBulkSupport,\n \"alters capabilities\": !!properties\n .altersCapabilities,\n }),\n });\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n // Some devices report their parameter 1 instead of 0 as the next one\n // when reaching the end. To avoid infinite loops, stop scanning\n // once the next parameter is lower than the current one\n if (nextParameter > param) {\n param = nextParameter;\n }\n else {\n break;\n }\n }\n configScanProgress = Math.min(1, scannedQueries / expectedQueryCount);\n }\n await this.refreshValues(ctx, {\n tag: \"interview\",\n onProgress: (completed, total) => {\n // To support reporting granular progress for devices where we don't\n // know the parameter count in advance, we let the scan phase\n // fill up the progress and map the value queries into the remainder.\n //\n // For devices with known parameter counts, this mapping is uniform.\n // For other devices it may yield larger, smaller, or no progress at all,\n // depending on the actual parameter count.\n const fraction = total > 0\n ? configScanProgress\n + (completed / total) * (1 - configScanProgress)\n : configScanProgress;\n node.reportInterviewProgress(fraction, 1);\n },\n });\n // Apply recommended values from device config\n if (paramInfo !== undefined\n && ctx.getInterviewOptions().applyRecommendedConfigParamValues\n === true) {\n await this.applyRecommendedValues(ctx, node, paramInfo, api);\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n /**\n * Applies all recommended values from the device config to this node\n * Applies only if the current value is still the default value and\n * the recommended value is different\n */\n private async applyRecommendedValues(ctx: InterviewContext, node: NodeId, paramInfo: ParamInfoMap, api: ConfigurationCCAPI): Promise<void> {\n const parametersNeededUpdate: ConfigurationCCAPISetOptions[] = [];\n // Find parameters for which current value doesn't match the recommended value\n for (const [paramKey, param] of paramInfo) {\n if (param.recommendedValue === undefined\n || param.defaultValue === param.recommendedValue)\n continue;\n // Get the current value of this parameter from the device\n const currentValue = this.getValue(ctx, ConfigurationCCValues.paramInformation(paramKey.parameter, paramKey.valueBitMask));\n // If the current value is the default value (i.e. it was never changed by the user)\n // and the recommended value is different, we should update it\n if (currentValue === param.defaultValue\n && currentValue !== param.recommendedValue) {\n const baseParam = {\n parameter: paramKey.parameter,\n value: param.recommendedValue,\n };\n parametersNeededUpdate.push(param.valueBitMask !== undefined\n ? { ...baseParam, bitMask: param.valueBitMask }\n : baseParam);\n }\n }\n if (parametersNeededUpdate.length === 0)\n return;\n // Log what we're about to do\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(\"Applying recommended config parameter values during interview:\", {\n nested: logList(parametersNeededUpdate.map((param) => {\n const formatterBitMask = param.bitMask\n ? `[0x${num2hex(param.bitMask)}]`\n : \"\";\n const fullParamKey = `${param.parameter}${formatterBitMask}`;\n return `#${fullParamKey} => ${param.value}`;\n })),\n }),\n direction: \"none\",\n });\n await api.setBulk(parametersNeededUpdate);\n await api.getBulk(parametersNeededUpdate.map((param) => ({\n parameter: param.parameter,\n bitMask: param.bitMask,\n })));\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Configuration, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n if (api.version < 3) {\n // V1/V2: Query all values defined in the config file\n const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);\n if (paramInfo?.size) {\n const parametersToQuery = getReadableConfigParameters(paramInfo);\n for (const [i, parameter] of parametersToQuery.entries()) {\n // Query the current value\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${parameter} value...`,\n direction: \"outbound\",\n });\n // ... at least try to\n const paramValue = await api.get(parameter);\n options?.onProgress?.(i + 1, parametersToQuery.length);\n if (typeof paramValue === \"number\") {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `parameter #${parameter} has value: ${paramValue}`,\n direction: \"inbound\",\n });\n }\n else if (!paramValue) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `received no value for parameter #${parameter}`,\n direction: \"inbound\",\n level: \"warn\",\n });\n }\n }\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `${this.constructor.name}: skipping interview because CC version is < 3 and there is no config file`,\n direction: \"none\",\n });\n }\n }\n else {\n // V3+: Query the values of discovered parameters\n const parameters = distinct(this.getDefinedValueIDs(ctx)\n .map((v) => v.property)\n .filter((p) => typeof p === \"number\"));\n for (const [i, param] of parameters.entries()) {\n if (this.getParamInformation(ctx, param).readable !== false) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${param} value...`,\n direction: \"outbound\",\n });\n await api.get(param);\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `not querying parameter #${param} value, because it is writeonly`,\n direction: \"none\",\n });\n }\n options?.onProgress?.(i + 1, parameters.length);\n }\n }\n }\n /**\n * Whether this node's param information was loaded from a config file.\n * If this is true, we don't trust what the node reports\n */\n protected paramExistsInConfigFile(ctx: GetValueDB & GetDeviceConfig, parameter: number, valueBitMask?: number): boolean {\n if (this.getValue(ctx, ConfigurationCCValues.isParamInformationFromConfig) !== true) {\n return false;\n }\n const paramInformation = getParamInformationFromConfigFile(ctx, this.nodeId as number, this.endpointIndex);\n if (!paramInformation)\n return false;\n // Check if the param is defined in the config file, either as a normal param or a partial\n if (paramInformation.has({ parameter, valueBitMask })) {\n return true;\n }\n else if (valueBitMask == undefined) {\n // Also consider partials when looking for plain params\n for (const key of paramInformation.keys()) {\n if (key.parameter === parameter)\n return true;\n }\n }\n return false;\n }\n /**\n * @internal\n * Stores config parameter metadata for this CC's node\n */\n public extendParamInformation(ctx: GetValueDB & GetDeviceConfig, parameter: number, valueBitMask: number | undefined, info: Partial<ConfigurationMetadata>): void {\n // Don't trust param information that a node reports if we have already loaded it from a config file\n if (valueBitMask === undefined\n && this.paramExistsInConfigFile(ctx, parameter)) {\n return;\n }\n // Retrieve the base metadata\n const metadata = this.getParamInformation(ctx, parameter, valueBitMask);\n // Override it with new data\n Object.assign(metadata, info);\n // And store it back\n this.setMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask), metadata);\n }\n /**\n * @internal\n * Returns stored config parameter metadata for this CC's node\n */\n public getParamInformation(ctx: GetValueDB, parameter: number, valueBitMask?: number): ConfigurationMetadata {\n return (this.getMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask)) ?? {\n ...ValueMetadata.Number,\n });\n }\n /**\n * **INTERNAL:** Returns the param info that was queried for this node. This returns the information that was returned by the node\n * and does not include partial parameters.\n */\n public getQueriedParamInfos(ctx: GetValueDB & GetSupportedCCVersion & GetDeviceConfig & GetNode<NodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>): Record<number, ConfigurationMetadata> {\n const parameters = distinct(this.getDefinedValueIDs(ctx)\n .map((v) => v.property)\n .filter((p) => typeof p === \"number\"));\n return Object.fromEntries(parameters.map((p) => [\n p as any,\n this.getParamInformation(ctx, p),\n ]));\n }\n /**\n * Returns stored config parameter metadata for all partial config params addressed with the given parameter number\n */\n public getPartialParamInfos(ctx: GetValueDB, parameter: number): (ValueID & {\n metadata: ConfigurationMetadata;\n })[] {\n const valueDB = this.getValueDB(ctx);\n return valueDB.findMetadata((id) => id.commandClass === this.ccId\n && (id.endpoint ?? 0) === this.endpointIndex\n && id.property === parameter\n && id.propertyKey != undefined) as (ValueID & {\n metadata: ConfigurationMetadata;\n })[];\n }\n /**\n * Computes the full value of a parameter after applying a partial param value\n */\n public composePartialParamValue(ctx: GetValueDB, parameter: number, bitMask: number, partialValue: number): number {\n return this.composePartialParamValues(ctx, parameter, [\n { bitMask, partialValue },\n ]);\n }\n /**\n * Computes the full value of a parameter after applying multiple partial param values\n */\n public composePartialParamValues(ctx: GetValueDB, parameter: number, partials: {\n bitMask: number;\n partialValue: number;\n }[]): number {\n const valueDB = this.getValueDB(ctx);\n // Add the other values together\n const otherValues = valueDB.findValues((id) => id.commandClass === this.ccId\n && (id.endpoint ?? 0) === this.endpointIndex\n && id.property === parameter\n && id.propertyKey != undefined\n && !partials.some((p) => id.propertyKey === p.bitMask));\n let ret = 0;\n for (const { propertyKey: bitMask, value: partialValue, } of otherValues) {\n ret = encodePartial(ret, partialValue as number, bitMask as number);\n }\n for (const { bitMask, partialValue } of partials) {\n ret = encodePartial(ret, partialValue, bitMask);\n }\n return ret;\n }\n /** Deserializes the config parameter info from a config file */\n public deserializeParamInformationFromConfig(ctx: GetValueDB & GetDeviceConfig, config: ParamInfoMap): void {\n const valueDB = this.getValueDB(ctx);\n // Clear old param information\n for (const meta of valueDB.getAllMetadata(this.ccId)) {\n if (typeof meta.property === \"number\"\n && (meta.endpoint ?? 0) === this.endpointIndex) {\n // this is a param information, delete it\n valueDB.setMetadata(meta, undefined, \n // Don't emit the added/updated events, as this will spam applications with untranslated events\n { noEvent: true });\n }\n }\n // Allow overwriting the param info (mark it as unloaded)\n this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, false);\n for (const [param, info] of config.entries()) {\n // Skip hidden parameters entirely - don't create metadata or persist values\n if (info.hidden) {\n continue;\n }\n const paramInfo = configParamInfoToMetadata(info);\n this.extendParamInformation(ctx, param.parameter, param.valueBitMask, paramInfo);\n }\n // Remember that we loaded the param information from a config file\n this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, true);\n }\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey?: string | number): string | undefined {\n if (typeof property === \"number\"\n && (propertyKey == undefined || typeof propertyKey === \"number\")) {\n // This CC names all configuration parameters differently,\n // so no name for the property key is required\n return undefined;\n }\n return super.translateProperty(ctx, property, propertyKey);\n }\n public translateProperty(ctx: GetValueDB, property: string | number, propertyKey?: string | number): string {\n // Try to retrieve the configured param label\n if (typeof property === \"number\"\n && (propertyKey == undefined || typeof propertyKey === \"number\")) {\n const paramInfo = this.getParamInformation(ctx, property, propertyKey);\n if (paramInfo.label)\n return paramInfo.label;\n // fall back to paramXYZ[_key] if none is defined\n let ret = `param${property.toString().padStart(3, \"0\")}`;\n if (propertyKey != undefined) {\n ret += \"_\" + propertyKey.toString();\n }\n return ret;\n }\n return super.translateProperty(ctx, property, propertyKey);\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCReportOptions {\n parameter: number;\n value: ConfigValue;\n valueSize: number;\n valueFormat?: ConfigValueFormat;\n}\n@CCCommand(ConfigurationCommand.Report)\nexport class ConfigurationCCReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.value = options.value;\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCReport {\n // All fields must be present\n validatePayload(raw.payload.length > 2);\n const parameter = raw.payload[0];\n const valueSize = raw.payload[1] & 0b111;\n // Ensure we received a valid report\n validatePayload(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);\n // Default to parsing the value as SignedInteger, like the specs say.\n // We try to re-interpret the value in persistValues()\n const value = parseValue(raw.payload.subarray(2), valueSize, ConfigValueFormat.SignedInteger);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueSize,\n value,\n });\n }\n public parameter: number;\n public value: ConfigValue;\n public valueSize: number;\n private valueFormat?: ConfigValueFormat; // only used for serialization\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Skip hidden parameters entirely - don't persist values\n const paramInfo = getParamInformationFromConfigFile(ctx, this.nodeId as number, this.endpointIndex);\n if (paramInfo?.get({ parameter: this.parameter })?.hidden) {\n return true;\n }\n const ccVersion = getEffectiveCCVersion(ctx, this);\n // This parameter may be a partial param in the following cases:\n // * a config file defines it as such\n // * it was reported by the device as a bit field\n const partialParams = this.getPartialParamInfos(ctx, this.parameter);\n let cachedValueFormat: ConfigValueFormat | undefined;\n if (partialParams.length > 0) {\n // This is a partial param. All definitions should have the same format, so we just take the first one\n cachedValueFormat = partialParams[0].metadata.format;\n }\n else {\n // Check if the initial assumption of SignedInteger holds true\n const oldParamInformation = this.getParamInformation(ctx, this.parameter);\n cachedValueFormat = oldParamInformation.format;\n // On older CC versions, these reports may be the only way we can retrieve the value size\n // Therefore we store it here\n this.extendParamInformation(ctx, this.parameter, undefined, {\n valueSize: this.valueSize,\n });\n if (ccVersion < 3\n && !this.paramExistsInConfigFile(ctx, this.parameter)\n && oldParamInformation.min == undefined\n && oldParamInformation.max == undefined) {\n const isSigned = oldParamInformation.format == undefined\n || oldParamInformation.format\n === ConfigValueFormat.SignedInteger;\n this.extendParamInformation(ctx, this.parameter, undefined, getIntegerLimits(this.valueSize as any, isSigned));\n }\n }\n // We may have to re-interpret the value as unsigned, depending on the cached value format\n if (cachedValueFormat != undefined\n && cachedValueFormat !== ConfigValueFormat.SignedInteger) {\n // Re-interpret the value with the new format\n this.value = reInterpretSignedValue(this.value, this.valueSize, cachedValueFormat);\n }\n // And store the value itself\n // If we have partial config params defined, we need to split the value\n if (partialParams.length > 0) {\n for (const param of partialParams) {\n if (typeof param.propertyKey === \"number\") {\n this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter, param.propertyKey), parsePartial(this.value as any, param.propertyKey, isSignedPartial(param.propertyKey, param.metadata.format)));\n }\n }\n }\n else {\n // This is a single param\n this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter), this.value);\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.parameter, this.valueSize & 0b111],\n new Bytes(this.valueSize),\n ]);\n serializeValue(this.payload, 2, this.valueSize, this.valueFormat ?? ConfigValueFormat.SignedInteger, this.value);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n \"value size\": this.valueSize,\n value: configValueToString(this.value),\n },\n };\n }\n}\nfunction testResponseForConfigurationGet(sent: ConfigurationCCGet, received: ConfigurationCCReport) {\n // We expect a Configuration Report that matches the requested parameter\n return (sent.parameter === received.parameter || sent.allowUnexpectedResponse);\n}\n// @publicAPI\nexport interface ConfigurationCCGetOptions {\n parameter: number;\n /**\n * If this is `true`, responses with different parameters than expected are accepted\n * and treated as hints for the first parameter number.\n */\n allowUnexpectedResponse?: boolean;\n}\n@CCCommand(ConfigurationCommand.Get)\n@expectedCCResponse(ConfigurationCCReport, testResponseForConfigurationGet)\nexport class ConfigurationCCGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.allowUnexpectedResponse = options.allowUnexpectedResponse\n ?? false;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCGet {\n validatePayload(raw.payload.length >= 1);\n const parameter = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public allowUnexpectedResponse: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.parameter]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n// @publicAPI\nexport type ConfigurationCCSetOptions = {\n parameter: number;\n resetToDefault: true;\n} | {\n parameter: number;\n resetToDefault?: false;\n valueSize: number;\n /** How the value is encoded. Defaults to SignedInteger */\n valueFormat?: ConfigValueFormat;\n value: ConfigValue;\n};\n@CCCommand(ConfigurationCommand.Set)\n@useSupervision()\nexport class ConfigurationCCSet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCSetOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.resetToDefault = !!options.resetToDefault;\n if (!options.resetToDefault) {\n // TODO: Default to the stored value size\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat\n ?? ConfigValueFormat.SignedInteger;\n this.value = options.value;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCSet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload[0];\n const resetToDefault = !!(raw.payload[1] & 128);\n const valueSize: number | undefined = raw.payload[1] & 0b111;\n // Ensure we received a valid report\n validatePayload(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);\n // Parse the value as signed integer. We don't know the format here.\n const value: number | undefined = parseValue(raw.payload.subarray(2), valueSize, ConfigValueFormat.SignedInteger);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n resetToDefault,\n valueSize,\n value,\n });\n }\n public resetToDefault: boolean;\n public parameter: number;\n public valueSize: number | undefined;\n public valueFormat: ConfigValueFormat | undefined;\n public value: ConfigValue | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const valueSize = this.resetToDefault ? 1 : this.valueSize!;\n const payloadLength = 2 + valueSize;\n this.payload = Bytes.alloc(payloadLength, 0);\n this.payload[0] = this.parameter;\n this.payload[1] = (this.resetToDefault ? 128 : 0)\n | (valueSize & 0b111);\n if (!this.resetToDefault) {\n // Make sure that the given value fits into the value size\n if (typeof this.value === \"number\"\n && !isSafeValue(this.value, valueSize, this.valueFormat!)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(this.value, this.parameter, valueSize, this.valueFormat!);\n }\n try {\n serializeValue(this.payload, 2, valueSize, this.valueFormat!, this.value!);\n }\n catch (e) {\n tryCatchOutOfBoundsError(e as Error, this.value, this.parameter, valueSize, this.valueFormat!);\n }\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"parameter #\": this.parameter,\n \"reset to default\": this.resetToDefault,\n };\n if (this.valueSize != undefined) {\n message[\"value size\"] = this.valueSize;\n }\n if (this.valueFormat != undefined) {\n message[\"value format\"] = getEnumMemberName(ConfigValueFormat, this.valueFormat);\n }\n if (this.value != undefined) {\n message.value = configValueToString(this.value);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport type ConfigurationCCBulkSetOptions = {\n parameters: number[];\n handshake?: boolean;\n} & ({\n resetToDefault: true;\n} | {\n resetToDefault?: false;\n valueSize: number;\n valueFormat?: ConfigValueFormat;\n values: number[];\n});\nfunction getResponseForBulkSet(ctx: GetNode<NodeId & SupportsCC>, cc: ConfigurationCCBulkSet) {\n return cc.handshake ? ConfigurationCCBulkReport : undefined;\n}\n@CCCommand(ConfigurationCommand.BulkSet)\n@expectedCCResponse(getResponseForBulkSet)\n@useSupervision()\nexport class ConfigurationCCBulkSet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkSetOptions>) {\n super(options);\n this._parameters = options.parameters;\n if (this._parameters.length < 1) {\n throw new ZWaveError(`In a ConfigurationCC.BulkSet, parameters must be a non-empty array`, ZWaveErrorCodes.CC_Invalid);\n }\n else if (!isConsecutiveArray(this._parameters)) {\n throw new ZWaveError(`A ConfigurationCC.BulkSet can only be used for consecutive parameters`, ZWaveErrorCodes.CC_Invalid);\n }\n this._handshake = !!options.handshake;\n this._resetToDefault = !!options.resetToDefault;\n if (!!options.resetToDefault) {\n this._valueSize = 1;\n this._valueFormat = ConfigValueFormat.SignedInteger;\n this._values = this._parameters.map(() => 0);\n }\n else {\n this._valueSize = options.valueSize;\n this._valueFormat = options.valueFormat\n ?? ConfigValueFormat.SignedInteger;\n this._values = options.values;\n }\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): ConfigurationCCBulkSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new ConfigurationCCBulkSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n private _parameters: number[];\n public get parameters(): number[] {\n return this._parameters;\n }\n private _resetToDefault: boolean;\n public get resetToDefault(): boolean {\n return this._resetToDefault;\n }\n private _valueSize: number;\n public get valueSize(): number {\n return this._valueSize;\n }\n private _valueFormat: ConfigValueFormat;\n public get valueFormat(): ConfigValueFormat {\n return this._valueFormat;\n }\n private _values: number[];\n public get values(): number[] {\n return this._values;\n }\n private _handshake: boolean;\n public get handshake(): boolean {\n return this._handshake;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const valueSize = this._resetToDefault ? 1 : this.valueSize;\n const payloadLength = 4 + valueSize * this.parameters.length;\n this.payload = Bytes.alloc(payloadLength, 0);\n this.payload.writeUInt16BE(this.parameters[0], 0);\n this.payload[2] = this.parameters.length;\n this.payload[3] = (this._resetToDefault ? 128 : 0)\n | (this.handshake ? 64 : 0)\n | (valueSize & 0b111);\n if (!this._resetToDefault) {\n for (let i = 0; i < this.parameters.length; i++) {\n const value = this._values[i];\n const param = this._parameters[i];\n // Make sure that the given value fits into the value size\n if (!isSafeValue(value, valueSize, this._valueFormat)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(value, param, valueSize, this._valueFormat);\n }\n try {\n serializeValue(this.payload, 4 + i * valueSize, valueSize, this._valueFormat, value);\n }\n catch (e) {\n tryCatchOutOfBoundsError(e as Error, value, param, valueSize, this._valueFormat);\n }\n }\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n handshake: this.handshake,\n \"reset to default\": this.resetToDefault,\n \"value size\": this.valueSize,\n };\n if (this._values.length > 0) {\n message.values = logList(this._values.map((value, i) => `#${this._parameters[i]}: ${configValueToString(value)}`));\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ConfigurationCCBulkReportOptions {\n reportsToFollow: number;\n defaultValues: boolean;\n isHandshakeResponse: boolean;\n valueSize: number;\n values: Record<number, ConfigValue>;\n}\n@CCCommand(ConfigurationCommand.BulkReport)\nexport class ConfigurationCCBulkReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.reportsToFollow = options.reportsToFollow;\n this.defaultValues = options.defaultValues;\n this.isHandshakeResponse = options.isHandshakeResponse;\n this.valueSize = options.valueSize;\n for (const [param, value] of Object.entries(options.values)) {\n this._values.set(parseInt(param), value);\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCBulkReport {\n // Ensure we received enough bytes for the preamble\n validatePayload(raw.payload.length >= 5);\n const firstParameter = raw.payload.readUInt16BE(0);\n const numParams = raw.payload[2];\n const reportsToFollow = raw.payload[3];\n const defaultValues = !!(raw.payload[4] & 128);\n const isHandshakeResponse = !!(raw.payload[4] & 64);\n const valueSize = raw.payload[4] & 0b111;\n // Ensure the payload is long enough for all reported values\n validatePayload(raw.payload.length >= 5 + numParams * valueSize);\n const values: Record<number, ConfigValue> = {};\n for (let i = 0; i < numParams; i++) {\n const param = firstParameter + i;\n // Default to parsing the value as SignedInteger, like the specs say.\n // We try to re-interpret the value in persistValues()\n values[param] = parseValue(raw.payload.subarray(5 + i * valueSize), valueSize, ConfigValueFormat.SignedInteger);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n reportsToFollow,\n defaultValues,\n isHandshakeResponse,\n valueSize,\n values,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Store every received parameter\n for (let [parameter, value] of this._values.entries()) {\n // Check if the initial assumption of SignedInteger holds true\n const oldParamInformation = this.getParamInformation(ctx, parameter);\n if (oldParamInformation.format != undefined\n && oldParamInformation.format\n !== ConfigValueFormat.SignedInteger) {\n // Re-interpret the value with the new format\n value = reInterpretSignedValue(value, this.valueSize, oldParamInformation.format);\n this._values.set(parameter, value);\n }\n this.setValue(ctx, ConfigurationCCValues.paramInformation(parameter), value);\n }\n return true;\n }\n public reportsToFollow: number;\n public defaultValues: boolean;\n public isHandshakeResponse: boolean;\n public valueSize: number;\n private _values = new Map<number, ConfigValue>();\n public get values(): ReadonlyMap<number, ConfigValue> {\n return this._values;\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n return {};\n }\n public getRemainingSegments(): number | undefined {\n return this.reportsToFollow;\n }\n public mergePartialCCs(partials: ConfigurationCCBulkReport[], _ctx: CCParsingContext): Promise<void> {\n // Merge the values of all partial reports\n const merged = new Map<number, ConfigValue>();\n for (const partial of partials) {\n for (const [parameter, value] of partial._values) {\n merged.set(parameter, value);\n }\n }\n for (const [parameter, value] of this._values) {\n merged.set(parameter, value);\n }\n this._values = merged;\n return Promise.resolve();\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"handshake response\": this.isHandshakeResponse,\n \"default values\": this.defaultValues,\n \"value size\": this.valueSize,\n \"reports to follow\": this.reportsToFollow,\n };\n if (this._values.size > 0) {\n message.values = [...this._values]\n .map(([param, value]) => `\n\u00B7 #${param}: ${configValueToString(value)}`)\n .join(\"\");\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ConfigurationCCBulkGetOptions {\n parameters: number[];\n}\n@CCCommand(ConfigurationCommand.BulkGet)\n@expectedCCResponse(ConfigurationCCBulkReport)\nexport class ConfigurationCCBulkGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkGetOptions>) {\n super(options);\n this._parameters = options.parameters.toSorted((a, b) => a - b);\n if (!isConsecutiveArray(this.parameters)) {\n throw new ZWaveError(`A ConfigurationCC.BulkGet can only be used for consecutive parameters`, ZWaveErrorCodes.CC_Invalid);\n }\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): ConfigurationCCBulkGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new ConfigurationCCBulkGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n private _parameters: number[];\n public get parameters(): number[] {\n return this._parameters;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(3);\n this.payload.writeUInt16BE(this.parameters[0], 0);\n this.payload[2] = this.parameters.length;\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { parameters: this.parameters.join(\", \") },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCNameReportOptions {\n parameter: number;\n name: string;\n reportsToFollow: number;\n}\n@CCCommand(ConfigurationCommand.NameReport)\nexport class ConfigurationCCNameReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCNameReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.name = options.name;\n this.reportsToFollow = options.reportsToFollow;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCNameReport {\n // Parameter and # of reports must be present\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const reportsToFollow = raw.payload[2];\n if (reportsToFollow > 0) {\n // If more reports follow, the info must at least be one byte\n validatePayload(raw.payload.length >= 4);\n }\n const name: string = raw.payload.subarray(3).toString(\"utf8\");\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n reportsToFollow,\n name,\n });\n }\n public readonly parameter: number;\n public name: string;\n public readonly reportsToFollow: number;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Bitfield parameters that are not documented in a config file\n // are split into multiple partial parameters. We need to set the name for\n // all of them.\n const partialParams = this.getPartialParamInfos(ctx, this.parameter);\n if (partialParams.length === 0) {\n this.extendParamInformation(ctx, this.parameter, undefined, {\n label: this.name,\n });\n }\n else {\n for (const param of partialParams) {\n const paramNumber = param.property as number;\n const bitMask = param.propertyKey as number;\n const bitNumber = Math.log2(bitMask) % 1 === 0\n ? Math.log2(bitMask)\n : undefined;\n let label = `${this.name} - ${bitMask}`;\n if (bitNumber != undefined) {\n label += ` (bit ${bitNumber})`;\n }\n this.extendParamInformation(ctx, paramNumber, bitMask, {\n label,\n });\n }\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const nameBuffer = Bytes.from(this.name, \"utf8\");\n this.payload = new Bytes(3 + nameBuffer.length);\n this.payload.writeUInt16BE(this.parameter, 0);\n this.payload[2] = this.reportsToFollow;\n this.payload.set(nameBuffer, 3);\n return super.serialize(ctx);\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n // Distinguish sessions by the parameter number\n return { parameter: this.parameter };\n }\n public getRemainingSegments(): number | undefined {\n return this.reportsToFollow;\n }\n public mergePartialCCs(partials: ConfigurationCCNameReport[], _ctx: CCParsingContext): Promise<void> {\n // Concat the name\n this.name = [...partials, this]\n .map((report) => report.name)\n .reduce((prev, cur) => prev + cur, \"\");\n return Promise.resolve();\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n name: this.name,\n \"reports to follow\": this.reportsToFollow,\n },\n };\n }\n}\n@CCCommand(ConfigurationCommand.NameGet)\n@expectedCCResponse(ConfigurationCCNameReport)\nexport class ConfigurationCCNameGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCNameGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCInfoReportOptions {\n parameter: number;\n info: string;\n reportsToFollow: number;\n}\n@CCCommand(ConfigurationCommand.InfoReport)\nexport class ConfigurationCCInfoReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCInfoReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.info = options.info;\n this.reportsToFollow = options.reportsToFollow;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCInfoReport {\n // Parameter and # of reports must be present\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const reportsToFollow = raw.payload[2];\n if (reportsToFollow > 0) {\n // If more reports follow, the info must at least be one byte\n validatePayload(raw.payload.length >= 4);\n }\n const info: string = raw.payload.subarray(3).toString(\"utf8\");\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n reportsToFollow,\n info,\n });\n }\n public readonly parameter: number;\n public info: string;\n public readonly reportsToFollow: number;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Bitfield parameters that are not documented in a config file\n // are split into multiple partial parameters. We need to set the description for\n // all of them. However, these can get very long, so we put the reported\n // description on the first partial param, and refer to it from the others\n const partialParams = this.getPartialParamInfos(ctx, this.parameter).toSorted((a, b) => ((a.propertyKey as number) ?? 0)\n - ((b.propertyKey as number) ?? 0));\n if (partialParams.length === 0) {\n this.extendParamInformation(ctx, this.parameter, undefined, {\n description: this.info,\n });\n }\n else {\n let firstParamLabel: string | undefined;\n for (const param of partialParams) {\n const paramNumber = param.property as number;\n const bitMask = param.propertyKey as number;\n // We put the description on the first partial param\n const description = firstParamLabel\n ? `Refer to ${firstParamLabel}`\n : this.info;\n this.extendParamInformation(ctx, paramNumber, bitMask, {\n description,\n });\n // Then we store the name of the first param to refer to it on the\n // following partial params\n if (firstParamLabel == undefined) {\n firstParamLabel =\n this.getParamInformation(ctx, paramNumber, bitMask)\n .label ?? `parameter ${paramNumber} - ${bitMask}`;\n }\n }\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const infoBuffer = Bytes.from(this.info, \"utf8\");\n this.payload = new Bytes(3 + infoBuffer.length);\n this.payload.writeUInt16BE(this.parameter, 0);\n this.payload[2] = this.reportsToFollow;\n this.payload.set(infoBuffer, 3);\n return super.serialize(ctx);\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n // Distinguish sessions by the parameter number\n return { parameter: this.parameter };\n }\n public getRemainingSegments(): number | undefined {\n return this.reportsToFollow;\n }\n public mergePartialCCs(partials: ConfigurationCCInfoReport[], _ctx: CCParsingContext): Promise<void> {\n // Concat the info\n this.info = [...partials, this]\n .map((report) => report.info)\n .reduce((prev, cur) => prev + cur, \"\");\n return Promise.resolve();\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n info: this.info,\n \"reports to follow\": this.reportsToFollow,\n },\n };\n }\n}\n@CCCommand(ConfigurationCommand.InfoGet)\n@expectedCCResponse(ConfigurationCCInfoReport)\nexport class ConfigurationCCInfoGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCInfoGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCPropertiesReportOptions {\n parameter: number;\n valueSize: number;\n valueFormat: ConfigValueFormat;\n minValue?: ConfigValue;\n maxValue?: ConfigValue;\n defaultValue?: ConfigValue;\n nextParameter: number;\n altersCapabilities?: boolean;\n isReadonly?: boolean;\n isAdvanced?: boolean;\n noBulkSupport?: boolean;\n}\n@CCCommand(ConfigurationCommand.PropertiesReport)\nexport class ConfigurationCCPropertiesReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCPropertiesReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat;\n if (this.valueSize > 0) {\n if (options.minValue == undefined) {\n throw new ZWaveError(\"The minimum value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n else if (options.maxValue == undefined) {\n throw new ZWaveError(\"The maximum value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n else if (options.defaultValue == undefined) {\n throw new ZWaveError(\"The default value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n this.minValue = options.minValue;\n this.maxValue = options.maxValue;\n this.defaultValue = options.defaultValue;\n }\n this.nextParameter = options.nextParameter;\n this.altersCapabilities = options.altersCapabilities;\n this.isReadonly = options.isReadonly;\n this.isAdvanced = options.isAdvanced;\n this.noBulkSupport = options.noBulkSupport;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCPropertiesReport {\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const valueFormat: ConfigValueFormat = (raw.payload[2] & 0b111000)\n >>> 3;\n const valueSize = raw.payload[2] & 0b111;\n // GH#1309 Some devices don't tell us the first parameter if we query #0\n // Instead, they contain 0x000000\n let nextParameter;\n if (valueSize === 0 && raw.payload.length < 5) {\n nextParameter = 0;\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueFormat,\n valueSize,\n nextParameter,\n });\n }\n // Ensure the payload contains the two bytes for next parameter\n const nextParameterOffset = 3 + 3 * valueSize;\n validatePayload(raw.payload.length >= nextParameterOffset + 2);\n let minValue: MaybeNotKnown<number>;\n let maxValue: MaybeNotKnown<number>;\n let defaultValue: MaybeNotKnown<number>;\n if (valueSize > 0) {\n if (valueFormat === ConfigValueFormat.BitField) {\n minValue = 0;\n }\n else {\n minValue = parseValue(raw.payload.subarray(3), valueSize, valueFormat);\n }\n maxValue = parseValue(raw.payload.subarray(3 + valueSize), valueSize, valueFormat);\n defaultValue = parseValue(raw.payload.subarray(3 + 2 * valueSize), valueSize, valueFormat);\n }\n nextParameter = raw.payload.readUInt16BE(nextParameterOffset);\n let altersCapabilities: MaybeNotKnown<boolean>;\n let isReadonly: MaybeNotKnown<boolean>;\n let isAdvanced: MaybeNotKnown<boolean>;\n let noBulkSupport: MaybeNotKnown<boolean>;\n if (raw.payload.length >= nextParameterOffset + 3) {\n // V4 adds an options byte after the next parameter and two bits in byte 2\n const options1 = raw.payload[2];\n const options2 = raw.payload[3 + 3 * valueSize + 2];\n altersCapabilities = !!(options1 & 128);\n isReadonly = !!(options1 & 64);\n isAdvanced = !!(options2 & 0b1);\n noBulkSupport = !!(options2 & 0b10);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueFormat,\n valueSize,\n nextParameter,\n minValue,\n maxValue,\n defaultValue,\n altersCapabilities,\n isReadonly,\n isAdvanced,\n noBulkSupport,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // If we actually received parameter info, store it\n if (this.valueSize > 0) {\n const baseInfo = {\n type: \"number\",\n format: this.valueFormat,\n valueSize: this.valueSize,\n requiresReInclusion: this.altersCapabilities,\n readable: true,\n writeable: !this.isReadonly,\n allowManualEntry: true,\n isAdvanced: this.isAdvanced,\n noBulkSupport: this.noBulkSupport,\n isFromConfig: false,\n } as const;\n if (this.valueFormat !== ConfigValueFormat.BitField) {\n // Do not override param information from a config file\n if (!this.paramExistsInConfigFile(ctx, this.parameter)) {\n const paramInfo = stripUndefined({\n ...baseInfo,\n min: this.minValue,\n max: this.maxValue,\n default: this.defaultValue,\n } as const satisfies ConfigurationMetadata);\n this.extendParamInformation(ctx, this.parameter, undefined, paramInfo);\n }\n }\n else {\n // Bit fields are split into multiple single-bit partial parameters\n const bits = this.maxValue!;\n let mask = 1;\n while (mask <= bits) {\n if (\n // Only create partials that exist\n !!(mask & bits)\n // Do not override param information from a config file\n && !this.paramExistsInConfigFile(ctx, this.parameter, mask)) {\n const paramInfo = stripUndefined({\n ...baseInfo,\n min: 0,\n max: 1,\n default: this.defaultValue! & mask ? 1 : 0,\n } as const satisfies ConfigurationMetadata);\n this.extendParamInformation(ctx, this.parameter, mask, paramInfo);\n }\n // We must use multiplication here, as bitwise shifting works on signed 32-bit integers in JS\n // which would create an infinite loop if maxValue === 0xffff_ffff\n mask *= 2;\n }\n }\n }\n return true;\n }\n public parameter: number;\n public valueSize: number;\n public valueFormat: ConfigValueFormat;\n public minValue: MaybeNotKnown<ConfigValue>;\n public maxValue: MaybeNotKnown<ConfigValue>;\n public defaultValue: MaybeNotKnown<ConfigValue>;\n public nextParameter: number;\n public altersCapabilities: MaybeNotKnown<boolean>;\n public isReadonly: MaybeNotKnown<boolean>;\n public isAdvanced: MaybeNotKnown<boolean>;\n public noBulkSupport: MaybeNotKnown<boolean>;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(3 // preamble\n + 3 * this.valueSize // min, max, default value\n + 2 // next parameter\n + 1);\n this.payload.writeUInt16BE(this.parameter, 0);\n const options1 = (this.altersCapabilities ? 128 : 0)\n | (this.isReadonly ? 64 : 0)\n | ((this.valueFormat & 0b111) << 3)\n | (this.valueSize & 0b111);\n this.payload[2] = options1;\n let offset = 3;\n if (this.valueSize > 0) {\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.minValue!);\n offset += this.valueSize;\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.maxValue!);\n offset += this.valueSize;\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.defaultValue!);\n offset += this.valueSize;\n }\n this.payload.writeUInt16BE(this.nextParameter, offset);\n offset += 2;\n const options2 = (this.isAdvanced ? 0b1 : 0)\n | (this.noBulkSupport ? 0b10 : 0);\n this.payload[offset] = options2;\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"parameter #\": this.parameter,\n \"next param #\": this.nextParameter,\n \"value size\": this.valueSize,\n \"value format\": getEnumMemberName(ConfigValueFormat, this.valueFormat),\n };\n if (this.minValue != undefined) {\n message[\"min value\"] = configValueToString(this.minValue);\n }\n if (this.maxValue != undefined) {\n message[\"max value\"] = configValueToString(this.maxValue);\n }\n if (this.defaultValue != undefined) {\n message[\"default value\"] = configValueToString(this.defaultValue);\n }\n if (this.altersCapabilities != undefined) {\n message[\"alters capabilities\"] = this.altersCapabilities;\n }\n if (this.isReadonly != undefined) {\n message.readonly = this.isReadonly;\n }\n if (this.isAdvanced != undefined) {\n message.advanced = this.isAdvanced;\n }\n if (this.noBulkSupport != undefined) {\n message[\"bulk support\"] = !this.noBulkSupport;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ConfigurationCommand.PropertiesGet)\n@expectedCCResponse(ConfigurationCCPropertiesReport)\nexport class ConfigurationCCPropertiesGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCPropertiesGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n@CCCommand(ConfigurationCommand.DefaultReset)\n@useSupervision()\nexport class ConfigurationCCDefaultReset extends ConfigurationCC {\n}\nfunction isSafeValue(value: number, size: number, format: ConfigValueFormat): boolean {\n let minValue: number;\n let maxValue: number;\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n minValue = -Math.pow(2, 8 * size - 1);\n maxValue = Math.pow(2, 8 * size - 1) - 1;\n break;\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n minValue = 0;\n maxValue = Math.pow(2, 8 * size);\n break;\n default:\n throw new Error(\"not implemented\");\n }\n return minValue <= value && value <= maxValue;\n}\n/** Interprets values from the payload depending on the value format */\nfunction parseValue(raw: Bytes, size: number, format: ConfigValueFormat): ConfigValue {\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n return raw.readIntBE(0, size);\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n return raw.readUIntBE(0, size);\n }\n}\nfunction throwInvalidValueError(value: any, parameter: number, valueSize: number, valueFormat: ConfigValueFormat): never {\n throw new ZWaveError(`The value ${value} is invalid for configuration parameter ${parameter} (size = ${valueSize}, format = ${getEnumMemberName(ConfigValueFormat, valueFormat)})!`, ZWaveErrorCodes.Argument_Invalid);\n}\nfunction tryCatchOutOfBoundsError(e: Error, value: any, parameter: number, valueSize: number, valueFormat: ConfigValueFormat): void {\n if (e.message.includes(\"out of bounds\")) {\n throwInvalidValueError(value, parameter, valueSize, valueFormat);\n }\n else {\n throw e;\n }\n}\n/** Serializes values into the payload according to the value format */\nfunction serializeValue(payload: Bytes, offset: number, size: number, format: ConfigValueFormat, value: ConfigValue): void {\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n payload.writeIntBE(value, offset, size);\n return;\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n payload.writeUIntBE(value, offset, size);\n return;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAGhC,kBAA+oB;AAC/oB,oBAAwD;AACxD,oBAAyB;AACzB,iBAAyM;AACzM,0BAAyK;AACzK,oCAAgH;AAEhH,mBAAuD;AAevD,gCAAsC;AAxBtC,MAAM,EAAE,qCAAqC,yCAAyC,qCAAqC,yCAAyC,uCAAuC,2CAA2C,+CAA+C,yCAAyC,wCAAuC,IAAK;AAW1X,SAAS,oBAAoB,OAAkB;AAC3C,MAAI,OAAO,UAAU;AACjB,WAAO,MAAM,SAAQ;;AAErB,WAAO,CAAC,GAAG,KAAK,EAAE,KAAK,IAAI;AACnC;AALS;AAMH,MAAO,6BAA6B,uBAAU;SAAA;;;EACb;EAAiC;EAAuC;EAA3G,YAAmC,SAAiC,MAAuC,UAAgB;AACvH,UAAM,SAAS,IAAI;mBADY;gBAAiC;oBAAuC;AAGvG,WAAO,eAAe,MAAM,qBAAqB,SAAS;EAC9D;;AAiCJ,SAAS,8BAA8B,UAAuB;AAC1D,SAAO,iCAAa,wBAAwB,SAAS,UAAU,SAAS,KAAK,cAAc,CAAC,IAAI,UAAU,eAAe;AAC7H;AAFS;AAGT,SAAS,sCAAsC,KAAiB,UAAyB,SAAqC;AAC1H,MAAI,aAAa,WAAW,QAAQ,SAAS;AAEzC,UAAM,MAAM,8BAA8B,QAAQ;AAClD,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ACzC;AACA,SAAO,YAAY,SAAS,SAAS;AACzC;AAlBS;AAoBT,SAAS,WAAW,KAAY,MAAc,QAAyB;AACnE,UAAQ,QAAQ;IACZ,KAAK,8BAAkB;AACnB,aAAO,IAAI,UAAU,GAAG,IAAI;IAChC,KAAK,8BAAkB;IACvB,KAAK,8BAAkB;IACvB,KAAK,8BAAkB;AACnB,aAAO,IAAI,WAAW,GAAG,IAAI;EACrC;AACJ;AATS;AAUT,SAAS,uBAAuB,OAAY,WAAmB,WAAmB,aAA8B;AAC5G,QAAM,IAAI,uBAAW,aAAa,KAAK,2CAA2C,SAAS,YAAY,SAAS,kBAAc,iCAAkB,+BAAmB,WAAW,CAAC,MAAM,4BAAgB,gBAAgB;AACzN;AAFS;AAGT,SAAS,yBAAyB,GAAU,OAAY,WAAmB,WAAmB,aAA8B;AACxH,MAAI,EAAE,QAAQ,SAAS,eAAe,GAAG;AACrC,2BAAuB,OAAO,WAAW,WAAW,WAAW;EACnE,OACK;AACD,UAAM;EACV;AACJ;AAPS;AAST,SAAS,eAAe,SAAgB,QAAgB,MAAc,QAA2B,OAAkB;AAC/G,UAAQ,QAAQ;IACZ,KAAK,8BAAkB;AACnB,cAAQ,WAAW,OAAO,QAAQ,IAAI;AACtC;IACJ,KAAK,8BAAkB;IACvB,KAAK,8BAAkB;IACvB,KAAK,8BAAkB;AACnB,cAAQ,YAAY,OAAO,QAAQ,IAAI;AACvC;EACR;AACJ;AAXS;",
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./ConfigurationCC._validateArgs.js\";\nconst { validateArgs_ConfigurationCCAPI_get, validateArgs_ConfigurationCCAPI_getBulk, validateArgs_ConfigurationCCAPI_set, validateArgs_ConfigurationCCAPI_setBulk, validateArgs_ConfigurationCCAPI_reset, validateArgs_ConfigurationCCAPI_resetBulk, validateArgs_ConfigurationCCAPI_getProperties, validateArgs_ConfigurationCCAPI_getName, validateArgs_ConfigurationCCAPI_getInfo } = __validateArgs;\nimport type { GetDeviceConfig, ParamInfoMap, ParamInformation, } from \"@zwave-js/config\";\nimport { CommandClasses, ConfigValueFormat, type ConfigurationMetadata, type ControlsCC, type EndpointId, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type LogPayload, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type NodeId, type SupervisionResult, SupervisionStatus, type SupportsCC, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, encodePartial, getBitMaskWidth, getIntegerLimits, getMinIntegerSize, isConsecutiveArray, logDict, logList, logText, mergeSupervisionResults, parsePartial, stripUndefined, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, num2hex, pick } from \"@zwave-js/shared\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { CCAPI, type CCAPIEndpoint, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, 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, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type ConfigValue, ConfigurationCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nfunction configValueToString(value: ConfigValue): string {\n if (typeof value === \"number\")\n return value.toString();\n else\n return [...value].join(\", \");\n}\nexport class ConfigurationCCError extends ZWaveError {\n public constructor(public readonly message: string, public readonly code: ZWaveErrorCodes, public readonly argument: number) {\n super(message, code);\n // We need to set the prototype explicitly\n Object.setPrototypeOf(this, ConfigurationCCError.prototype);\n }\n}\nimport { ConfigurationCCValues } from \"./_CCValues.generated.js\";\nexport { ConfigurationCCValues };\n/** @publicAPI */\nexport type ConfigurationCCAPISetOptions = {\n parameter: number;\n} & ({\n // Variant 1: Normal parameter, defined in a config file\n bitMask?: undefined;\n value: ConfigValue;\n} | {\n // Variant 2: Normal parameter, not defined in a config file\n bitMask?: undefined;\n value: ConfigValue;\n valueSize: 1 | 2 | 4;\n valueFormat: ConfigValueFormat;\n} | {\n // Variant 3: Partial parameter, must be defined in a config file\n bitMask: number;\n value: number;\n});\ntype NormalizedConfigurationCCAPISetOptions = {\n parameter: number;\n valueSize: 1 | 2 | 4;\n valueFormat: ConfigValueFormat;\n} & ({\n bitMask?: undefined;\n value: ConfigValue;\n} | {\n bitMask: number;\n value: number;\n});\nfunction createConfigurationCCInstance(endpoint: CCAPIEndpoint): ConfigurationCC {\n return CommandClass.createInstanceUnchecked(endpoint.virtual ? endpoint.node.physicalNodes[0] : endpoint, ConfigurationCC)!;\n}\nfunction normalizeConfigurationCCAPISetOptions(ctx: GetValueDB, endpoint: CCAPIEndpoint, options: ConfigurationCCAPISetOptions): NormalizedConfigurationCCAPISetOptions {\n if (\"bitMask\" in options && options.bitMask) {\n // Variant 3: Partial param, look it up in the device config\n const ccc = createConfigurationCCInstance(endpoint);\n const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);\n if (!paramInfo.isFromConfig) {\n throw new ZWaveError(\"Setting a partial configuration parameter requires it to be defined in a device config file!\", ZWaveErrorCodes.Argument_Invalid);\n }\n return {\n parameter: options.parameter,\n bitMask: options.bitMask,\n value: options.value,\n valueSize: paramInfo.valueSize as any,\n valueFormat: paramInfo.format!,\n };\n }\n else if (\"valueSize\" in options) {\n // Variant 2: Normal parameter, not defined in a config file\n return pick(options, [\n \"parameter\",\n \"value\",\n \"valueSize\",\n \"valueFormat\",\n ]);\n }\n else {\n // Variant 1: Normal parameter, defined in a config file\n const ccc = createConfigurationCCInstance(endpoint);\n const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);\n if (!paramInfo.isFromConfig) {\n throw new ZWaveError(\"Setting a configuration parameter without specifying a value size and format requires it to be defined in a device config file!\", ZWaveErrorCodes.Argument_Invalid);\n }\n return {\n parameter: options.parameter,\n value: options.value,\n valueSize: paramInfo.valueSize as any,\n valueFormat: paramInfo.format!,\n };\n }\n}\nfunction bulkMergePartialParamValues(ctx: GetValueDB, endpoint: CCAPIEndpoint, options: NormalizedConfigurationCCAPISetOptions[]): (NormalizedConfigurationCCAPISetOptions & {\n bitMask?: undefined;\n})[] {\n // Merge partial parameters before doing anything else. Therefore, take the non-partials, ...\n const allParams = options.filter((o) => o.bitMask == undefined);\n // ... group the partials by parameter\n const unmergedPartials = new Map<number, NormalizedConfigurationCCAPISetOptions[]>();\n for (const partial of options.filter((o) => o.bitMask != undefined)) {\n if (!unmergedPartials.has(partial.parameter)) {\n unmergedPartials.set(partial.parameter, []);\n }\n unmergedPartials.get(partial.parameter)!.push(partial);\n }\n // and push the merged result into the array we'll be working with\n if (unmergedPartials.size) {\n const ccc = createConfigurationCCInstance(endpoint);\n for (const [parameter, partials] of unmergedPartials) {\n allParams.push({\n parameter,\n value: ccc.composePartialParamValues(ctx, parameter, partials.map((p) => ({\n bitMask: p.bitMask!,\n partialValue: p.value,\n }))),\n valueSize: partials[0].valueSize,\n valueFormat: partials[0].valueFormat,\n });\n }\n }\n return allParams as any;\n}\n/** Determines whether a partial parameter needs to be interpreted as signed */\nfunction isSignedPartial(bitMask: number, format: ConfigValueFormat | undefined): boolean {\n // Only treat partial params as signed if they span more than 1 bit.\n // Otherwise we cannot model 0/1 properly.\n return (getBitMaskWidth(bitMask) > 1\n && (format ?? ConfigValueFormat.SignedInteger)\n === ConfigValueFormat.SignedInteger);\n}\nfunction reInterpretSignedValue(value: ConfigValue, valueSize: number, targetFormat: ConfigValueFormat): ConfigValue {\n // Re-interpret the value with the new format\n const raw = new Bytes(valueSize);\n serializeValue(raw, 0, valueSize, ConfigValueFormat.SignedInteger, value);\n return parseValue(raw, valueSize, targetFormat);\n}\nfunction getParamInformationFromConfigFile(ctx: GetDeviceConfig, nodeId: number, endpointIndex: number): ParamInfoMap | undefined {\n const deviceConfig = ctx.getDeviceConfig?.(nodeId);\n if (endpointIndex === 0) {\n return (deviceConfig?.paramInformation\n ?? deviceConfig?.endpoints?.get(0)?.paramInformation);\n }\n else {\n return deviceConfig?.endpoints?.get(endpointIndex)?.paramInformation;\n }\n}\n/**\n * Returns the distinct parameter numbers in a ParamInfoMap. Partial parameters share a\n * parameter number and are collapsed to a single entry, since they are queried together.\n */\nexport function getDistinctConfigParameters(paramInfo: ParamInfoMap): number[] {\n return distinct([...paramInfo.keys()].map((key) => key.parameter));\n}\n/**\n * Returns the distinct readable (non-write-only) parameter numbers in a ParamInfoMap.\n * These are the parameters whose value is queried during the interview.\n */\nexport function getReadableConfigParameters(paramInfo: ParamInfoMap): number[] {\n return distinct([...paramInfo.keys()]\n .filter((key) => !paramInfo.get(key)?.writeOnly)\n .map((key) => key.parameter));\n}\n/**\n * Estimates the number of device queries the Configuration interview performs,\n * depending on CC versions, availability of a config files, and compat flags.\n */\nfunction estimateConfigurationInterviewQueryCount(paramInfo: ParamInfoMap | undefined, ccVersion: number, assumedParamCount: number, skipNameQuery: boolean, skipInfoQuery: boolean): number {\n if (paramInfo?.size) {\n // Before V3, only the value of each readable parameter is queried\n if (ccVersion < 3)\n return getReadableConfigParameters(paramInfo).length;\n // On V3+, the properties of every parameter are queried (including write-only\n // ones, whose value is not), plus the value of each readable parameter. Name and\n // info are skipped for parameters documented in a config file.\n return getDistinctConfigParameters(paramInfo).length\n + getReadableConfigParameters(paramInfo).length;\n }\n // Before V3, only the value of each parameter is queried\n if (ccVersion < 3)\n return assumedParamCount;\n // On V3+, we query properties + value,\n const queriesPerParam = 2\n // optionally the name\n + (skipNameQuery ? 0 : 1)\n // and optionally the description\n + (skipInfoQuery ? 0 : 1);\n return assumedParamCount * queriesPerParam;\n}\n/** Builds a ConfigurationMetadata object from a ParamInformation entry */\nfunction configParamInfoToMetadata(info: ParamInformation): ConfigurationMetadata {\n return stripUndefined({\n // TODO: Make this smarter! (0...1 ==> boolean)\n type: \"number\",\n valueSize: info.valueSize,\n min: info.minValue,\n max: info.maxValue,\n allowed: info.allowed,\n default: info.defaultValue,\n recommended: info.recommendedValue,\n unit: info.unit,\n format: info.unsigned\n ? ConfigValueFormat.UnsignedInteger\n : ConfigValueFormat.SignedInteger,\n readable: !info.writeOnly,\n writeable: !info.readOnly,\n allowManualEntry: info.allowManualEntry,\n states: info.options.length > 0\n ? Object.fromEntries(info.options.map(({ label, value }) => [\n value.toString(),\n label,\n ]))\n : undefined,\n label: info.label,\n description: info.description,\n isFromConfig: true,\n destructive: info.destructive,\n purpose: info.purpose,\n } satisfies ConfigurationMetadata) as unknown as ConfigurationMetadata;\n}\n/**\n * Refreshes all stored configuration parameter metadata from the device config file.\n * This handles updates to existing params, addition of new params,\n * and removal/hiding of old params.\n */\nexport function refreshConfigParamMetadataFromConfigFile(ctx: GetValueDB & GetDeviceConfig, nodeId: number, endpointIndex: number): void {\n const paramInfo = getParamInformationFromConfigFile(ctx, nodeId, endpointIndex);\n const valueDB = ctx.getValueDB(nodeId);\n // Track which param keys exist in the current config\n const configParamKeys = new Set<string>();\n if (paramInfo) {\n for (const [param, info] of paramInfo.entries()) {\n const paramKey = `${param.parameter}:${param.valueBitMask ?? \"\"}`;\n configParamKeys.add(paramKey);\n const valueId = ConfigurationCCValues.paramInformation(param.parameter, param.valueBitMask).endpoint(endpointIndex);\n const existing = valueDB.getMetadata(valueId) as ConfigurationMetadata | undefined;\n if (info.hidden) {\n // Param is now hidden - remove metadata and value\n if (existing) {\n valueDB.setMetadata(valueId, undefined);\n valueDB.removeValue(valueId);\n }\n continue;\n }\n const newMeta = configParamInfoToMetadata(info);\n if (!existing || existing.isFromConfig) {\n // New param, or existing parameter that was previously populated\n // from the configuration file. Replace it entirely\n valueDB.setMetadata(valueId, newMeta);\n }\n else {\n // Device-reported param - overwrite informational fields\n // but preserve the device-reported valueSize and format\n const merged: ConfigurationMetadata = {\n ...existing,\n ...newMeta,\n valueSize: existing.valueSize,\n format: existing.format,\n };\n valueDB.setMetadata(valueId, merged);\n }\n }\n }\n // Remove params that are in ValueDB with isFromConfig but no longer in config\n for (const meta of valueDB.getAllMetadata(CommandClasses.Configuration)) {\n if (typeof meta.property !== \"number\"\n || (meta.endpoint ?? 0) !== endpointIndex) {\n continue;\n }\n const existing = meta.metadata as ConfigurationMetadata;\n if (!existing.isFromConfig)\n continue;\n const paramKey = `${meta.property}:${meta.propertyKey ?? \"\"}`;\n if (!configParamKeys.has(paramKey)) {\n valueDB.setMetadata(meta, undefined);\n valueDB.removeValue(meta);\n }\n }\n}\n@API(CommandClasses.Configuration)\nexport class ConfigurationCCAPI extends CCAPI {\n public supportsCommand(cmd: ConfigurationCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ConfigurationCommand.Get:\n case ConfigurationCommand.Set:\n return true; // This is mandatory\n case ConfigurationCommand.BulkGet:\n case ConfigurationCommand.BulkSet:\n return this.version >= 2;\n case ConfigurationCommand.NameGet:\n case ConfigurationCommand.InfoGet:\n case ConfigurationCommand.PropertiesGet:\n return this.version >= 3;\n case ConfigurationCommand.DefaultReset:\n return this.version >= 4;\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ConfigurationCCAPI, { property, propertyKey }, value) {\n // Config parameters are addressed with numeric properties/keys\n if (typeof property !== \"number\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (propertyKey != undefined && 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 let ccInstance: ConfigurationCC;\n const applHost = this.host;\n if (this.isSinglecast()) {\n ccInstance = createConfigurationCCInstance(this.endpoint);\n }\n else if (this.isMulticast()) {\n // Multicast is only possible if the parameter definition is the same on all target nodes\n const nodes = this.endpoint.node.physicalNodes;\n if (!nodes.every((node) => node\n .getEndpoint(this.endpoint.index)\n ?.supportsCC(CommandClasses.Configuration))) {\n throw new ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target endpoints to support Configuration CC!`, ZWaveErrorCodes.CC_Invalid);\n }\n // Figure out if all the relevant info is the same\n const paramInfos = this.endpoint.node.physicalNodes.map((node) => createConfigurationCCInstance(node.getEndpoint(this.endpoint.index)!).getParamInformation(this.host, property, propertyKey));\n if (!paramInfos.length\n || !paramInfos.every((info, index) => {\n if (index === 0)\n return true;\n return (info.valueSize === paramInfos[0].valueSize\n && info.format === paramInfos[0].format);\n })) {\n throw new ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target nodes to have the same parameter definition!`, ZWaveErrorCodes.CC_Invalid);\n }\n // If it is, just use the first node to create the CC instance\n ccInstance = createConfigurationCCInstance(this.endpoint);\n }\n else {\n throw new ZWaveError(`The setValue API for Configuration CC is not supported via broadcast!`, ZWaveErrorCodes.CC_NotSupported);\n }\n let { valueSize, format: valueFormat = ConfigValueFormat.SignedInteger, } = ccInstance.getParamInformation(applHost, property);\n let targetValue: number;\n if (propertyKey) {\n // This is a partial value, we need to update some bits only\n // Find out the correct value size\n if (!valueSize) {\n valueSize = ccInstance.getParamInformation(applHost, property, propertyKey).valueSize;\n }\n // Add the target value to the remaining partial values\n targetValue = ccInstance.composePartialParamValue(applHost, property, propertyKey, value);\n // Partial parameters are internally converted to unsigned values - update the valueFormat accordingly\n valueFormat = ConfigValueFormat.UnsignedInteger;\n }\n else {\n targetValue = value;\n }\n if (!valueSize) {\n // If there's no value size configured, figure out a matching value size\n valueSize = getMinIntegerSize(targetValue, valueFormat === ConfigValueFormat.SignedInteger);\n // Throw if the value is too large or too small\n if (!valueSize) {\n throw new ZWaveError(`The value ${targetValue} is not valid for configuration parameters!`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n // Make sure that the given value fits into the value size\n if (!isSafeValue(targetValue, valueSize, valueFormat)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(targetValue, property, valueSize, valueFormat);\n }\n const result = await this.set({\n parameter: property,\n value: targetValue,\n valueSize: valueSize as any,\n valueFormat,\n });\n if (!supervisedCommandSucceeded(result)\n && (this as ConfigurationCCAPI).isSinglecast()) {\n // Verify the current value after a delay, unless the command was supervised and successful\n (this as ConfigurationCCAPI).schedulePoll({ property, propertyKey }, targetValue, \n // Configuration changes are instant\n { transition: \"fast\" });\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ConfigurationCCAPI, { property, propertyKey }) {\n // Config parameters are addressed with numeric properties/keys\n if (typeof property !== \"number\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (propertyKey != undefined && typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return this.get(property, { valueBitMask: propertyKey });\n };\n }\n /**\n * Requests the current value of a given config parameter from the device.\n * This may timeout and return `undefined` if the node does not respond.\n * If the node replied with a different parameter number, a `ConfigurationCCError`\n * is thrown with the `argument` property set to the reported parameter number.\n */\n @validateArgs_ConfigurationCCAPI_get()\n public async get(parameter: number, options?: {\n valueBitMask?: number;\n allowUnexpectedResponse?: boolean;\n }): Promise<MaybeNotKnown<ConfigValue>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n // Two-byte parameter numbers can only be read using the BulkGet command\n if (parameter > 255) {\n const result = await this.getBulk([\n {\n parameter,\n bitMask: options?.valueBitMask,\n },\n ]);\n return result.find((r) => r.parameter === parameter)?.value;\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Get);\n const { valueBitMask, allowUnexpectedResponse } = options ?? {};\n const cc = new ConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n allowUnexpectedResponse,\n });\n const response = await this.host.sendCommand<ConfigurationCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n // Nodes may respond with a different parameter, e.g. if we\n // requested a non-existing one\n if (response.parameter === parameter) {\n if (!valueBitMask)\n return response.value;\n // If a partial parameter was requested, extract that value\n const paramInfo = cc.getParamInformation(this.host, response.parameter, valueBitMask);\n return parsePartial(response.value as any, valueBitMask, isSignedPartial(valueBitMask, paramInfo.format));\n }\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: `Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,\n direction: \"inbound\",\n level: \"error\",\n });\n throw new ConfigurationCCError(`The first existing parameter on this node is ${response.parameter}`, ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber, response.parameter);\n }\n /**\n * Requests the current value of the config parameters from the device.\n * When the node does not respond due to a timeout, the `value` in the returned array will be `undefined`.\n */\n @validateArgs_ConfigurationCCAPI_getBulk()\n public async getBulk(options: {\n parameter: number;\n bitMask?: number;\n }[]): Promise<{\n parameter: number;\n bitMask?: number;\n value: MaybeNotKnown<ConfigValue>;\n }[]> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n let values: ReadonlyMap<number, ConfigValue> | undefined;\n // If the parameters are consecutive, we may use BulkGet\n const distinctParameters = distinct(options.map((o) => o.parameter));\n if (this.supportsCommand(ConfigurationCommand.BulkGet)\n && isConsecutiveArray(distinctParameters)) {\n const cc = new ConfigurationCCBulkGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters: distinctParameters,\n });\n const response = await this.host.sendCommand<ConfigurationCCBulkReport>(cc, this.commandOptions);\n if (response)\n values = response.values;\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Get);\n const _values = new Map<number, ConfigValue>();\n for (const parameter of distinctParameters) {\n const cc = new ConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCReport>(cc, this.commandOptions);\n if (response) {\n _values.set(response.parameter, response.value);\n }\n }\n values = _values;\n }\n // Combine the returned values with the requested ones\n const cc = createConfigurationCCInstance(this.endpoint);\n return options.map((o) => {\n let value = values?.get(o.parameter);\n if (typeof value === \"number\" && o.bitMask) {\n const paramInfo = cc.getParamInformation(this.host, o.parameter, o.bitMask);\n value = parsePartial(value, o.bitMask, isSignedPartial(o.bitMask, paramInfo.format));\n }\n return { ...o, value };\n });\n }\n /**\n * Sets a new value for a given config parameter of the device.\n */\n @validateArgs_ConfigurationCCAPI_set()\n public async set(options: ConfigurationCCAPISetOptions): Promise<SupervisionResult | undefined> {\n // Two-byte parameter numbers can only be set using the BulkSet command\n if (options.parameter > 255) {\n return this.setBulk([options]);\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const normalized = normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, options);\n let value = normalized.value;\n if (normalized.bitMask) {\n const ccc = createConfigurationCCInstance(this.endpoint);\n value = ccc.composePartialParamValue(this.host, normalized.parameter, normalized.bitMask, normalized.value);\n }\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n resetToDefault: false,\n parameter: normalized.parameter,\n value,\n valueSize: normalized.valueSize,\n valueFormat: normalized.valueFormat,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Sets new values for multiple config parameters of the device. Uses the `BulkSet` command if supported, otherwise falls back to individual `Set` commands.\n */\n @validateArgs_ConfigurationCCAPI_setBulk()\n public async setBulk(values: ConfigurationCCAPISetOptions[]): Promise<SupervisionResult | undefined> {\n // Normalize the values so we can better work with them\n const normalized = values.map((v) => normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, v));\n // And merge multiple partials that belong the same \"full\" value\n const allParams = bulkMergePartialParamValues(this.host, this.endpoint, normalized);\n const canUseBulkSet = this.supportsCommand(ConfigurationCommand.BulkSet)\n // For Bulk Set we need consecutive parameters\n && isConsecutiveArray(allParams.map((v) => v.parameter))\n // and identical format\n && new Set(allParams.map((v) => v.valueFormat)).size === 1\n // and identical size\n && new Set(allParams.map((v) => v.valueSize)).size === 1;\n if (canUseBulkSet) {\n const cc = new ConfigurationCCBulkSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters: allParams.map((v) => v.parameter),\n valueSize: allParams[0].valueSize,\n valueFormat: allParams[0].valueFormat,\n values: allParams.map((v) => v.value),\n handshake: true,\n });\n // The handshake flag is set, so we expect a BulkReport in response\n const result = await this.host.sendCommand<ConfigurationCCBulkReport>(cc, this.commandOptions);\n // If we did receive a response, we also received the updated parameters,\n // so if any one was not accepted, we know by looking at the values.\n // Translate the result into a SupervisionResult by comparing the values\n if (result) {\n const sentValues = cc.values;\n const receivedValues = [...result.values.values()];\n const success = sentValues.length === receivedValues.length\n && sentValues.every((v, i) => v === receivedValues[i]);\n return {\n status: success\n ? SupervisionStatus.Success\n : SupervisionStatus.Fail,\n };\n }\n else {\n return undefined;\n }\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const supervisionResults: (SupervisionResult | undefined)[] = [];\n for (const { parameter, value, valueSize, valueFormat, } of allParams) {\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n value,\n valueSize,\n valueFormat,\n });\n supervisionResults.push(await this.host.sendCommand(cc, this.commandOptions));\n }\n return mergeSupervisionResults(supervisionResults);\n }\n }\n /**\n * Resets a configuration parameter to its default value.\n *\n * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)\n */\n @validateArgs_ConfigurationCCAPI_reset()\n public async reset(parameter: number): Promise<SupervisionResult | undefined> {\n // Two-byte parameter numbers can only be reset using the BulkSet command\n if (parameter > 255) {\n return this.resetBulk([parameter]);\n }\n // According to SDS14223 this flag SHOULD NOT be set\n // Because we don't want to test the behavior, we enforce that it MUST not be set\n // on legacy nodes\n if (this.version <= 3) {\n throw new ZWaveError(`Resetting configuration parameters to default MUST not be done on nodes implementing ConfigurationCC V3 or below!`, ZWaveErrorCodes\n .ConfigurationCC_NoResetToDefaultOnLegacyDevices);\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n resetToDefault: true,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Resets multiple configuration parameters to their default value. Uses BulkSet if supported, otherwise falls back to individual Set commands.\n *\n * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)\n */\n @validateArgs_ConfigurationCCAPI_resetBulk()\n public async resetBulk(parameters: number[]): Promise<SupervisionResult | undefined> {\n if (isConsecutiveArray(parameters)\n && this.supportsCommand(ConfigurationCommand.BulkSet)) {\n const cc = new ConfigurationCCBulkSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters,\n resetToDefault: true,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const CCs = distinct(parameters).map((parameter) => new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n resetToDefault: true,\n }));\n for (const cc of CCs) {\n await this.host.sendCommand(cc, this.commandOptions);\n }\n }\n }\n /** Resets all configuration parameters to their default value */\n public async resetAll(): Promise<void> {\n // This is dangerous - don't allow resetting all parameters via multicast\n this.assertPhysicalEndpoint(this.endpoint);\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.DefaultReset);\n const cc = new ConfigurationCCDefaultReset({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_ConfigurationCCAPI_getProperties()\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getProperties(parameter: number) {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCPropertiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCPropertiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"valueSize\",\n \"valueFormat\",\n \"minValue\",\n \"maxValue\",\n \"defaultValue\",\n \"nextParameter\",\n \"altersCapabilities\",\n \"isReadonly\",\n \"isAdvanced\",\n \"noBulkSupport\",\n ]);\n }\n }\n /** Requests the name of a configuration parameter from the node */\n @validateArgs_ConfigurationCCAPI_getName()\n public async getName(parameter: number): Promise<MaybeNotKnown<string>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCNameGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCNameReport>(cc, this.commandOptions);\n return response?.name;\n }\n /** Requests usage info for a configuration parameter from the node */\n @validateArgs_ConfigurationCCAPI_getInfo()\n public async getInfo(parameter: number): Promise<MaybeNotKnown<string>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCInfoGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCInfoReport>(cc, this.commandOptions);\n return response?.info;\n }\n /**\n * This scans the node for the existing parameters. Found parameters will be reported\n * through the `value added` and `value updated` events.\n *\n * WARNING: This method throws for newer devices.\n *\n * WARNING: On nodes implementing V1 and V2, this process may take\n * **up to an hour**, depending on the configured timeout.\n *\n * WARNING: On nodes implementing V2, all parameters after 255 will be ignored.\n */\n public async scanParametersLegacy(): Promise<void> {\n if (this.version >= 3) {\n throw new ZWaveError(\"Use ConfigurationCC.interview instead of scanning parameters for versions 3 and above.\", ZWaveErrorCodes.ConfigurationCC_NoLegacyScanOnNewDevices);\n }\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n // TODO: Reduce the priority of the messages\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: `Scanning available parameters...`,\n });\n const ccInstance = createConfigurationCCInstance(this.endpoint);\n for (let param = 1; param <= 255; param++) {\n // Check if the parameter is readable\n let originalValue: ConfigValue | undefined;\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: ` trying param ${param}...`,\n direction: \"outbound\",\n });\n try {\n originalValue = await this.get(param, {\n // When requesting a non-existing parameter, a node SHOULD respond with the\n // first available parameter. We use this for the first param only,\n // because delayed responses might otherwise confuse the interview process\n allowUnexpectedResponse: param === 1,\n });\n if (originalValue != undefined) {\n const logMessage = ` Param ${param}:\n readable = true\n valueSize = ${ccInstance.getParamInformation(this.host, param)\n .valueSize}\n value = ${originalValue.toString()}`;\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n catch (e) {\n if (e instanceof ConfigurationCCError\n && e.code\n === ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber) {\n // Continue iterating with the next param\n if (e.argument - 1 > param)\n param = e.argument - 1;\n continue;\n }\n throw e;\n }\n }\n }\n}\n@commandClass(CommandClasses.Configuration)\n@implementedVersion(4)\n@ccValues(ConfigurationCCValues)\nexport class ConfigurationCC extends CommandClass {\n declare ccCommand: ConfigurationCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Configuration, 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 const deviceConfig = ctx.getDeviceConfig?.(node.id);\n const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);\n if (paramInfo) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `${this.constructor.name}: Loading configuration parameters from device config`,\n direction: \"none\",\n });\n this.deserializeParamInformationFromConfig(ctx, paramInfo);\n }\n const documentedParamNumbers = new Set(Array.from(paramInfo?.keys() ?? []).map((k) => k.parameter));\n // Fraction of the Configuration progress slice filled by the v3+ parameter scan.\n // The value refresh below fills the remainder, so each value query advances progress.\n let configScanProgress = 0;\n if (api.version >= 3) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"finding first configuration parameter...\",\n direction: \"outbound\",\n });\n const param0props = await api.getProperties(0);\n let param: number;\n if (param0props) {\n param = param0props.nextParameter;\n if (param === 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `didn't report any config params, trying #1 just to be sure...`,\n direction: \"inbound\",\n });\n param = 1;\n }\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Finding first configuration parameter timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n // Estimate (or calculate) the total number of queries needed during the interview.\n const expectedQueryCount = estimateConfigurationInterviewQueryCount(paramInfo, api.version, node.getInterviewProgressWeight(CommandClasses.Configuration), !!deviceConfig?.compat?.skipConfigurationNameQuery, !!deviceConfig?.compat?.skipConfigurationInfoQuery);\n let scannedQueries = 0;\n while (param > 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${param} information...`,\n direction: \"outbound\",\n });\n // Query properties and the next param\n const props = await api.getProperties(param).catch(\n // If querying the properties fails, don't abort the entire interview\n () => undefined);\n if (!props) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Querying parameter #${param} information timed out, skipping scan...`,\n level: \"warn\",\n });\n break;\n }\n const { nextParameter, ...properties } = props;\n node.reportInterviewProgress(++scannedQueries, expectedQueryCount);\n let logMessage: string | LogPayload;\n if (properties.valueSize === 0) {\n logMessage =\n `Parameter #${param} is unsupported. Next parameter: ${nextParameter}`;\n }\n else {\n let name: string | undefined;\n // Query the name and info for parameters that are NOT defined in a config file\n if (!documentedParamNumbers.has(param)) {\n // Skip the name query for bugged devices\n if (!deviceConfig?.compat?.skipConfigurationNameQuery) {\n name = await api.getName(param).catch(\n // If querying the name fails, don't abort the entire interview\n () => undefined);\n node.reportInterviewProgress(++scannedQueries, expectedQueryCount);\n }\n // Skip the info query for bugged devices\n if (!deviceConfig?.compat?.skipConfigurationInfoQuery) {\n await api.getInfo(param).catch(\n // If querying the info fails, don't abort the entire interview\n () => undefined);\n node.reportInterviewProgress(++scannedQueries, expectedQueryCount);\n }\n }\n logMessage = logText(`received information for parameter #${param}:`, {\n nested: logDict({\n \"parameter name\": name || undefined,\n \"value format\": getEnumMemberName(ConfigValueFormat, properties.valueFormat),\n \"value size\": `${properties.valueSize} bytes`,\n \"min value\": properties.minValue?.toString()\n ?? \"undefined\",\n \"max value\": properties.maxValue?.toString()\n ?? \"undefined\",\n \"default value\": properties.defaultValue?.toString()\n ?? \"undefined\",\n \"is read-only\": !!properties.isReadonly,\n \"is advanced (UI)\": !!properties.isAdvanced,\n \"has bulk support\": !properties.noBulkSupport,\n \"alters capabilities\": !!properties\n .altersCapabilities,\n }),\n });\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n // Some devices report their parameter 1 instead of 0 as the next one\n // when reaching the end. To avoid infinite loops, stop scanning\n // once the next parameter is lower than the current one\n if (nextParameter > param) {\n param = nextParameter;\n }\n else {\n break;\n }\n }\n configScanProgress = Math.min(1, scannedQueries / expectedQueryCount);\n }\n await this.refreshValues(ctx, {\n tag: \"interview\",\n onProgress: (completed, total) => {\n // To support reporting granular progress for devices where we don't\n // know the parameter count in advance, we let the scan phase\n // fill up the progress and map the value queries into the remainder.\n //\n // For devices with known parameter counts, this mapping is uniform.\n // For other devices it may yield larger, smaller, or no progress at all,\n // depending on the actual parameter count.\n const fraction = total > 0\n ? configScanProgress\n + (completed / total) * (1 - configScanProgress)\n : configScanProgress;\n node.reportInterviewProgress(fraction, 1);\n },\n });\n // Apply recommended values from device config\n if (paramInfo !== undefined\n && ctx.getInterviewOptions().applyRecommendedConfigParamValues\n === true) {\n await this.applyRecommendedValues(ctx, node, paramInfo, api);\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n /**\n * Applies all recommended values from the device config to this node\n * Applies only if the current value is still the default value and\n * the recommended value is different\n */\n private async applyRecommendedValues(ctx: InterviewContext, node: NodeId, paramInfo: ParamInfoMap, api: ConfigurationCCAPI): Promise<void> {\n const parametersNeededUpdate: ConfigurationCCAPISetOptions[] = [];\n // Find parameters for which current value doesn't match the recommended value\n for (const [paramKey, param] of paramInfo) {\n if (param.recommendedValue === undefined\n || param.defaultValue === param.recommendedValue)\n continue;\n // Get the current value of this parameter from the device\n const currentValue = this.getValue(ctx, ConfigurationCCValues.paramInformation(paramKey.parameter, paramKey.valueBitMask));\n // If the current value is the default value (i.e. it was never changed by the user)\n // and the recommended value is different, we should update it\n if (currentValue === param.defaultValue\n && currentValue !== param.recommendedValue) {\n const baseParam = {\n parameter: paramKey.parameter,\n value: param.recommendedValue,\n };\n parametersNeededUpdate.push(param.valueBitMask !== undefined\n ? { ...baseParam, bitMask: param.valueBitMask }\n : baseParam);\n }\n }\n if (parametersNeededUpdate.length === 0)\n return;\n // Log what we're about to do\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(\"Applying recommended config parameter values during interview:\", {\n nested: logList(parametersNeededUpdate.map((param) => {\n const formatterBitMask = param.bitMask\n ? `[0x${num2hex(param.bitMask)}]`\n : \"\";\n const fullParamKey = `${param.parameter}${formatterBitMask}`;\n return `#${fullParamKey} => ${param.value}`;\n })),\n }),\n direction: \"none\",\n });\n await api.setBulk(parametersNeededUpdate);\n await api.getBulk(parametersNeededUpdate.map((param) => ({\n parameter: param.parameter,\n bitMask: param.bitMask,\n })));\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Configuration, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n if (api.version < 3) {\n // V1/V2: Query all values defined in the config file\n const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);\n if (paramInfo?.size) {\n const parametersToQuery = getReadableConfigParameters(paramInfo);\n for (const [i, parameter] of parametersToQuery.entries()) {\n // Query the current value\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${parameter} value...`,\n direction: \"outbound\",\n });\n // ... at least try to\n const paramValue = await api.get(parameter);\n options?.onProgress?.(i + 1, parametersToQuery.length);\n if (typeof paramValue === \"number\") {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `parameter #${parameter} has value: ${paramValue}`,\n direction: \"inbound\",\n });\n }\n else if (!paramValue) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `received no value for parameter #${parameter}`,\n direction: \"inbound\",\n level: \"warn\",\n });\n }\n }\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `${this.constructor.name}: skipping interview because CC version is < 3 and there is no config file`,\n direction: \"none\",\n });\n }\n }\n else {\n // V3+: Query the values of discovered parameters\n const parameters = distinct(this.getDefinedValueIDs(ctx)\n .map((v) => v.property)\n .filter((p) => typeof p === \"number\"));\n for (const [i, param] of parameters.entries()) {\n if (this.getParamInformation(ctx, param).readable !== false) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${param} value...`,\n direction: \"outbound\",\n });\n await api.get(param);\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `not querying parameter #${param} value, because it is writeonly`,\n direction: \"none\",\n });\n }\n options?.onProgress?.(i + 1, parameters.length);\n }\n }\n }\n /**\n * Whether this node's param information was loaded from a config file.\n * If this is true, we don't trust what the node reports\n */\n protected paramExistsInConfigFile(ctx: GetValueDB & GetDeviceConfig, parameter: number, valueBitMask?: number): boolean {\n if (this.getValue(ctx, ConfigurationCCValues.isParamInformationFromConfig) !== true) {\n return false;\n }\n const paramInformation = getParamInformationFromConfigFile(ctx, this.nodeId as number, this.endpointIndex);\n if (!paramInformation)\n return false;\n // Check if the param is defined in the config file, either as a normal param or a partial\n if (paramInformation.has({ parameter, valueBitMask })) {\n return true;\n }\n else if (valueBitMask == undefined) {\n // Also consider partials when looking for plain params\n for (const key of paramInformation.keys()) {\n if (key.parameter === parameter)\n return true;\n }\n }\n return false;\n }\n /**\n * @internal\n * Stores config parameter metadata for this CC's node\n */\n public extendParamInformation(ctx: GetValueDB & GetDeviceConfig, parameter: number, valueBitMask: number | undefined, info: Partial<ConfigurationMetadata>): void {\n // Don't trust param information that a node reports if we have already loaded it from a config file\n if (valueBitMask === undefined\n && this.paramExistsInConfigFile(ctx, parameter)) {\n return;\n }\n // Retrieve the base metadata\n const metadata = this.getParamInformation(ctx, parameter, valueBitMask);\n // Override it with new data\n Object.assign(metadata, info);\n // And store it back\n this.setMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask), metadata);\n }\n /**\n * @internal\n * Returns stored config parameter metadata for this CC's node\n */\n public getParamInformation(ctx: GetValueDB, parameter: number, valueBitMask?: number): ConfigurationMetadata {\n return (this.getMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask)) ?? {\n ...ValueMetadata.Number,\n });\n }\n /**\n * **INTERNAL:** Returns the param info that was queried for this node. This returns the information that was returned by the node\n * and does not include partial parameters.\n */\n public getQueriedParamInfos(ctx: GetValueDB & GetSupportedCCVersion & GetDeviceConfig & GetNode<NodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>): Record<number, ConfigurationMetadata> {\n const parameters = distinct(this.getDefinedValueIDs(ctx)\n .map((v) => v.property)\n .filter((p) => typeof p === \"number\"));\n return Object.fromEntries(parameters.map((p) => [\n p as any,\n this.getParamInformation(ctx, p),\n ]));\n }\n /**\n * Returns stored config parameter metadata for all partial config params addressed with the given parameter number\n */\n public getPartialParamInfos(ctx: GetValueDB, parameter: number): (ValueID & {\n metadata: ConfigurationMetadata;\n })[] {\n const valueDB = this.getValueDB(ctx);\n return valueDB.findMetadata((id) => id.commandClass === this.ccId\n && (id.endpoint ?? 0) === this.endpointIndex\n && id.property === parameter\n && id.propertyKey != undefined) as (ValueID & {\n metadata: ConfigurationMetadata;\n })[];\n }\n /**\n * Computes the full value of a parameter after applying a partial param value\n */\n public composePartialParamValue(ctx: GetValueDB, parameter: number, bitMask: number, partialValue: number): number {\n return this.composePartialParamValues(ctx, parameter, [\n { bitMask, partialValue },\n ]);\n }\n /**\n * Computes the full value of a parameter after applying multiple partial param values\n */\n public composePartialParamValues(ctx: GetValueDB, parameter: number, partials: {\n bitMask: number;\n partialValue: number;\n }[]): number {\n const valueDB = this.getValueDB(ctx);\n // Add the other values together\n const otherValues = valueDB.findValues((id) => id.commandClass === this.ccId\n && (id.endpoint ?? 0) === this.endpointIndex\n && id.property === parameter\n && id.propertyKey != undefined\n && !partials.some((p) => id.propertyKey === p.bitMask));\n let ret = 0;\n for (const { propertyKey: bitMask, value: partialValue, } of otherValues) {\n ret = encodePartial(ret, partialValue as number, bitMask as number);\n }\n for (const { bitMask, partialValue } of partials) {\n ret = encodePartial(ret, partialValue, bitMask);\n }\n return ret;\n }\n /** Deserializes the config parameter info from a config file */\n public deserializeParamInformationFromConfig(ctx: GetValueDB & GetDeviceConfig, config: ParamInfoMap): void {\n const valueDB = this.getValueDB(ctx);\n // Clear old param information\n for (const meta of valueDB.getAllMetadata(this.ccId)) {\n if (typeof meta.property === \"number\"\n && (meta.endpoint ?? 0) === this.endpointIndex) {\n // this is a param information, delete it\n valueDB.setMetadata(meta, undefined, \n // Don't emit the added/updated events, as this will spam applications with untranslated events\n { noEvent: true });\n }\n }\n // Allow overwriting the param info (mark it as unloaded)\n this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, false);\n for (const [param, info] of config.entries()) {\n // Skip hidden parameters entirely - don't create metadata or persist values\n if (info.hidden) {\n continue;\n }\n const paramInfo = configParamInfoToMetadata(info);\n this.extendParamInformation(ctx, param.parameter, param.valueBitMask, paramInfo);\n }\n // Remember that we loaded the param information from a config file\n this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, true);\n }\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey?: string | number): string | undefined {\n if (typeof property === \"number\"\n && (propertyKey == undefined || typeof propertyKey === \"number\")) {\n // This CC names all configuration parameters differently,\n // so no name for the property key is required\n return undefined;\n }\n return super.translateProperty(ctx, property, propertyKey);\n }\n public translateProperty(ctx: GetValueDB, property: string | number, propertyKey?: string | number): string {\n // Try to retrieve the configured param label\n if (typeof property === \"number\"\n && (propertyKey == undefined || typeof propertyKey === \"number\")) {\n const paramInfo = this.getParamInformation(ctx, property, propertyKey);\n if (paramInfo.label)\n return paramInfo.label;\n // fall back to paramXYZ[_key] if none is defined\n let ret = `param${property.toString().padStart(3, \"0\")}`;\n if (propertyKey != undefined) {\n ret += \"_\" + propertyKey.toString();\n }\n return ret;\n }\n return super.translateProperty(ctx, property, propertyKey);\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCReportOptions {\n parameter: number;\n value: ConfigValue;\n valueSize: number;\n valueFormat?: ConfigValueFormat;\n}\n@CCCommand(ConfigurationCommand.Report)\nexport class ConfigurationCCReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.value = options.value;\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCReport {\n // All fields must be present\n validatePayload(raw.payload.length > 2);\n const parameter = raw.payload[0];\n const valueSize = raw.payload[1] & 0b111;\n // Ensure we received a valid report\n validatePayload(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);\n // Default to parsing the value as SignedInteger, like the specs say.\n // We try to re-interpret the value in persistValues()\n const value = parseValue(raw.payload.subarray(2), valueSize, ConfigValueFormat.SignedInteger);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueSize,\n value,\n });\n }\n public parameter: number;\n public value: ConfigValue;\n public valueSize: number;\n private valueFormat?: ConfigValueFormat; // only used for serialization\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Skip hidden parameters entirely - don't persist values\n const paramInfo = getParamInformationFromConfigFile(ctx, this.nodeId as number, this.endpointIndex);\n if (paramInfo?.get({ parameter: this.parameter })?.hidden) {\n return true;\n }\n const ccVersion = getEffectiveCCVersion(ctx, this);\n // This parameter may be a partial param in the following cases:\n // * a config file defines it as such\n // * it was reported by the device as a bit field\n const partialParams = this.getPartialParamInfos(ctx, this.parameter);\n let cachedValueFormat: ConfigValueFormat | undefined;\n if (partialParams.length > 0) {\n // This is a partial param. All definitions should have the same format, so we just take the first one\n cachedValueFormat = partialParams[0].metadata.format;\n }\n else {\n // Check if the initial assumption of SignedInteger holds true\n const oldParamInformation = this.getParamInformation(ctx, this.parameter);\n cachedValueFormat = oldParamInformation.format;\n // On older CC versions, these reports may be the only way we can retrieve the value size\n // Therefore we store it here\n this.extendParamInformation(ctx, this.parameter, undefined, {\n valueSize: this.valueSize,\n });\n if (ccVersion < 3\n && !this.paramExistsInConfigFile(ctx, this.parameter)\n && oldParamInformation.min == undefined\n && oldParamInformation.max == undefined) {\n const isSigned = oldParamInformation.format == undefined\n || oldParamInformation.format\n === ConfigValueFormat.SignedInteger;\n this.extendParamInformation(ctx, this.parameter, undefined, getIntegerLimits(this.valueSize as any, isSigned));\n }\n }\n // We may have to re-interpret the value as unsigned, depending on the cached value format\n if (cachedValueFormat != undefined\n && cachedValueFormat !== ConfigValueFormat.SignedInteger) {\n // Re-interpret the value with the new format\n this.value = reInterpretSignedValue(this.value, this.valueSize, cachedValueFormat);\n }\n // And store the value itself\n // If we have partial config params defined, we need to split the value\n if (partialParams.length > 0) {\n for (const param of partialParams) {\n if (typeof param.propertyKey === \"number\") {\n this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter, param.propertyKey), parsePartial(this.value as any, param.propertyKey, isSignedPartial(param.propertyKey, param.metadata.format)));\n }\n }\n }\n else {\n // This is a single param\n this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter), this.value);\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.parameter, this.valueSize & 0b111],\n new Bytes(this.valueSize),\n ]);\n serializeValue(this.payload, 2, this.valueSize, this.valueFormat ?? ConfigValueFormat.SignedInteger, this.value);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n \"value size\": this.valueSize,\n value: configValueToString(this.value),\n },\n };\n }\n}\nfunction testResponseForConfigurationGet(sent: ConfigurationCCGet, received: ConfigurationCCReport) {\n // We expect a Configuration Report that matches the requested parameter\n return (sent.parameter === received.parameter || sent.allowUnexpectedResponse);\n}\n// @publicAPI\nexport interface ConfigurationCCGetOptions {\n parameter: number;\n /**\n * If this is `true`, responses with different parameters than expected are accepted\n * and treated as hints for the first parameter number.\n */\n allowUnexpectedResponse?: boolean;\n}\n@CCCommand(ConfigurationCommand.Get)\n@expectedCCResponse(ConfigurationCCReport, testResponseForConfigurationGet)\nexport class ConfigurationCCGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.allowUnexpectedResponse = options.allowUnexpectedResponse\n ?? false;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCGet {\n validatePayload(raw.payload.length >= 1);\n const parameter = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public allowUnexpectedResponse: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.parameter]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n// @publicAPI\nexport type ConfigurationCCSetOptions = {\n parameter: number;\n resetToDefault: true;\n} | {\n parameter: number;\n resetToDefault?: false;\n valueSize: number;\n /** How the value is encoded. Defaults to SignedInteger */\n valueFormat?: ConfigValueFormat;\n value: ConfigValue;\n};\n@CCCommand(ConfigurationCommand.Set)\n@useSupervision()\nexport class ConfigurationCCSet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCSetOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.resetToDefault = !!options.resetToDefault;\n if (!options.resetToDefault) {\n // TODO: Default to the stored value size\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat\n ?? ConfigValueFormat.SignedInteger;\n this.value = options.value;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCSet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload[0];\n const resetToDefault = !!(raw.payload[1] & 128);\n const valueSize: number | undefined = raw.payload[1] & 0b111;\n // Ensure we received a valid report\n validatePayload(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);\n // Parse the value as signed integer. We don't know the format here.\n const value: number | undefined = parseValue(raw.payload.subarray(2), valueSize, ConfigValueFormat.SignedInteger);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n resetToDefault,\n valueSize,\n value,\n });\n }\n public resetToDefault: boolean;\n public parameter: number;\n public valueSize: number | undefined;\n public valueFormat: ConfigValueFormat | undefined;\n public value: ConfigValue | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const valueSize = this.resetToDefault ? 1 : this.valueSize!;\n const payloadLength = 2 + valueSize;\n this.payload = Bytes.alloc(payloadLength, 0);\n this.payload[0] = this.parameter;\n this.payload[1] = (this.resetToDefault ? 128 : 0)\n | (valueSize & 0b111);\n if (!this.resetToDefault) {\n // Make sure that the given value fits into the value size\n if (typeof this.value === \"number\"\n && !isSafeValue(this.value, valueSize, this.valueFormat!)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(this.value, this.parameter, valueSize, this.valueFormat!);\n }\n try {\n serializeValue(this.payload, 2, valueSize, this.valueFormat!, this.value!);\n }\n catch (e) {\n tryCatchOutOfBoundsError(e as Error, this.value, this.parameter, valueSize, this.valueFormat!);\n }\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"parameter #\": this.parameter,\n \"reset to default\": this.resetToDefault,\n };\n if (this.valueSize != undefined) {\n message[\"value size\"] = this.valueSize;\n }\n if (this.valueFormat != undefined) {\n message[\"value format\"] = getEnumMemberName(ConfigValueFormat, this.valueFormat);\n }\n if (this.value != undefined) {\n message.value = configValueToString(this.value);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport type ConfigurationCCBulkSetOptions = {\n parameters: number[];\n handshake?: boolean;\n} & ({\n resetToDefault: true;\n} | {\n resetToDefault?: false;\n valueSize: number;\n valueFormat?: ConfigValueFormat;\n values: number[];\n});\nfunction getResponseForBulkSet(ctx: GetNode<NodeId & SupportsCC>, cc: ConfigurationCCBulkSet) {\n return cc.handshake ? ConfigurationCCBulkReport : undefined;\n}\n@CCCommand(ConfigurationCommand.BulkSet)\n@expectedCCResponse(getResponseForBulkSet)\n@useSupervision()\nexport class ConfigurationCCBulkSet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkSetOptions>) {\n super(options);\n this._parameters = options.parameters;\n if (this._parameters.length < 1) {\n throw new ZWaveError(`In a ConfigurationCC.BulkSet, parameters must be a non-empty array`, ZWaveErrorCodes.CC_Invalid);\n }\n else if (!isConsecutiveArray(this._parameters)) {\n throw new ZWaveError(`A ConfigurationCC.BulkSet can only be used for consecutive parameters`, ZWaveErrorCodes.CC_Invalid);\n }\n this._handshake = !!options.handshake;\n this._resetToDefault = !!options.resetToDefault;\n if (!!options.resetToDefault) {\n this._valueSize = 1;\n this._valueFormat = ConfigValueFormat.SignedInteger;\n this._values = this._parameters.map(() => 0);\n }\n else {\n this._valueSize = options.valueSize;\n this._valueFormat = options.valueFormat\n ?? ConfigValueFormat.SignedInteger;\n this._values = options.values;\n }\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): ConfigurationCCBulkSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new ConfigurationCCBulkSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n private _parameters: number[];\n public get parameters(): number[] {\n return this._parameters;\n }\n private _resetToDefault: boolean;\n public get resetToDefault(): boolean {\n return this._resetToDefault;\n }\n private _valueSize: number;\n public get valueSize(): number {\n return this._valueSize;\n }\n private _valueFormat: ConfigValueFormat;\n public get valueFormat(): ConfigValueFormat {\n return this._valueFormat;\n }\n private _values: number[];\n public get values(): number[] {\n return this._values;\n }\n private _handshake: boolean;\n public get handshake(): boolean {\n return this._handshake;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const valueSize = this._resetToDefault ? 1 : this.valueSize;\n const payloadLength = 4 + valueSize * this.parameters.length;\n this.payload = Bytes.alloc(payloadLength, 0);\n this.payload.writeUInt16BE(this.parameters[0], 0);\n this.payload[2] = this.parameters.length;\n this.payload[3] = (this._resetToDefault ? 128 : 0)\n | (this.handshake ? 64 : 0)\n | (valueSize & 0b111);\n if (!this._resetToDefault) {\n for (let i = 0; i < this.parameters.length; i++) {\n const value = this._values[i];\n const param = this._parameters[i];\n // Make sure that the given value fits into the value size\n if (!isSafeValue(value, valueSize, this._valueFormat)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(value, param, valueSize, this._valueFormat);\n }\n try {\n serializeValue(this.payload, 4 + i * valueSize, valueSize, this._valueFormat, value);\n }\n catch (e) {\n tryCatchOutOfBoundsError(e as Error, value, param, valueSize, this._valueFormat);\n }\n }\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n handshake: this.handshake,\n \"reset to default\": this.resetToDefault,\n \"value size\": this.valueSize,\n };\n if (this._values.length > 0) {\n message.values = logList(this._values.map((value, i) => `#${this._parameters[i]}: ${configValueToString(value)}`));\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ConfigurationCCBulkReportOptions {\n reportsToFollow: number;\n defaultValues: boolean;\n isHandshakeResponse: boolean;\n valueSize: number;\n values: Record<number, ConfigValue>;\n}\n@CCCommand(ConfigurationCommand.BulkReport)\nexport class ConfigurationCCBulkReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.reportsToFollow = options.reportsToFollow;\n this.defaultValues = options.defaultValues;\n this.isHandshakeResponse = options.isHandshakeResponse;\n this.valueSize = options.valueSize;\n for (const [param, value] of Object.entries(options.values)) {\n this._values.set(parseInt(param), value);\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCBulkReport {\n // Ensure we received enough bytes for the preamble\n validatePayload(raw.payload.length >= 5);\n const firstParameter = raw.payload.readUInt16BE(0);\n const numParams = raw.payload[2];\n const reportsToFollow = raw.payload[3];\n const defaultValues = !!(raw.payload[4] & 128);\n const isHandshakeResponse = !!(raw.payload[4] & 64);\n const valueSize = raw.payload[4] & 0b111;\n // Ensure the payload is long enough for all reported values\n validatePayload(raw.payload.length >= 5 + numParams * valueSize);\n const values: Record<number, ConfigValue> = {};\n for (let i = 0; i < numParams; i++) {\n const param = firstParameter + i;\n // Default to parsing the value as SignedInteger, like the specs say.\n // We try to re-interpret the value in persistValues()\n values[param] = parseValue(raw.payload.subarray(5 + i * valueSize), valueSize, ConfigValueFormat.SignedInteger);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n reportsToFollow,\n defaultValues,\n isHandshakeResponse,\n valueSize,\n values,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Store every received parameter\n for (let [parameter, value] of this._values.entries()) {\n // Check if the initial assumption of SignedInteger holds true\n const oldParamInformation = this.getParamInformation(ctx, parameter);\n if (oldParamInformation.format != undefined\n && oldParamInformation.format\n !== ConfigValueFormat.SignedInteger) {\n // Re-interpret the value with the new format\n value = reInterpretSignedValue(value, this.valueSize, oldParamInformation.format);\n this._values.set(parameter, value);\n }\n this.setValue(ctx, ConfigurationCCValues.paramInformation(parameter), value);\n }\n return true;\n }\n public reportsToFollow: number;\n public defaultValues: boolean;\n public isHandshakeResponse: boolean;\n public valueSize: number;\n private _values = new Map<number, ConfigValue>();\n public get values(): ReadonlyMap<number, ConfigValue> {\n return this._values;\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n return {};\n }\n public getRemainingSegments(): number | undefined {\n return this.reportsToFollow;\n }\n public mergePartialCCs(partials: ConfigurationCCBulkReport[], _ctx: CCParsingContext): Promise<void> {\n // Merge the values of all partial reports\n const merged = new Map<number, ConfigValue>();\n for (const partial of partials) {\n for (const [parameter, value] of partial._values) {\n merged.set(parameter, value);\n }\n }\n for (const [parameter, value] of this._values) {\n merged.set(parameter, value);\n }\n this._values = merged;\n return Promise.resolve();\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"handshake response\": this.isHandshakeResponse,\n \"default values\": this.defaultValues,\n \"value size\": this.valueSize,\n \"reports to follow\": this.reportsToFollow,\n };\n if (this._values.size > 0) {\n message.values = [...this._values]\n .map(([param, value]) => `\n\u00B7 #${param}: ${configValueToString(value)}`)\n .join(\"\");\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ConfigurationCCBulkGetOptions {\n parameters: number[];\n}\n@CCCommand(ConfigurationCommand.BulkGet)\n@expectedCCResponse(ConfigurationCCBulkReport)\nexport class ConfigurationCCBulkGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkGetOptions>) {\n super(options);\n this._parameters = options.parameters.toSorted((a, b) => a - b);\n if (!isConsecutiveArray(this.parameters)) {\n throw new ZWaveError(`A ConfigurationCC.BulkGet can only be used for consecutive parameters`, ZWaveErrorCodes.CC_Invalid);\n }\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): ConfigurationCCBulkGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new ConfigurationCCBulkGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n private _parameters: number[];\n public get parameters(): number[] {\n return this._parameters;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(3);\n this.payload.writeUInt16BE(this.parameters[0], 0);\n this.payload[2] = this.parameters.length;\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { parameters: this.parameters.join(\", \") },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCNameReportOptions {\n parameter: number;\n name: string;\n reportsToFollow: number;\n}\n@CCCommand(ConfigurationCommand.NameReport)\nexport class ConfigurationCCNameReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCNameReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.name = options.name;\n this.reportsToFollow = options.reportsToFollow;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCNameReport {\n // Parameter and # of reports must be present\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const reportsToFollow = raw.payload[2];\n if (reportsToFollow > 0) {\n // If more reports follow, the info must at least be one byte\n validatePayload(raw.payload.length >= 4);\n }\n const name: string = raw.payload.subarray(3).toString(\"utf8\");\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n reportsToFollow,\n name,\n });\n }\n public readonly parameter: number;\n public name: string;\n public readonly reportsToFollow: number;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Bitfield parameters that are not documented in a config file\n // are split into multiple partial parameters. We need to set the name for\n // all of them.\n const partialParams = this.getPartialParamInfos(ctx, this.parameter);\n if (partialParams.length === 0) {\n this.extendParamInformation(ctx, this.parameter, undefined, {\n label: this.name,\n });\n }\n else {\n for (const param of partialParams) {\n const paramNumber = param.property as number;\n const bitMask = param.propertyKey as number;\n const bitNumber = Math.log2(bitMask) % 1 === 0\n ? Math.log2(bitMask)\n : undefined;\n let label = `${this.name} - ${bitMask}`;\n if (bitNumber != undefined) {\n label += ` (bit ${bitNumber})`;\n }\n this.extendParamInformation(ctx, paramNumber, bitMask, {\n label,\n });\n }\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const nameBuffer = Bytes.from(this.name, \"utf8\");\n this.payload = new Bytes(3 + nameBuffer.length);\n this.payload.writeUInt16BE(this.parameter, 0);\n this.payload[2] = this.reportsToFollow;\n this.payload.set(nameBuffer, 3);\n return super.serialize(ctx);\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n // Distinguish sessions by the parameter number\n return { parameter: this.parameter };\n }\n public getRemainingSegments(): number | undefined {\n return this.reportsToFollow;\n }\n public mergePartialCCs(partials: ConfigurationCCNameReport[], _ctx: CCParsingContext): Promise<void> {\n // Concat the name\n this.name = [...partials, this]\n .map((report) => report.name)\n .reduce((prev, cur) => prev + cur, \"\");\n return Promise.resolve();\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n name: this.name,\n \"reports to follow\": this.reportsToFollow,\n },\n };\n }\n}\n@CCCommand(ConfigurationCommand.NameGet)\n@expectedCCResponse(ConfigurationCCNameReport)\nexport class ConfigurationCCNameGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCNameGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCInfoReportOptions {\n parameter: number;\n info: string;\n reportsToFollow: number;\n}\n@CCCommand(ConfigurationCommand.InfoReport)\nexport class ConfigurationCCInfoReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCInfoReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.info = options.info;\n this.reportsToFollow = options.reportsToFollow;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCInfoReport {\n // Parameter and # of reports must be present\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const reportsToFollow = raw.payload[2];\n if (reportsToFollow > 0) {\n // If more reports follow, the info must at least be one byte\n validatePayload(raw.payload.length >= 4);\n }\n const info: string = raw.payload.subarray(3).toString(\"utf8\");\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n reportsToFollow,\n info,\n });\n }\n public readonly parameter: number;\n public info: string;\n public readonly reportsToFollow: number;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Bitfield parameters that are not documented in a config file\n // are split into multiple partial parameters. We need to set the description for\n // all of them. However, these can get very long, so we put the reported\n // description on the first partial param, and refer to it from the others\n const partialParams = this.getPartialParamInfos(ctx, this.parameter).toSorted((a, b) => ((a.propertyKey as number) ?? 0)\n - ((b.propertyKey as number) ?? 0));\n if (partialParams.length === 0) {\n this.extendParamInformation(ctx, this.parameter, undefined, {\n description: this.info,\n });\n }\n else {\n let firstParamLabel: string | undefined;\n for (const param of partialParams) {\n const paramNumber = param.property as number;\n const bitMask = param.propertyKey as number;\n // We put the description on the first partial param\n const description = firstParamLabel\n ? `Refer to ${firstParamLabel}`\n : this.info;\n this.extendParamInformation(ctx, paramNumber, bitMask, {\n description,\n });\n // Then we store the name of the first param to refer to it on the\n // following partial params\n if (firstParamLabel == undefined) {\n firstParamLabel =\n this.getParamInformation(ctx, paramNumber, bitMask)\n .label ?? `parameter ${paramNumber} - ${bitMask}`;\n }\n }\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const infoBuffer = Bytes.from(this.info, \"utf8\");\n this.payload = new Bytes(3 + infoBuffer.length);\n this.payload.writeUInt16BE(this.parameter, 0);\n this.payload[2] = this.reportsToFollow;\n this.payload.set(infoBuffer, 3);\n return super.serialize(ctx);\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n // Distinguish sessions by the parameter number\n return { parameter: this.parameter };\n }\n public getRemainingSegments(): number | undefined {\n return this.reportsToFollow;\n }\n public mergePartialCCs(partials: ConfigurationCCInfoReport[], _ctx: CCParsingContext): Promise<void> {\n // Concat the info\n this.info = [...partials, this]\n .map((report) => report.info)\n .reduce((prev, cur) => prev + cur, \"\");\n return Promise.resolve();\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n info: this.info,\n \"reports to follow\": this.reportsToFollow,\n },\n };\n }\n}\n@CCCommand(ConfigurationCommand.InfoGet)\n@expectedCCResponse(ConfigurationCCInfoReport)\nexport class ConfigurationCCInfoGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCInfoGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCPropertiesReportOptions {\n parameter: number;\n valueSize: number;\n valueFormat: ConfigValueFormat;\n minValue?: ConfigValue;\n maxValue?: ConfigValue;\n defaultValue?: ConfigValue;\n nextParameter: number;\n altersCapabilities?: boolean;\n isReadonly?: boolean;\n isAdvanced?: boolean;\n noBulkSupport?: boolean;\n}\n@CCCommand(ConfigurationCommand.PropertiesReport)\nexport class ConfigurationCCPropertiesReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCPropertiesReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat;\n if (this.valueSize > 0) {\n if (options.minValue == undefined) {\n throw new ZWaveError(\"The minimum value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n else if (options.maxValue == undefined) {\n throw new ZWaveError(\"The maximum value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n else if (options.defaultValue == undefined) {\n throw new ZWaveError(\"The default value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n this.minValue = options.minValue;\n this.maxValue = options.maxValue;\n this.defaultValue = options.defaultValue;\n }\n this.nextParameter = options.nextParameter;\n this.altersCapabilities = options.altersCapabilities;\n this.isReadonly = options.isReadonly;\n this.isAdvanced = options.isAdvanced;\n this.noBulkSupport = options.noBulkSupport;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCPropertiesReport {\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const valueFormat: ConfigValueFormat = (raw.payload[2] & 0b111000)\n >>> 3;\n const valueSize = raw.payload[2] & 0b111;\n // GH#1309 Some devices don't tell us the first parameter if we query #0\n // Instead, they contain 0x000000\n let nextParameter;\n if (valueSize === 0 && raw.payload.length < 5) {\n nextParameter = 0;\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueFormat,\n valueSize,\n nextParameter,\n });\n }\n // Ensure the payload contains the two bytes for next parameter\n const nextParameterOffset = 3 + 3 * valueSize;\n validatePayload(raw.payload.length >= nextParameterOffset + 2);\n let minValue: MaybeNotKnown<number>;\n let maxValue: MaybeNotKnown<number>;\n let defaultValue: MaybeNotKnown<number>;\n if (valueSize > 0) {\n if (valueFormat === ConfigValueFormat.BitField) {\n minValue = 0;\n }\n else {\n minValue = parseValue(raw.payload.subarray(3), valueSize, valueFormat);\n }\n maxValue = parseValue(raw.payload.subarray(3 + valueSize), valueSize, valueFormat);\n defaultValue = parseValue(raw.payload.subarray(3 + 2 * valueSize), valueSize, valueFormat);\n }\n nextParameter = raw.payload.readUInt16BE(nextParameterOffset);\n let altersCapabilities: MaybeNotKnown<boolean>;\n let isReadonly: MaybeNotKnown<boolean>;\n let isAdvanced: MaybeNotKnown<boolean>;\n let noBulkSupport: MaybeNotKnown<boolean>;\n if (raw.payload.length >= nextParameterOffset + 3) {\n // V4 adds an options byte after the next parameter and two bits in byte 2\n const options1 = raw.payload[2];\n const options2 = raw.payload[3 + 3 * valueSize + 2];\n altersCapabilities = !!(options1 & 128);\n isReadonly = !!(options1 & 64);\n isAdvanced = !!(options2 & 0b1);\n noBulkSupport = !!(options2 & 0b10);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueFormat,\n valueSize,\n nextParameter,\n minValue,\n maxValue,\n defaultValue,\n altersCapabilities,\n isReadonly,\n isAdvanced,\n noBulkSupport,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // If we actually received parameter info, store it\n if (this.valueSize > 0) {\n // The option fields only exist in V4+ reports.\n // Ignore them if the device advertises a lower version.\n const ccVersion = getEffectiveCCVersion(ctx, this);\n let altersCapabilities: MaybeNotKnown<boolean>;\n let isReadonly: MaybeNotKnown<boolean>;\n let isAdvanced: MaybeNotKnown<boolean>;\n let noBulkSupport: MaybeNotKnown<boolean>;\n if (ccVersion >= 4) {\n altersCapabilities = this.altersCapabilities;\n isReadonly = this.isReadonly;\n isAdvanced = this.isAdvanced;\n noBulkSupport = this.noBulkSupport;\n }\n const baseInfo = {\n type: \"number\",\n format: this.valueFormat,\n valueSize: this.valueSize,\n requiresReInclusion: altersCapabilities,\n readable: true,\n writeable: !isReadonly,\n allowManualEntry: true,\n isAdvanced,\n noBulkSupport,\n isFromConfig: false,\n } as const;\n if (this.valueFormat !== ConfigValueFormat.BitField) {\n // Do not override param information from a config file\n if (!this.paramExistsInConfigFile(ctx, this.parameter)) {\n const paramInfo = stripUndefined({\n ...baseInfo,\n min: this.minValue,\n max: this.maxValue,\n default: this.defaultValue,\n } as const satisfies ConfigurationMetadata);\n this.extendParamInformation(ctx, this.parameter, undefined, paramInfo);\n }\n }\n else {\n // Bit fields are split into multiple single-bit partial parameters\n const bits = this.maxValue!;\n let mask = 1;\n while (mask <= bits) {\n if (\n // Only create partials that exist\n !!(mask & bits)\n // Do not override param information from a config file\n && !this.paramExistsInConfigFile(ctx, this.parameter, mask)) {\n const paramInfo = stripUndefined({\n ...baseInfo,\n min: 0,\n max: 1,\n default: this.defaultValue! & mask ? 1 : 0,\n } as const satisfies ConfigurationMetadata);\n this.extendParamInformation(ctx, this.parameter, mask, paramInfo);\n }\n // We must use multiplication here, as bitwise shifting works on signed 32-bit integers in JS\n // which would create an infinite loop if maxValue === 0xffff_ffff\n mask *= 2;\n }\n }\n }\n return true;\n }\n public parameter: number;\n public valueSize: number;\n public valueFormat: ConfigValueFormat;\n public minValue: MaybeNotKnown<ConfigValue>;\n public maxValue: MaybeNotKnown<ConfigValue>;\n public defaultValue: MaybeNotKnown<ConfigValue>;\n public nextParameter: number;\n public altersCapabilities: MaybeNotKnown<boolean>;\n public isReadonly: MaybeNotKnown<boolean>;\n public isAdvanced: MaybeNotKnown<boolean>;\n public noBulkSupport: MaybeNotKnown<boolean>;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(3 // preamble\n + 3 * this.valueSize // min, max, default value\n + 2 // next parameter\n + 1);\n this.payload.writeUInt16BE(this.parameter, 0);\n const options1 = (this.altersCapabilities ? 128 : 0)\n | (this.isReadonly ? 64 : 0)\n | ((this.valueFormat & 0b111) << 3)\n | (this.valueSize & 0b111);\n this.payload[2] = options1;\n let offset = 3;\n if (this.valueSize > 0) {\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.minValue!);\n offset += this.valueSize;\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.maxValue!);\n offset += this.valueSize;\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.defaultValue!);\n offset += this.valueSize;\n }\n this.payload.writeUInt16BE(this.nextParameter, offset);\n offset += 2;\n const options2 = (this.isAdvanced ? 0b1 : 0)\n | (this.noBulkSupport ? 0b10 : 0);\n this.payload[offset] = options2;\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"parameter #\": this.parameter,\n \"next param #\": this.nextParameter,\n \"value size\": this.valueSize,\n \"value format\": getEnumMemberName(ConfigValueFormat, this.valueFormat),\n };\n if (this.minValue != undefined) {\n message[\"min value\"] = configValueToString(this.minValue);\n }\n if (this.maxValue != undefined) {\n message[\"max value\"] = configValueToString(this.maxValue);\n }\n if (this.defaultValue != undefined) {\n message[\"default value\"] = configValueToString(this.defaultValue);\n }\n if (this.altersCapabilities != undefined) {\n message[\"alters capabilities\"] = this.altersCapabilities;\n }\n if (this.isReadonly != undefined) {\n message.readonly = this.isReadonly;\n }\n if (this.isAdvanced != undefined) {\n message.advanced = this.isAdvanced;\n }\n if (this.noBulkSupport != undefined) {\n message[\"bulk support\"] = !this.noBulkSupport;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ConfigurationCommand.PropertiesGet)\n@expectedCCResponse(ConfigurationCCPropertiesReport)\nexport class ConfigurationCCPropertiesGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCPropertiesGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n@CCCommand(ConfigurationCommand.DefaultReset)\n@useSupervision()\nexport class ConfigurationCCDefaultReset extends ConfigurationCC {\n}\nfunction isSafeValue(value: number, size: number, format: ConfigValueFormat): boolean {\n let minValue: number;\n let maxValue: number;\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n minValue = -Math.pow(2, 8 * size - 1);\n maxValue = Math.pow(2, 8 * size - 1) - 1;\n break;\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n minValue = 0;\n maxValue = Math.pow(2, 8 * size);\n break;\n default:\n throw new Error(\"not implemented\");\n }\n return minValue <= value && value <= maxValue;\n}\n/** Interprets values from the payload depending on the value format */\nfunction parseValue(raw: Bytes, size: number, format: ConfigValueFormat): ConfigValue {\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n return raw.readIntBE(0, size);\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n return raw.readUIntBE(0, size);\n }\n}\nfunction throwInvalidValueError(value: any, parameter: number, valueSize: number, valueFormat: ConfigValueFormat): never {\n throw new ZWaveError(`The value ${value} is invalid for configuration parameter ${parameter} (size = ${valueSize}, format = ${getEnumMemberName(ConfigValueFormat, valueFormat)})!`, ZWaveErrorCodes.Argument_Invalid);\n}\nfunction tryCatchOutOfBoundsError(e: Error, value: any, parameter: number, valueSize: number, valueFormat: ConfigValueFormat): void {\n if (e.message.includes(\"out of bounds\")) {\n throwInvalidValueError(value, parameter, valueSize, valueFormat);\n }\n else {\n throw e;\n }\n}\n/** Serializes values into the payload according to the value format */\nfunction serializeValue(payload: Bytes, offset: number, size: number, format: ConfigValueFormat, value: ConfigValue): void {\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n payload.writeIntBE(value, offset, size);\n return;\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n payload.writeUIntBE(value, offset, size);\n return;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAGhC,kBAA+oB;AAC/oB,oBAAwD;AACxD,oBAAyB;AACzB,iBAAyM;AACzM,0BAAyK;AACzK,oCAAgH;AAEhH,mBAAuD;AAevD,gCAAsC;AAxBtC,MAAM,EAAE,qCAAqC,yCAAyC,qCAAqC,yCAAyC,uCAAuC,2CAA2C,+CAA+C,yCAAyC,wCAAuC,IAAK;AAW1X,SAAS,oBAAoB,OAAkB;AAC3C,MAAI,OAAO,UAAU;AACjB,WAAO,MAAM,SAAQ;;AAErB,WAAO,CAAC,GAAG,KAAK,EAAE,KAAK,IAAI;AACnC;AALS;AAMH,MAAO,6BAA6B,uBAAU;SAAA;;;EACb;EAAiC;EAAuC;EAA3G,YAAmC,SAA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