@zwave-js/cc 15.9.0 → 15.10.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.
@@ -15,7 +15,7 @@ export type SetValueImplementationHooks = AllOrNone<{
15
15
  }> & {
16
16
  optimisticallyUpdateRelatedValues?: (supervisedAndSuccessful: boolean) => void;
17
17
  forceVerifyChanges?: () => boolean;
18
- verifyChanges?: () => void | Promise<void>;
18
+ verifyChanges?: (result?: SupervisionResult) => void | Promise<void>;
19
19
  };
20
20
  export type SetValueImplementationHooksFactory = (property: ValueIDProperties, value: unknown, options?: SetValueAPIOptions) => SetValueImplementationHooks | undefined;
21
21
  /**
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/API.ts"],
4
- "sourcesContent": ["import type { SendCommand } from \"@zwave-js/cc\";\nimport type { CompatOverrideQueries, GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\ttype Duration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSafeCCVersion,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype HostIDs,\n\ttype ListenBehavior,\n\ttype LogNode,\n\ttype MaybeNotKnown,\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\tNOT_KNOWN,\n\ttype NodeId,\n\ttype PhysicalNodes,\n\ttype QueryNodeStatus,\n\ttype SecurityManagers,\n\ttype SendCommandOptions,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype TXReport,\n\ttype ValueChangeOptions,\n\ttype ValueDB,\n\ttype ValueID,\n\ttype VirtualEndpointId,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tstripUndefined,\n} from \"@zwave-js/core\";\nimport {\n\ttype AllOrNone,\n\ttype OnlyMethods,\n\tgetEnumMemberName,\n\tgetErrorMessage,\n\tnum2hex,\n} from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tgetAPI,\n\tgetCCValues,\n\tgetCommandClass,\n\tgetImplementedVersion,\n} from \"./CommandClassDecorators.js\";\nimport type { CCValue, StaticCCValue } from \"./Values.js\";\nimport type {\n\tGetRefreshValueTimeouts,\n\tGetUserPreferences,\n\tSchedulePoll,\n} from \"./traits.js\";\n\nexport type ValueIDProperties = Pick<ValueID, \"property\" | \"propertyKey\">;\n\n/** Used to identify the method on the CC API class that handles setting values on nodes directly */\nexport const SET_VALUE: unique symbol = Symbol.for(\"CCAPI_SET_VALUE\");\n\nexport type SetValueImplementation = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => Promise<SupervisionResult | undefined>;\n\nexport const SET_VALUE_HOOKS: unique symbol = Symbol.for(\n\t\"CCAPI_SET_VALUE_HOOKS\",\n);\n\nexport type SetValueImplementationHooks =\n\t& AllOrNone<{\n\t\t// Opt-in to and handle delayed supervision updates\n\t\tsupervisionDelayedUpdates: boolean;\n\t\tsupervisionOnSuccess: () => void | Promise<void>;\n\t\tsupervisionOnFailure: () => void | Promise<void>;\n\t}>\n\t& {\n\t\t// Optimistically update related cached values (if allowed)\n\t\toptimisticallyUpdateRelatedValues?: (\n\t\t\tsupervisedAndSuccessful: boolean,\n\t\t) => void;\n\t\t// Check if a verification of the set value is required, even if the API response suggests otherwise\n\t\tforceVerifyChanges?: () => boolean;\n\t\t// Verify the changes\n\t\tverifyChanges?: () => void | Promise<void>;\n\t};\n\nexport type SetValueImplementationHooksFactory = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => SetValueImplementationHooks | undefined;\n\n/**\n * A generic options bag for the `setValue` API.\n * Each implementation will choose the options that are relevant for it, so you can use the same options everywhere.\n * @publicAPI\n */\nexport type SetValueAPIOptions =\n\t& Partial<ValueChangeOptions>\n\t& Pick<SendCommandOptions, \"onProgress\">;\n\n/** Used to identify the method on the CC API class that handles polling values from nodes */\nexport const POLL_VALUE: unique symbol = Symbol.for(\"CCAPI_POLL_VALUE\");\nexport type PollValueImplementation<T = unknown> = (\n\tproperty: ValueIDProperties,\n) => Promise<T | undefined>;\n\n// Since the setValue API is called from a point with very generic parameters,\n// we must do narrowing inside the API calls. These three methods are for convenience\nexport function throwUnsupportedProperty(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${CommandClasses[cc]}: \"${property}\" is not a supported property`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwUnsupportedPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\tpropertyKey: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${propertyKey}\" is not a supported property key for property \"${property}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwMissingPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: property \"${property}\" requires a property key, but none was given`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwWrongValueType(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\texpectedType: string,\n\treceivedType: string,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${property}\" must be of type \"${expectedType}\", received \"${receivedType}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport interface CCAPISchedulePollOptions {\n\tduration?: Duration;\n\ttransition?: \"fast\" | \"slow\";\n}\n\n// Defines the necessary traits the host passed to a CC API must have\nexport type CCAPIHost<TNode extends CCAPINode = CCAPINode> =\n\t& HostIDs\n\t& GetNode<TNode>\n\t& GetValueDB\n\t& GetSupportedCCVersion\n\t& GetSafeCCVersion\n\t& SecurityManagers\n\t& GetDeviceConfig\n\t& SendCommand\n\t& GetRefreshValueTimeouts\n\t& GetUserPreferences\n\t& SchedulePoll\n\t& LogNode;\n\n// Defines the necessary traits a node passed to a CC API must have\nexport type CCAPINode = NodeId & ListenBehavior & QueryNodeStatus;\n\n// Defines the necessary traits an endpoint passed to a CC API must have\nexport type CCAPIEndpoint =\n\t& (\n\t\t| (\n\t\t\t// Physical endpoints must let us query their controlled CCs\n\t\t\tEndpointId & ControlsCC\n\t\t)\n\t\t| (\n\t\t\t// Virtual endpoints must let us query their physical nodes,\n\t\t\t// the CCs those nodes implement, and access the endpoints of those\n\t\t\t// physical nodes\n\t\t\tVirtualEndpointId & {\n\t\t\t\tnode: PhysicalNodes<\n\t\t\t\t\t& NodeId\n\t\t\t\t\t& SupportsCC\n\t\t\t\t\t& ControlsCC\n\t\t\t\t\t& GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t\t>;\n\t\t\t}\n\t\t)\n\t)\n\t& SupportsCC;\n\nexport type PhysicalCCAPIEndpoint = CCAPIEndpoint & EndpointId;\nexport type VirtualCCAPIEndpoint = CCAPIEndpoint & VirtualEndpointId;\n\n/**\n * The base class for all CC APIs exposed via `Node.commandClasses.<CCName>`\n * @publicAPI\n */\nexport class CCAPI {\n\tpublic constructor(\n\t\tprotected readonly host: CCAPIHost,\n\t\tprotected readonly endpoint: CCAPIEndpoint,\n\t) {\n\t\tthis.ccId = getCommandClass(this);\n\t}\n\n\tpublic static create<T extends CommandClasses>(\n\t\tccId: T,\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t\trequireSupport?: boolean,\n\t): CommandClasses extends T ? CCAPI : CCToAPI<T> {\n\t\tconst APIConstructor = getAPI(ccId);\n\t\tconst ccName = CommandClasses[ccId];\n\t\tif (APIConstructor == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Command Class ${ccName} (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tccId,\n\t\t\t\t\t)\n\t\t\t\t}) has no associated API!`,\n\t\t\t\tZWaveErrorCodes.CC_NoAPI,\n\t\t\t);\n\t\t}\n\t\tconst apiInstance = new APIConstructor(host, endpoint);\n\n\t\t// Only require support for physical endpoints by default\n\t\trequireSupport ??= !endpoint.virtual;\n\n\t\tif (requireSupport) {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn new Proxy(apiInstance, {\n\t\t\t\tget: (target, property) => {\n\t\t\t\t\t// Forbid access to the API if it is not supported by the node\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty !== \"ccId\"\n\t\t\t\t\t\t&& property !== \"endpoint\"\n\t\t\t\t\t\t&& property !== \"isSupported\"\n\t\t\t\t\t\t&& property !== \"withOptions\"\n\t\t\t\t\t\t&& property !== \"commandOptions\"\n\t\t\t\t\t\t&& !target.isSupported()\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet messageStart: string;\n\t\t\t\t\t\tif (endpoint.virtual) {\n\t\t\t\t\t\t\tconst hasNodeId =\n\t\t\t\t\t\t\t\ttypeof endpoint.nodeId === \"number\"\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST_LR;\n\t\t\t\t\t\t\tmessageStart = `${\n\t\t\t\t\t\t\t\thasNodeId ? \"The\" : \"This\"\n\t\t\t\t\t\t\t} virtual node${\n\t\t\t\t\t\t\t\thasNodeId ? ` ${endpoint.nodeId}` : \"\"\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmessageStart = `Node ${endpoint.nodeId}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t`${messageStart}${\n\t\t\t\t\t\t\t\tendpoint.index === 0\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: ` (endpoint ${endpoint.index})`\n\t\t\t\t\t\t\t} does not support the Command Class ${ccName}!`,\n\t\t\t\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If a device config defines overrides for an API call, return a wrapper method that applies them first before calling the actual method\n\t\t\t\t\tconst fallback = target[property as keyof CCAPI];\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof property === \"string\"\n\t\t\t\t\t\t&& !endpoint.virtual\n\t\t\t\t\t\t&& typeof fallback === \"function\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst overrides = host.getDeviceConfig?.(\n\t\t\t\t\t\t\tendpoint.nodeId,\n\t\t\t\t\t\t)?.compat?.overrideQueries;\n\t\t\t\t\t\tif (overrides?.hasOverride(ccId)) {\n\t\t\t\t\t\t\treturn overrideQueriesWrapper(\n\t\t\t\t\t\t\t\thost,\n\t\t\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\t\t\tccId,\n\t\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t\toverrides,\n\t\t\t\t\t\t\t\tfallback,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Else just access the property\n\t\t\t\t\treturn fallback;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn apiInstance;\n\t\t}\n\t}\n\n\t/**\n\t * The identifier of the Command Class this API is for\n\t */\n\tpublic readonly ccId: CommandClasses;\n\n\tprotected get [SET_VALUE](): SetValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Can be used on supported CC APIs to set a CC value by property name (and optionally the property key).\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get setValue(): SetValueImplementation | undefined {\n\t\treturn this[SET_VALUE];\n\t}\n\n\tprotected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory | undefined;\n\t/**\n\t * Can be implemented by CC APIs to influence the behavior of the setValue API in regards to Supervision and verifying values.\n\t */\n\tpublic get setValueHooks(): SetValueImplementationHooksFactory | undefined {\n\t\treturn this[SET_VALUE_HOOKS];\n\t}\n\n\t/** Whether a successful setValue call should imply that the value was successfully updated */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic isSetValueOptimistic(valueId: ValueID): boolean {\n\t\treturn true;\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\t/**\n\t * Can be used on supported CC APIs to poll a CC value by property name (and optionally the property key)\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get pollValue(): PollValueImplementation | undefined {\n\t\treturn this[POLL_VALUE];\n\t}\n\n\t/**\n\t * Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.\n\t * @returns `true` if the poll was scheduled, `false` otherwise\n\t */\n\tprotected schedulePoll(\n\t\t{ property, propertyKey }: ValueIDProperties,\n\t\texpectedValue: unknown,\n\t\t{ duration, transition = \"slow\" }: CCAPISchedulePollOptions = {},\n\t): boolean {\n\t\t// Figure out the delay. If a non-zero duration was given or this is a \"fast\" transition,\n\t\t// use/add the short delay. Otherwise, default to the long delay.\n\t\tconst durationMs = duration?.toMilliseconds() ?? 0;\n\t\tconst timeouts = this.host.getRefreshValueTimeouts();\n\t\tconst additionalDelay = !!durationMs || transition === \"fast\"\n\t\t\t? timeouts.refreshValueAfterTransition\n\t\t\t: timeouts.refreshValue;\n\t\tconst timeoutMs = durationMs + additionalDelay;\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst node = this.host.getNode(this.endpoint.nodeId);\n\t\t\tif (!node) return false;\n\n\t\t\treturn this.host.schedulePoll(\n\t\t\t\tnode.id,\n\t\t\t\t{\n\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t},\n\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t);\n\t\t} else if (this.isMulticast()) {\n\t\t\t// Only poll supporting nodes in multicast\n\t\t\tconst supportingNodes = this.endpoint.node.physicalNodes.filter(\n\t\t\t\t(node) =>\n\t\t\t\t\tnode\n\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t?.supportsCC(this.ccId),\n\t\t\t);\n\t\t\tlet ret = false;\n\t\t\tfor (const node of supportingNodes) {\n\t\t\t\tret ||= this.host.schedulePoll(\n\t\t\t\t\tnode.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t},\n\t\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn ret;\n\t\t} else {\n\t\t\t// Don't poll the broadcast node\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the version of the given CommandClass this endpoint implements\n\t */\n\tpublic get version(): number {\n\t\tif (this.isSinglecast()) {\n\t\t\treturn this.host.getSafeCCVersion(\n\t\t\t\tthis.ccId,\n\t\t\t\tthis.endpoint.nodeId,\n\t\t\t\tthis.endpoint.index,\n\t\t\t) ?? 0;\n\t\t} else {\n\t\t\treturn getImplementedVersion(this.ccId);\n\t\t}\n\t}\n\n\t/** Determines if this simplified API instance may be used. */\n\tpublic isSupported(): boolean {\n\t\treturn (\n\t\t\t// NoOperation is always supported\n\t\t\tthis.ccId === CommandClasses[\"No Operation\"]\n\t\t\t// Basic should always be supported. Since we are trying to hide it from library consumers\n\t\t\t// we cannot trust supportsCC to test it\n\t\t\t|| this.ccId === CommandClasses.Basic\n\t\t\t|| this.endpoint.supportsCC(this.ccId)\n\t\t);\n\t}\n\n\t/**\n\t * Determine whether the linked node supports a specific command of this command class.\n\t * {@link NOT_KNOWN} (`undefined`) means that the information has not been received yet\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic supportsCommand(command: number): MaybeNotKnown<boolean> {\n\t\t// This needs to be overwritten per command class. In the default implementation, we don't know anything!\n\t\treturn NOT_KNOWN;\n\t}\n\n\tprotected assertSupportsCommand(\n\t\tcommandEnum: unknown,\n\t\tcommand: number,\n\t): void {\n\t\tif (this.supportsCommand(command) !== true) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`${\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t\t? `Node #${this.endpoint.nodeId}`\n\t\t\t\t\t\t: \"This virtual node\"\n\t\t\t\t}${\n\t\t\t\t\tthis.endpoint.index > 0\n\t\t\t\t\t\t? ` (Endpoint ${this.endpoint.index})`\n\t\t\t\t\t\t: \"\"\n\t\t\t\t} does not support the command ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tcommandEnum,\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t)\n\t\t\t\t}!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected assertPhysicalEndpoint(\n\t\tendpoint: EndpointId | VirtualEndpointId,\n\t): asserts endpoint is EndpointId {\n\t\tif (endpoint.virtual) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`This method is not supported for virtual nodes!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Returns the command options to use for sendCommand calls */\n\tprotected get commandOptions(): SendCommandOptions {\n\t\t// No default options\n\t\treturn {};\n\t}\n\n\t/** Creates an instance of this API, scoped to use the given options */\n\tpublic withOptions(options: SendCommandOptions): this {\n\t\tconst mergedOptions = {\n\t\t\t...this.commandOptions,\n\t\t\t...options,\n\t\t};\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, property) => {\n\t\t\t\tif (property === \"commandOptions\") {\n\t\t\t\t\treturn mergedOptions;\n\t\t\t\t} else {\n\t\t\t\t\treturn (target as any)[property];\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Creates an instance of this API which (if supported) will return TX reports along with the result. */\n\tpublic withTXReport<T extends this>(): WithTXReport<T> {\n\t\tif (this.constructor === CCAPI) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The withTXReport method may only be called on specific CC API implementations.\",\n\t\t\t\tZWaveErrorCodes.Driver_NotSupported,\n\t\t\t);\n\t\t}\n\n\t\t// Remember which properties need to be proxied\n\t\tconst proxiedProps = new Set([\n\t\t\t// These are the CC-specific methods\n\t\t\t...Object.getOwnPropertyNames(this.constructor.prototype),\n\t\t\t// as well as setValue and pollValue\n\t\t\t\"setValue\",\n\t\t\t\"pollValue\",\n\t\t]);\n\t\tproxiedProps.delete(\"constructor\");\n\n\t\tfunction wrapResult<T>(result: T, txReport: TXReport): any {\n\t\t\t// Both the result and the TX report may be undefined (no response, no support)\n\t\t\treturn stripUndefined({\n\t\t\t\tresult,\n\t\t\t\ttxReport,\n\t\t\t});\n\t\t}\n\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, prop) => {\n\t\t\t\tif (prop === \"withTXReport\") return undefined;\n\n\t\t\t\tlet original: any = (target as any)[prop];\n\t\t\t\tif (\n\t\t\t\t\tproxiedProps.has(prop as string)\n\t\t\t\t\t&& typeof original === \"function\"\n\t\t\t\t) {\n\t\t\t\t\t// This is a method that only exists in the specific implementation\n\n\t\t\t\t\t// Wrap each call with its own API proxy, so we don't mix up TX reports\n\t\t\t\t\tlet txReport: TXReport;\n\t\t\t\t\tconst api = target.withOptions({\n\t\t\t\t\t\tonTXReport: (report) => {\n\t\t\t\t\t\t\t// Remember the last status report\n\t\t\t\t\t\t\ttxReport = report;\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\toriginal = (api as any)[prop].bind(api);\n\n\t\t\t\t\t// Return a wrapper function that will add the status report after the call is complete\n\t\t\t\t\treturn (...args: any) => {\n\t\t\t\t\t\tlet result = original(...args);\n\t\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\t\tresult = result.then((res) =>\n\t\t\t\t\t\t\t\twrapResult(res, txReport)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = wrapResult(result, txReport);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\treturn original;\n\t\t\t\t}\n\t\t\t},\n\t\t}) as any;\n\t}\n\n\tprotected isSinglecast(): this is this & {\n\t\tendpoint: PhysicalCCAPIEndpoint;\n\t} {\n\t\treturn (\n\t\t\t!this.endpoint.virtual\n\t\t\t&& typeof this.endpoint.nodeId === \"number\"\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST_LR\n\t\t);\n\t}\n\n\tprotected isMulticast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: number[];\n\t\t};\n\t} {\n\t\treturn this.endpoint.virtual && isArray(this.endpoint.nodeId);\n\t}\n\n\tprotected isBroadcast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR;\n\t\t};\n\t} {\n\t\treturn (\n\t\t\tthis.endpoint.virtual\n\t\t\t&& (this.endpoint.nodeId === NODE_ID_BROADCAST\n\t\t\t\t|| this.endpoint.nodeId === NODE_ID_BROADCAST_LR)\n\t\t);\n\t}\n\n\t/** Returns the value DB for this CC API's node (if it can be safely accessed) */\n\tprotected tryGetValueDB(): ValueDB | undefined {\n\t\tif (!this.isSinglecast()) return;\n\t\ttry {\n\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/** Returns the value DB for this CC's node (or throws if it cannot be accessed) */\n\tprotected getValueDB(): ValueDB {\n\t\tif (this.isSinglecast()) {\n\t\t\ttry {\n\t\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t\t} catch {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The node for this CC does not exist or the driver is not ready yet\",\n\t\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthrow new ZWaveError(\n\t\t\t\"Cannot retrieve the value DB for non-singlecast CCs\",\n\t\t\tZWaveErrorCodes.CC_NoNodeID,\n\t\t);\n\t}\n}\n\nfunction overrideQueriesWrapper(\n\tctx: GetValueDB & LogNode,\n\tendpoint: PhysicalCCAPIEndpoint,\n\tccId: CommandClasses,\n\tmethod: string,\n\toverrides: CompatOverrideQueries,\n\tfallback: (...args: any[]) => any,\n): (...args: any[]) => any {\n\t// We must not capture the `this` context here, because the API methods are bound on use\n\treturn function(this: any, ...args: any[]) {\n\t\tconst match = overrides.matchOverride(\n\t\t\tccId,\n\t\t\tendpoint.index,\n\t\t\tmethod,\n\t\t\targs,\n\t\t);\n\t\tif (!match) return fallback.call(this, ...args);\n\n\t\tctx.logNode(endpoint.nodeId, {\n\t\t\tmessage: `API call ${method} for ${\n\t\t\t\tgetCCName(\n\t\t\t\t\tccId,\n\t\t\t\t)\n\t\t\t} CC overridden by a compat flag.`,\n\t\t\tlevel: \"debug\",\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst ccValues = getCCValues(ccId);\n\t\tif (ccValues) {\n\t\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\n\t\t\tconst prop2value = (prop: string): CCValue | undefined => {\n\t\t\t\t// We use a simplistic parser to support dynamic value IDs:\n\t\t\t\t// If end with round brackets with something inside, they are considered dynamic\n\t\t\t\t// Otherwise static\n\t\t\t\tconst argsMatch = prop.match(/^(.*)\\((.*)\\)$/);\n\t\t\t\tif (argsMatch) {\n\t\t\t\t\tconst methodName = argsMatch[1];\n\t\t\t\t\tconst methodArgs = JSON.parse(`[${argsMatch[2]}]`);\n\n\t\t\t\t\tconst dynValue = ccValues[methodName];\n\t\t\t\t\tif (typeof dynValue === \"function\") {\n\t\t\t\t\t\treturn dynValue(...methodArgs);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst staticValue = ccValues[prop] as\n\t\t\t\t\t\t| StaticCCValue\n\t\t\t\t\t\t| undefined;\n\t\t\t\t\tif (typeof staticValue?.endpoint === \"function\") {\n\t\t\t\t\t\treturn staticValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Persist values if necessary\n\t\t\tif (match.persistValues) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, value] of Object.entries(\n\t\t\t\t\t\tmatch.persistValues,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setValue(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// As well as metadata\n\t\t\tif (match.extendMetadata) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, meta] of Object.entries(\n\t\t\t\t\t\tmatch.extendMetadata,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setMetadata(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...ccValue.meta,\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// API methods are always async\n\t\treturn Promise.resolve(match.result);\n\t};\n}\n\n/** A CC API that is only available for physical endpoints */\nexport class PhysicalCCAPI extends CCAPI {\n\tpublic constructor(\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t) {\n\t\tsuper(host, endpoint);\n\t\tthis.assertPhysicalEndpoint(endpoint);\n\t}\n\n\tdeclare protected readonly endpoint: PhysicalCCAPIEndpoint;\n}\n\nexport type APIConstructor<T extends CCAPI = CCAPI> = new (\n\thost: CCAPIHost,\n\tendpoint: CCAPIEndpoint,\n) => T;\n\n// This type is auto-generated by maintenance/generateCCAPIInterface.ts\n// Do not edit it by hand or your changes will be lost\ntype CCNameMap = {\n\t\"Alarm Sensor\": typeof CommandClasses[\"Alarm Sensor\"];\n\tAssociation: typeof CommandClasses[\"Association\"];\n\t\"Association Group Information\":\n\t\ttypeof CommandClasses[\"Association Group Information\"];\n\t\"Barrier Operator\": typeof CommandClasses[\"Barrier Operator\"];\n\tBasic: typeof CommandClasses[\"Basic\"];\n\t\"Basic Window Covering\": typeof CommandClasses[\"Basic Window Covering\"];\n\tBattery: typeof CommandClasses[\"Battery\"];\n\t\"Binary Sensor\": typeof CommandClasses[\"Binary Sensor\"];\n\t\"Binary Switch\": typeof CommandClasses[\"Binary Switch\"];\n\t\"CRC-16 Encapsulation\": typeof CommandClasses[\"CRC-16 Encapsulation\"];\n\t\"Central Scene\": typeof CommandClasses[\"Central Scene\"];\n\t\"Climate Control Schedule\":\n\t\ttypeof CommandClasses[\"Climate Control Schedule\"];\n\tClock: typeof CommandClasses[\"Clock\"];\n\t\"Color Switch\": typeof CommandClasses[\"Color Switch\"];\n\tConfiguration: typeof CommandClasses[\"Configuration\"];\n\t\"Device Reset Locally\": typeof CommandClasses[\"Device Reset Locally\"];\n\t\"Door Lock\": typeof CommandClasses[\"Door Lock\"];\n\t\"Door Lock Logging\": typeof CommandClasses[\"Door Lock Logging\"];\n\t\"Energy Production\": typeof CommandClasses[\"Energy Production\"];\n\t\"Entry Control\": typeof CommandClasses[\"Entry Control\"];\n\t\"Firmware Update Meta Data\":\n\t\ttypeof CommandClasses[\"Firmware Update Meta Data\"];\n\t\"Humidity Control Mode\": typeof CommandClasses[\"Humidity Control Mode\"];\n\t\"Humidity Control Operating State\":\n\t\ttypeof CommandClasses[\"Humidity Control Operating State\"];\n\t\"Humidity Control Setpoint\":\n\t\ttypeof CommandClasses[\"Humidity Control Setpoint\"];\n\t\"Inclusion Controller\": typeof CommandClasses[\"Inclusion Controller\"];\n\tIndicator: typeof CommandClasses[\"Indicator\"];\n\tIrrigation: typeof CommandClasses[\"Irrigation\"];\n\tLanguage: typeof CommandClasses[\"Language\"];\n\tLock: typeof CommandClasses[\"Lock\"];\n\t\"Manufacturer Proprietary\":\n\t\ttypeof CommandClasses[\"Manufacturer Proprietary\"];\n\t\"Manufacturer Specific\": typeof CommandClasses[\"Manufacturer Specific\"];\n\tMeter: typeof CommandClasses[\"Meter\"];\n\t\"Multi Channel Association\":\n\t\ttypeof CommandClasses[\"Multi Channel Association\"];\n\t\"Multi Channel\": typeof CommandClasses[\"Multi Channel\"];\n\t\"Multi Command\": typeof CommandClasses[\"Multi Command\"];\n\t\"Multilevel Sensor\": typeof CommandClasses[\"Multilevel Sensor\"];\n\t\"Multilevel Switch\": typeof CommandClasses[\"Multilevel Switch\"];\n\t\"No Operation\": typeof CommandClasses[\"No Operation\"];\n\t\"Node Naming and Location\":\n\t\ttypeof CommandClasses[\"Node Naming and Location\"];\n\tNotification: typeof CommandClasses[\"Notification\"];\n\tPowerlevel: typeof CommandClasses[\"Powerlevel\"];\n\tProtection: typeof CommandClasses[\"Protection\"];\n\t\"Scene Activation\": typeof CommandClasses[\"Scene Activation\"];\n\t\"Scene Actuator Configuration\":\n\t\ttypeof CommandClasses[\"Scene Actuator Configuration\"];\n\t\"Scene Controller Configuration\":\n\t\ttypeof CommandClasses[\"Scene Controller Configuration\"];\n\t\"Schedule Entry Lock\": typeof CommandClasses[\"Schedule Entry Lock\"];\n\t\"Security 2\": typeof CommandClasses[\"Security 2\"];\n\tSecurity: typeof CommandClasses[\"Security\"];\n\t\"Sound Switch\": typeof CommandClasses[\"Sound Switch\"];\n\tSupervision: typeof CommandClasses[\"Supervision\"];\n\t\"Thermostat Fan Mode\": typeof CommandClasses[\"Thermostat Fan Mode\"];\n\t\"Thermostat Fan State\": typeof CommandClasses[\"Thermostat Fan State\"];\n\t\"Thermostat Mode\": typeof CommandClasses[\"Thermostat Mode\"];\n\t\"Thermostat Operating State\":\n\t\ttypeof CommandClasses[\"Thermostat Operating State\"];\n\t\"Thermostat Setback\": typeof CommandClasses[\"Thermostat Setback\"];\n\t\"Thermostat Setpoint\": typeof CommandClasses[\"Thermostat Setpoint\"];\n\tTime: typeof CommandClasses[\"Time\"];\n\t\"Time Parameters\": typeof CommandClasses[\"Time Parameters\"];\n\t\"User Code\": typeof CommandClasses[\"User Code\"];\n\tVersion: typeof CommandClasses[\"Version\"];\n\t\"Wake Up\": typeof CommandClasses[\"Wake Up\"];\n\t\"Window Covering\": typeof CommandClasses[\"Window Covering\"];\n\t\"Z-Wave Plus Info\": typeof CommandClasses[\"Z-Wave Plus Info\"];\n};\nexport type CCToName<CC extends CommandClasses> = {\n\t[K in keyof CCNameMap]: CCNameMap[K] extends CC ? K : never;\n}[keyof CCNameMap];\n\nexport type CCNameOrId = CommandClasses | Extract<keyof CCAPIs, string>;\n\nexport type CCToAPI<CC extends CCNameOrId> = CC extends CommandClasses\n\t? CCToName<CC> extends keyof CCAPIs ? CCAPIs[CCToName<CC>]\n\t: never\n\t: CC extends keyof CCAPIs ? CCAPIs[CC]\n\t: never;\n\nexport type APIMethodsOf<CC extends CCNameOrId> = Omit<\n\tOnlyMethods<CCToAPI<CC>>,\n\t| \"ccId\"\n\t| \"getNode\"\n\t| \"tryGetNode\"\n\t| \"isSetValueOptimistic\"\n\t| \"isSupported\"\n\t| \"pollValue\"\n\t| \"setValue\"\n\t| \"version\"\n\t| \"supportsCommand\"\n\t| \"withOptions\"\n\t| \"withTXReport\"\n>;\n\nexport type OwnMethodsOf<API extends CCAPI> = Omit<\n\tOnlyMethods<API>,\n\tkeyof OnlyMethods<CCAPI>\n>;\n\n// Wraps the given type in an object that contains a TX report\nexport type WrapWithTXReport<T> = [T] extends [Promise<infer U>]\n\t? Promise<WrapWithTXReport<U>>\n\t: [T] extends [void] ? { txReport: TXReport | undefined }\n\t: { result: T; txReport: TXReport | undefined };\n\nexport type ReturnWithTXReport<T> = T extends (...args: any[]) => any\n\t? (...args: Parameters<T>) => WrapWithTXReport<ReturnType<T>>\n\t: undefined;\n\n// Converts the type of the given API implementation so the API methods return an object including the TX report\nexport type WithTXReport<API extends CCAPI> =\n\t& Omit<\n\t\tAPI,\n\t\tkeyof OwnMethodsOf<API> | \"withOptions\" | \"withTXReport\" | \"setValue\"\n\t>\n\t& {\n\t\t[\n\t\t\tK in\n\t\t\t\t| keyof OwnMethodsOf<API>\n\t\t\t\t| \"setValue\"\n\t\t\t\t| \"pollValue\"\n\t\t]: ReturnWithTXReport<API[K]>;\n\t};\n\nexport function normalizeCCNameOrId(\n\tccNameOrId: number | string,\n): CommandClasses | undefined {\n\tif (!(ccNameOrId in CommandClasses)) return undefined;\n\n\tlet ret: CommandClasses | undefined;\n\tif (typeof ccNameOrId === \"string\") {\n\t\tif (/^\\d+$/.test(ccNameOrId)) {\n\t\t\t// This can happen on property access\n\t\t\tret = +ccNameOrId;\n\t\t} else if (typeof (CommandClasses as any)[ccNameOrId] === \"number\") {\n\t\t\tret = (CommandClasses as any)[ccNameOrId];\n\t\t}\n\t} else {\n\t\tret = ccNameOrId;\n\t}\n\n\treturn ret;\n}\n\n// This interface is auto-generated by maintenance/generateCCAPIInterface.ts\n// Do not edit it by hand or your changes will be lost\nexport interface CCAPIs {\n\t[Symbol.iterator](): Iterator<CCAPI>;\n\n\t// AUTO GENERATION BELOW\n\t\"Alarm Sensor\": import(\"../cc/AlarmSensorCC.js\").AlarmSensorCCAPI;\n\tAssociation: import(\"../cc/AssociationCC.js\").AssociationCCAPI;\n\t\"Association Group Information\":\n\t\timport(\"../cc/AssociationGroupInfoCC.js\").AssociationGroupInfoCCAPI;\n\t\"Barrier Operator\":\n\t\timport(\"../cc/BarrierOperatorCC.js\").BarrierOperatorCCAPI;\n\tBasic: import(\"../cc/BasicCC.js\").BasicCCAPI;\n\t\"Basic Window Covering\":\n\t\timport(\"../cc/BasicWindowCoveringCC.js\").BasicWindowCoveringCCAPI;\n\tBattery: import(\"../cc/BatteryCC.js\").BatteryCCAPI;\n\t\"Binary Sensor\": import(\"../cc/BinarySensorCC.js\").BinarySensorCCAPI;\n\t\"Binary Switch\": import(\"../cc/BinarySwitchCC.js\").BinarySwitchCCAPI;\n\t\"CRC-16 Encapsulation\": import(\"../cc/CRC16CC.js\").CRC16CCAPI;\n\t\"Central Scene\": import(\"../cc/CentralSceneCC.js\").CentralSceneCCAPI;\n\t\"Climate Control Schedule\":\n\t\timport(\"../cc/ClimateControlScheduleCC.js\").ClimateControlScheduleCCAPI;\n\tClock: import(\"../cc/ClockCC.js\").ClockCCAPI;\n\t\"Color Switch\": import(\"../cc/ColorSwitchCC.js\").ColorSwitchCCAPI;\n\tConfiguration: import(\"../cc/ConfigurationCC.js\").ConfigurationCCAPI;\n\t\"Device Reset Locally\":\n\t\timport(\"../cc/DeviceResetLocallyCC.js\").DeviceResetLocallyCCAPI;\n\t\"Door Lock\": import(\"../cc/DoorLockCC.js\").DoorLockCCAPI;\n\t\"Door Lock Logging\":\n\t\timport(\"../cc/DoorLockLoggingCC.js\").DoorLockLoggingCCAPI;\n\t\"Energy Production\":\n\t\timport(\"../cc/EnergyProductionCC.js\").EnergyProductionCCAPI;\n\t\"Entry Control\": import(\"../cc/EntryControlCC.js\").EntryControlCCAPI;\n\t\"Firmware Update Meta Data\":\n\t\timport(\"../cc/FirmwareUpdateMetaDataCC.js\").FirmwareUpdateMetaDataCCAPI;\n\t\"Humidity Control Mode\":\n\t\timport(\"../cc/HumidityControlModeCC.js\").HumidityControlModeCCAPI;\n\t\"Humidity Control Operating State\":\n\t\timport(\"../cc/HumidityControlOperatingStateCC.js\").HumidityControlOperatingStateCCAPI;\n\t\"Humidity Control Setpoint\":\n\t\timport(\"../cc/HumidityControlSetpointCC.js\").HumidityControlSetpointCCAPI;\n\t\"Inclusion Controller\":\n\t\timport(\"../cc/InclusionControllerCC.js\").InclusionControllerCCAPI;\n\tIndicator: import(\"../cc/IndicatorCC.js\").IndicatorCCAPI;\n\tIrrigation: import(\"../cc/IrrigationCC.js\").IrrigationCCAPI;\n\tLanguage: import(\"../cc/LanguageCC.js\").LanguageCCAPI;\n\tLock: import(\"../cc/LockCC.js\").LockCCAPI;\n\t\"Manufacturer Proprietary\":\n\t\timport(\"../cc/ManufacturerProprietaryCC.js\").ManufacturerProprietaryCCAPI;\n\t\"Manufacturer Specific\":\n\t\timport(\"../cc/ManufacturerSpecificCC.js\").ManufacturerSpecificCCAPI;\n\tMeter: import(\"../cc/MeterCC.js\").MeterCCAPI;\n\t\"Multi Channel Association\":\n\t\timport(\"../cc/MultiChannelAssociationCC.js\").MultiChannelAssociationCCAPI;\n\t\"Multi Channel\": import(\"../cc/MultiChannelCC.js\").MultiChannelCCAPI;\n\t\"Multi Command\": import(\"../cc/MultiCommandCC.js\").MultiCommandCCAPI;\n\t\"Multilevel Sensor\":\n\t\timport(\"../cc/MultilevelSensorCC.js\").MultilevelSensorCCAPI;\n\t\"Multilevel Switch\":\n\t\timport(\"../cc/MultilevelSwitchCC.js\").MultilevelSwitchCCAPI;\n\t\"No Operation\": import(\"../cc/NoOperationCC.js\").NoOperationCCAPI;\n\t\"Node Naming and Location\":\n\t\timport(\"../cc/NodeNamingCC.js\").NodeNamingAndLocationCCAPI;\n\tNotification: import(\"../cc/NotificationCC.js\").NotificationCCAPI;\n\tPowerlevel: import(\"../cc/PowerlevelCC.js\").PowerlevelCCAPI;\n\tProtection: import(\"../cc/ProtectionCC.js\").ProtectionCCAPI;\n\t\"Scene Activation\":\n\t\timport(\"../cc/SceneActivationCC.js\").SceneActivationCCAPI;\n\t\"Scene Actuator Configuration\":\n\t\timport(\"../cc/SceneActuatorConfigurationCC.js\").SceneActuatorConfigurationCCAPI;\n\t\"Scene Controller Configuration\":\n\t\timport(\"../cc/SceneControllerConfigurationCC.js\").SceneControllerConfigurationCCAPI;\n\t\"Schedule Entry Lock\":\n\t\timport(\"../cc/ScheduleEntryLockCC.js\").ScheduleEntryLockCCAPI;\n\t\"Security 2\": import(\"../cc/Security2CC.js\").Security2CCAPI;\n\tSecurity: import(\"../cc/SecurityCC.js\").SecurityCCAPI;\n\t\"Sound Switch\": import(\"../cc/SoundSwitchCC.js\").SoundSwitchCCAPI;\n\tSupervision: import(\"../cc/SupervisionCC.js\").SupervisionCCAPI;\n\t\"Thermostat Fan Mode\":\n\t\timport(\"../cc/ThermostatFanModeCC.js\").ThermostatFanModeCCAPI;\n\t\"Thermostat Fan State\":\n\t\timport(\"../cc/ThermostatFanStateCC.js\").ThermostatFanStateCCAPI;\n\t\"Thermostat Mode\": import(\"../cc/ThermostatModeCC.js\").ThermostatModeCCAPI;\n\t\"Thermostat Operating State\":\n\t\timport(\"../cc/ThermostatOperatingStateCC.js\").ThermostatOperatingStateCCAPI;\n\t\"Thermostat Setback\":\n\t\timport(\"../cc/ThermostatSetbackCC.js\").ThermostatSetbackCCAPI;\n\t\"Thermostat Setpoint\":\n\t\timport(\"../cc/ThermostatSetpointCC.js\").ThermostatSetpointCCAPI;\n\tTime: import(\"../cc/TimeCC.js\").TimeCCAPI;\n\t\"Time Parameters\": import(\"../cc/TimeParametersCC.js\").TimeParametersCCAPI;\n\t\"User Code\": import(\"../cc/UserCodeCC.js\").UserCodeCCAPI;\n\tVersion: import(\"../cc/VersionCC.js\").VersionCCAPI;\n\t\"Wake Up\": import(\"../cc/WakeUpCC.js\").WakeUpCCAPI;\n\t\"Window Covering\": import(\"../cc/WindowCoveringCC.js\").WindowCoveringCCAPI;\n\t\"Z-Wave Plus Info\": import(\"../cc/ZWavePlusCC.js\").ZWavePlusCCAPI;\n}\n"],
4
+ "sourcesContent": ["import type { SendCommand } from \"@zwave-js/cc\";\nimport type { CompatOverrideQueries, GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\ttype Duration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSafeCCVersion,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype HostIDs,\n\ttype ListenBehavior,\n\ttype LogNode,\n\ttype MaybeNotKnown,\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\tNOT_KNOWN,\n\ttype NodeId,\n\ttype PhysicalNodes,\n\ttype QueryNodeStatus,\n\ttype SecurityManagers,\n\ttype SendCommandOptions,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype TXReport,\n\ttype ValueChangeOptions,\n\ttype ValueDB,\n\ttype ValueID,\n\ttype VirtualEndpointId,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tstripUndefined,\n} from \"@zwave-js/core\";\nimport {\n\ttype AllOrNone,\n\ttype OnlyMethods,\n\tgetEnumMemberName,\n\tgetErrorMessage,\n\tnum2hex,\n} from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tgetAPI,\n\tgetCCValues,\n\tgetCommandClass,\n\tgetImplementedVersion,\n} from \"./CommandClassDecorators.js\";\nimport type { CCValue, StaticCCValue } from \"./Values.js\";\nimport type {\n\tGetRefreshValueTimeouts,\n\tGetUserPreferences,\n\tSchedulePoll,\n} from \"./traits.js\";\n\nexport type ValueIDProperties = Pick<ValueID, \"property\" | \"propertyKey\">;\n\n/** Used to identify the method on the CC API class that handles setting values on nodes directly */\nexport const SET_VALUE: unique symbol = Symbol.for(\"CCAPI_SET_VALUE\");\n\nexport type SetValueImplementation = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => Promise<SupervisionResult | undefined>;\n\nexport const SET_VALUE_HOOKS: unique symbol = Symbol.for(\n\t\"CCAPI_SET_VALUE_HOOKS\",\n);\n\nexport type SetValueImplementationHooks =\n\t& AllOrNone<{\n\t\t// Opt-in to and handle delayed supervision updates\n\t\tsupervisionDelayedUpdates: boolean;\n\t\tsupervisionOnSuccess: () => void | Promise<void>;\n\t\tsupervisionOnFailure: () => void | Promise<void>;\n\t}>\n\t& {\n\t\t// Optimistically update related cached values (if allowed)\n\t\toptimisticallyUpdateRelatedValues?: (\n\t\t\tsupervisedAndSuccessful: boolean,\n\t\t) => void;\n\t\t// Check if a verification of the set value is required, even if the API response suggests otherwise\n\t\tforceVerifyChanges?: () => boolean;\n\t\t// Verify the changes\n\t\tverifyChanges?: (result?: SupervisionResult) => void | Promise<void>;\n\t};\n\nexport type SetValueImplementationHooksFactory = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => SetValueImplementationHooks | undefined;\n\n/**\n * A generic options bag for the `setValue` API.\n * Each implementation will choose the options that are relevant for it, so you can use the same options everywhere.\n * @publicAPI\n */\nexport type SetValueAPIOptions =\n\t& Partial<ValueChangeOptions>\n\t& Pick<SendCommandOptions, \"onProgress\">;\n\n/** Used to identify the method on the CC API class that handles polling values from nodes */\nexport const POLL_VALUE: unique symbol = Symbol.for(\"CCAPI_POLL_VALUE\");\nexport type PollValueImplementation<T = unknown> = (\n\tproperty: ValueIDProperties,\n) => Promise<T | undefined>;\n\n// Since the setValue API is called from a point with very generic parameters,\n// we must do narrowing inside the API calls. These three methods are for convenience\nexport function throwUnsupportedProperty(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${CommandClasses[cc]}: \"${property}\" is not a supported property`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwUnsupportedPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\tpropertyKey: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${propertyKey}\" is not a supported property key for property \"${property}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwMissingPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: property \"${property}\" requires a property key, but none was given`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwWrongValueType(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\texpectedType: string,\n\treceivedType: string,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${property}\" must be of type \"${expectedType}\", received \"${receivedType}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport interface CCAPISchedulePollOptions {\n\tduration?: Duration;\n\ttransition?: \"fast\" | \"slow\";\n}\n\n// Defines the necessary traits the host passed to a CC API must have\nexport type CCAPIHost<TNode extends CCAPINode = CCAPINode> =\n\t& HostIDs\n\t& GetNode<TNode>\n\t& GetValueDB\n\t& GetSupportedCCVersion\n\t& GetSafeCCVersion\n\t& SecurityManagers\n\t& GetDeviceConfig\n\t& SendCommand\n\t& GetRefreshValueTimeouts\n\t& GetUserPreferences\n\t& SchedulePoll\n\t& LogNode;\n\n// Defines the necessary traits a node passed to a CC API must have\nexport type CCAPINode = NodeId & ListenBehavior & QueryNodeStatus;\n\n// Defines the necessary traits an endpoint passed to a CC API must have\nexport type CCAPIEndpoint =\n\t& (\n\t\t| (\n\t\t\t// Physical endpoints must let us query their controlled CCs\n\t\t\tEndpointId & ControlsCC\n\t\t)\n\t\t| (\n\t\t\t// Virtual endpoints must let us query their physical nodes,\n\t\t\t// the CCs those nodes implement, and access the endpoints of those\n\t\t\t// physical nodes\n\t\t\tVirtualEndpointId & {\n\t\t\t\tnode: PhysicalNodes<\n\t\t\t\t\t& NodeId\n\t\t\t\t\t& SupportsCC\n\t\t\t\t\t& ControlsCC\n\t\t\t\t\t& GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t\t>;\n\t\t\t}\n\t\t)\n\t)\n\t& SupportsCC;\n\nexport type PhysicalCCAPIEndpoint = CCAPIEndpoint & EndpointId;\nexport type VirtualCCAPIEndpoint = CCAPIEndpoint & VirtualEndpointId;\n\n/**\n * The base class for all CC APIs exposed via `Node.commandClasses.<CCName>`\n * @publicAPI\n */\nexport class CCAPI {\n\tpublic constructor(\n\t\tprotected readonly host: CCAPIHost,\n\t\tprotected readonly endpoint: CCAPIEndpoint,\n\t) {\n\t\tthis.ccId = getCommandClass(this);\n\t}\n\n\tpublic static create<T extends CommandClasses>(\n\t\tccId: T,\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t\trequireSupport?: boolean,\n\t): CommandClasses extends T ? CCAPI : CCToAPI<T> {\n\t\tconst APIConstructor = getAPI(ccId);\n\t\tconst ccName = CommandClasses[ccId];\n\t\tif (APIConstructor == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Command Class ${ccName} (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tccId,\n\t\t\t\t\t)\n\t\t\t\t}) has no associated API!`,\n\t\t\t\tZWaveErrorCodes.CC_NoAPI,\n\t\t\t);\n\t\t}\n\t\tconst apiInstance = new APIConstructor(host, endpoint);\n\n\t\t// Only require support for physical endpoints by default\n\t\trequireSupport ??= !endpoint.virtual;\n\n\t\tif (requireSupport) {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn new Proxy(apiInstance, {\n\t\t\t\tget: (target, property) => {\n\t\t\t\t\t// Forbid access to the API if it is not supported by the node\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty !== \"ccId\"\n\t\t\t\t\t\t&& property !== \"endpoint\"\n\t\t\t\t\t\t&& property !== \"isSupported\"\n\t\t\t\t\t\t&& property !== \"withOptions\"\n\t\t\t\t\t\t&& property !== \"commandOptions\"\n\t\t\t\t\t\t&& !target.isSupported()\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet messageStart: string;\n\t\t\t\t\t\tif (endpoint.virtual) {\n\t\t\t\t\t\t\tconst hasNodeId =\n\t\t\t\t\t\t\t\ttypeof endpoint.nodeId === \"number\"\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST_LR;\n\t\t\t\t\t\t\tmessageStart = `${\n\t\t\t\t\t\t\t\thasNodeId ? \"The\" : \"This\"\n\t\t\t\t\t\t\t} virtual node${\n\t\t\t\t\t\t\t\thasNodeId ? ` ${endpoint.nodeId}` : \"\"\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmessageStart = `Node ${endpoint.nodeId}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t`${messageStart}${\n\t\t\t\t\t\t\t\tendpoint.index === 0\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: ` (endpoint ${endpoint.index})`\n\t\t\t\t\t\t\t} does not support the Command Class ${ccName}!`,\n\t\t\t\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If a device config defines overrides for an API call, return a wrapper method that applies them first before calling the actual method\n\t\t\t\t\tconst fallback = target[property as keyof CCAPI];\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof property === \"string\"\n\t\t\t\t\t\t&& !endpoint.virtual\n\t\t\t\t\t\t&& typeof fallback === \"function\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst overrides = host.getDeviceConfig?.(\n\t\t\t\t\t\t\tendpoint.nodeId,\n\t\t\t\t\t\t)?.compat?.overrideQueries;\n\t\t\t\t\t\tif (overrides?.hasOverride(ccId)) {\n\t\t\t\t\t\t\treturn overrideQueriesWrapper(\n\t\t\t\t\t\t\t\thost,\n\t\t\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\t\t\tccId,\n\t\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t\toverrides,\n\t\t\t\t\t\t\t\tfallback,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Else just access the property\n\t\t\t\t\treturn fallback;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn apiInstance;\n\t\t}\n\t}\n\n\t/**\n\t * The identifier of the Command Class this API is for\n\t */\n\tpublic readonly ccId: CommandClasses;\n\n\tprotected get [SET_VALUE](): SetValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Can be used on supported CC APIs to set a CC value by property name (and optionally the property key).\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get setValue(): SetValueImplementation | undefined {\n\t\treturn this[SET_VALUE];\n\t}\n\n\tprotected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory | undefined;\n\t/**\n\t * Can be implemented by CC APIs to influence the behavior of the setValue API in regards to Supervision and verifying values.\n\t */\n\tpublic get setValueHooks(): SetValueImplementationHooksFactory | undefined {\n\t\treturn this[SET_VALUE_HOOKS];\n\t}\n\n\t/** Whether a successful setValue call should imply that the value was successfully updated */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic isSetValueOptimistic(valueId: ValueID): boolean {\n\t\treturn true;\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\t/**\n\t * Can be used on supported CC APIs to poll a CC value by property name (and optionally the property key)\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get pollValue(): PollValueImplementation | undefined {\n\t\treturn this[POLL_VALUE];\n\t}\n\n\t/**\n\t * Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.\n\t * @returns `true` if the poll was scheduled, `false` otherwise\n\t */\n\tprotected schedulePoll(\n\t\t{ property, propertyKey }: ValueIDProperties,\n\t\texpectedValue: unknown,\n\t\t{ duration, transition = \"slow\" }: CCAPISchedulePollOptions = {},\n\t): boolean {\n\t\t// Figure out the delay. If a non-zero duration was given or this is a \"fast\" transition,\n\t\t// use/add the short delay. Otherwise, default to the long delay.\n\t\tconst durationMs = duration?.toMilliseconds() ?? 0;\n\t\tconst timeouts = this.host.getRefreshValueTimeouts();\n\t\tconst additionalDelay = !!durationMs || transition === \"fast\"\n\t\t\t? timeouts.refreshValueAfterTransition\n\t\t\t: timeouts.refreshValue;\n\t\tconst timeoutMs = durationMs + additionalDelay;\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst node = this.host.getNode(this.endpoint.nodeId);\n\t\t\tif (!node) return false;\n\n\t\t\treturn this.host.schedulePoll(\n\t\t\t\tnode.id,\n\t\t\t\t{\n\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t},\n\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t);\n\t\t} else if (this.isMulticast()) {\n\t\t\t// Only poll supporting nodes in multicast\n\t\t\tconst supportingNodes = this.endpoint.node.physicalNodes.filter(\n\t\t\t\t(node) =>\n\t\t\t\t\tnode\n\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t?.supportsCC(this.ccId),\n\t\t\t);\n\t\t\tlet ret = false;\n\t\t\tfor (const node of supportingNodes) {\n\t\t\t\tret ||= this.host.schedulePoll(\n\t\t\t\t\tnode.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t},\n\t\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn ret;\n\t\t} else {\n\t\t\t// Don't poll the broadcast node\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the version of the given CommandClass this endpoint implements\n\t */\n\tpublic get version(): number {\n\t\tif (this.isSinglecast()) {\n\t\t\treturn this.host.getSafeCCVersion(\n\t\t\t\tthis.ccId,\n\t\t\t\tthis.endpoint.nodeId,\n\t\t\t\tthis.endpoint.index,\n\t\t\t) ?? 0;\n\t\t} else {\n\t\t\treturn getImplementedVersion(this.ccId);\n\t\t}\n\t}\n\n\t/** Determines if this simplified API instance may be used. */\n\tpublic isSupported(): boolean {\n\t\treturn (\n\t\t\t// NoOperation is always supported\n\t\t\tthis.ccId === CommandClasses[\"No Operation\"]\n\t\t\t// Basic should always be supported. Since we are trying to hide it from library consumers\n\t\t\t// we cannot trust supportsCC to test it\n\t\t\t|| this.ccId === CommandClasses.Basic\n\t\t\t|| this.endpoint.supportsCC(this.ccId)\n\t\t);\n\t}\n\n\t/**\n\t * Determine whether the linked node supports a specific command of this command class.\n\t * {@link NOT_KNOWN} (`undefined`) means that the information has not been received yet\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic supportsCommand(command: number): MaybeNotKnown<boolean> {\n\t\t// This needs to be overwritten per command class. In the default implementation, we don't know anything!\n\t\treturn NOT_KNOWN;\n\t}\n\n\tprotected assertSupportsCommand(\n\t\tcommandEnum: unknown,\n\t\tcommand: number,\n\t): void {\n\t\tif (this.supportsCommand(command) !== true) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`${\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t\t? `Node #${this.endpoint.nodeId}`\n\t\t\t\t\t\t: \"This virtual node\"\n\t\t\t\t}${\n\t\t\t\t\tthis.endpoint.index > 0\n\t\t\t\t\t\t? ` (Endpoint ${this.endpoint.index})`\n\t\t\t\t\t\t: \"\"\n\t\t\t\t} does not support the command ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tcommandEnum,\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t)\n\t\t\t\t}!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected assertPhysicalEndpoint(\n\t\tendpoint: EndpointId | VirtualEndpointId,\n\t): asserts endpoint is EndpointId {\n\t\tif (endpoint.virtual) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`This method is not supported for virtual nodes!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Returns the command options to use for sendCommand calls */\n\tprotected get commandOptions(): SendCommandOptions {\n\t\t// No default options\n\t\treturn {};\n\t}\n\n\t/** Creates an instance of this API, scoped to use the given options */\n\tpublic withOptions(options: SendCommandOptions): this {\n\t\tconst mergedOptions = {\n\t\t\t...this.commandOptions,\n\t\t\t...options,\n\t\t};\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, property) => {\n\t\t\t\tif (property === \"commandOptions\") {\n\t\t\t\t\treturn mergedOptions;\n\t\t\t\t} else {\n\t\t\t\t\treturn (target as any)[property];\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Creates an instance of this API which (if supported) will return TX reports along with the result. */\n\tpublic withTXReport<T extends this>(): WithTXReport<T> {\n\t\tif (this.constructor === CCAPI) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The withTXReport method may only be called on specific CC API implementations.\",\n\t\t\t\tZWaveErrorCodes.Driver_NotSupported,\n\t\t\t);\n\t\t}\n\n\t\t// Remember which properties need to be proxied\n\t\tconst proxiedProps = new Set([\n\t\t\t// These are the CC-specific methods\n\t\t\t...Object.getOwnPropertyNames(this.constructor.prototype),\n\t\t\t// as well as setValue and pollValue\n\t\t\t\"setValue\",\n\t\t\t\"pollValue\",\n\t\t]);\n\t\tproxiedProps.delete(\"constructor\");\n\n\t\tfunction wrapResult<T>(result: T, txReport: TXReport): any {\n\t\t\t// Both the result and the TX report may be undefined (no response, no support)\n\t\t\treturn stripUndefined({\n\t\t\t\tresult,\n\t\t\t\ttxReport,\n\t\t\t});\n\t\t}\n\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, prop) => {\n\t\t\t\tif (prop === \"withTXReport\") return undefined;\n\n\t\t\t\tlet original: any = (target as any)[prop];\n\t\t\t\tif (\n\t\t\t\t\tproxiedProps.has(prop as string)\n\t\t\t\t\t&& typeof original === \"function\"\n\t\t\t\t) {\n\t\t\t\t\t// This is a method that only exists in the specific implementation\n\n\t\t\t\t\t// Wrap each call with its own API proxy, so we don't mix up TX reports\n\t\t\t\t\tlet txReport: TXReport;\n\t\t\t\t\tconst api = target.withOptions({\n\t\t\t\t\t\tonTXReport: (report) => {\n\t\t\t\t\t\t\t// Remember the last status report\n\t\t\t\t\t\t\ttxReport = report;\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\toriginal = (api as any)[prop].bind(api);\n\n\t\t\t\t\t// Return a wrapper function that will add the status report after the call is complete\n\t\t\t\t\treturn (...args: any) => {\n\t\t\t\t\t\tlet result = original(...args);\n\t\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\t\tresult = result.then((res) =>\n\t\t\t\t\t\t\t\twrapResult(res, txReport)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = wrapResult(result, txReport);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\treturn original;\n\t\t\t\t}\n\t\t\t},\n\t\t}) as any;\n\t}\n\n\tprotected isSinglecast(): this is this & {\n\t\tendpoint: PhysicalCCAPIEndpoint;\n\t} {\n\t\treturn (\n\t\t\t!this.endpoint.virtual\n\t\t\t&& typeof this.endpoint.nodeId === \"number\"\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST_LR\n\t\t);\n\t}\n\n\tprotected isMulticast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: number[];\n\t\t};\n\t} {\n\t\treturn this.endpoint.virtual && isArray(this.endpoint.nodeId);\n\t}\n\n\tprotected isBroadcast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR;\n\t\t};\n\t} {\n\t\treturn (\n\t\t\tthis.endpoint.virtual\n\t\t\t&& (this.endpoint.nodeId === NODE_ID_BROADCAST\n\t\t\t\t|| this.endpoint.nodeId === NODE_ID_BROADCAST_LR)\n\t\t);\n\t}\n\n\t/** Returns the value DB for this CC API's node (if it can be safely accessed) */\n\tprotected tryGetValueDB(): ValueDB | undefined {\n\t\tif (!this.isSinglecast()) return;\n\t\ttry {\n\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/** Returns the value DB for this CC's node (or throws if it cannot be accessed) */\n\tprotected getValueDB(): ValueDB {\n\t\tif (this.isSinglecast()) {\n\t\t\ttry {\n\t\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t\t} catch {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The node for this CC does not exist or the driver is not ready yet\",\n\t\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthrow new ZWaveError(\n\t\t\t\"Cannot retrieve the value DB for non-singlecast CCs\",\n\t\t\tZWaveErrorCodes.CC_NoNodeID,\n\t\t);\n\t}\n}\n\nfunction overrideQueriesWrapper(\n\tctx: GetValueDB & LogNode,\n\tendpoint: PhysicalCCAPIEndpoint,\n\tccId: CommandClasses,\n\tmethod: string,\n\toverrides: CompatOverrideQueries,\n\tfallback: (...args: any[]) => any,\n): (...args: any[]) => any {\n\t// We must not capture the `this` context here, because the API methods are bound on use\n\treturn function(this: any, ...args: any[]) {\n\t\tconst match = overrides.matchOverride(\n\t\t\tccId,\n\t\t\tendpoint.index,\n\t\t\tmethod,\n\t\t\targs,\n\t\t);\n\t\tif (!match) return fallback.call(this, ...args);\n\n\t\tctx.logNode(endpoint.nodeId, {\n\t\t\tmessage: `API call ${method} for ${\n\t\t\t\tgetCCName(\n\t\t\t\t\tccId,\n\t\t\t\t)\n\t\t\t} CC overridden by a compat flag.`,\n\t\t\tlevel: \"debug\",\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst ccValues = getCCValues(ccId);\n\t\tif (ccValues) {\n\t\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\n\t\t\tconst prop2value = (prop: string): CCValue | undefined => {\n\t\t\t\t// We use a simplistic parser to support dynamic value IDs:\n\t\t\t\t// If end with round brackets with something inside, they are considered dynamic\n\t\t\t\t// Otherwise static\n\t\t\t\tconst argsMatch = prop.match(/^(.*)\\((.*)\\)$/);\n\t\t\t\tif (argsMatch) {\n\t\t\t\t\tconst methodName = argsMatch[1];\n\t\t\t\t\tconst methodArgs = JSON.parse(`[${argsMatch[2]}]`);\n\n\t\t\t\t\tconst dynValue = ccValues[methodName];\n\t\t\t\t\tif (typeof dynValue === \"function\") {\n\t\t\t\t\t\treturn dynValue(...methodArgs);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst staticValue = ccValues[prop] as\n\t\t\t\t\t\t| StaticCCValue\n\t\t\t\t\t\t| undefined;\n\t\t\t\t\tif (typeof staticValue?.endpoint === \"function\") {\n\t\t\t\t\t\treturn staticValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Persist values if necessary\n\t\t\tif (match.persistValues) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, value] of Object.entries(\n\t\t\t\t\t\tmatch.persistValues,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setValue(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// As well as metadata\n\t\t\tif (match.extendMetadata) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, meta] of Object.entries(\n\t\t\t\t\t\tmatch.extendMetadata,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setMetadata(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...ccValue.meta,\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// API methods are always async\n\t\treturn Promise.resolve(match.result);\n\t};\n}\n\n/** A CC API that is only available for physical endpoints */\nexport class PhysicalCCAPI extends CCAPI {\n\tpublic constructor(\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t) {\n\t\tsuper(host, endpoint);\n\t\tthis.assertPhysicalEndpoint(endpoint);\n\t}\n\n\tdeclare protected readonly endpoint: PhysicalCCAPIEndpoint;\n}\n\nexport type APIConstructor<T extends CCAPI = CCAPI> = new (\n\thost: CCAPIHost,\n\tendpoint: CCAPIEndpoint,\n) => T;\n\n// This type is auto-generated by maintenance/generateCCAPIInterface.ts\n// Do not edit it by hand or your changes will be lost\ntype CCNameMap = {\n\t\"Alarm Sensor\": typeof CommandClasses[\"Alarm Sensor\"];\n\tAssociation: typeof CommandClasses[\"Association\"];\n\t\"Association Group Information\":\n\t\ttypeof CommandClasses[\"Association Group Information\"];\n\t\"Barrier Operator\": typeof CommandClasses[\"Barrier Operator\"];\n\tBasic: typeof CommandClasses[\"Basic\"];\n\t\"Basic Window Covering\": typeof CommandClasses[\"Basic Window Covering\"];\n\tBattery: typeof CommandClasses[\"Battery\"];\n\t\"Binary Sensor\": typeof CommandClasses[\"Binary Sensor\"];\n\t\"Binary Switch\": typeof CommandClasses[\"Binary Switch\"];\n\t\"CRC-16 Encapsulation\": typeof CommandClasses[\"CRC-16 Encapsulation\"];\n\t\"Central Scene\": typeof CommandClasses[\"Central Scene\"];\n\t\"Climate Control Schedule\":\n\t\ttypeof CommandClasses[\"Climate Control Schedule\"];\n\tClock: typeof CommandClasses[\"Clock\"];\n\t\"Color Switch\": typeof CommandClasses[\"Color Switch\"];\n\tConfiguration: typeof CommandClasses[\"Configuration\"];\n\t\"Device Reset Locally\": typeof CommandClasses[\"Device Reset Locally\"];\n\t\"Door Lock\": typeof CommandClasses[\"Door Lock\"];\n\t\"Door Lock Logging\": typeof CommandClasses[\"Door Lock Logging\"];\n\t\"Energy Production\": typeof CommandClasses[\"Energy Production\"];\n\t\"Entry Control\": typeof CommandClasses[\"Entry Control\"];\n\t\"Firmware Update Meta Data\":\n\t\ttypeof CommandClasses[\"Firmware Update Meta Data\"];\n\t\"Humidity Control Mode\": typeof CommandClasses[\"Humidity Control Mode\"];\n\t\"Humidity Control Operating State\":\n\t\ttypeof CommandClasses[\"Humidity Control Operating State\"];\n\t\"Humidity Control Setpoint\":\n\t\ttypeof CommandClasses[\"Humidity Control Setpoint\"];\n\t\"Inclusion Controller\": typeof CommandClasses[\"Inclusion Controller\"];\n\tIndicator: typeof CommandClasses[\"Indicator\"];\n\tIrrigation: typeof CommandClasses[\"Irrigation\"];\n\tLanguage: typeof CommandClasses[\"Language\"];\n\tLock: typeof CommandClasses[\"Lock\"];\n\t\"Manufacturer Proprietary\":\n\t\ttypeof CommandClasses[\"Manufacturer Proprietary\"];\n\t\"Manufacturer Specific\": typeof CommandClasses[\"Manufacturer Specific\"];\n\tMeter: typeof CommandClasses[\"Meter\"];\n\t\"Multi Channel Association\":\n\t\ttypeof CommandClasses[\"Multi Channel Association\"];\n\t\"Multi Channel\": typeof CommandClasses[\"Multi Channel\"];\n\t\"Multi Command\": typeof CommandClasses[\"Multi Command\"];\n\t\"Multilevel Sensor\": typeof CommandClasses[\"Multilevel Sensor\"];\n\t\"Multilevel Switch\": typeof CommandClasses[\"Multilevel Switch\"];\n\t\"No Operation\": typeof CommandClasses[\"No Operation\"];\n\t\"Node Naming and Location\":\n\t\ttypeof CommandClasses[\"Node Naming and Location\"];\n\tNotification: typeof CommandClasses[\"Notification\"];\n\tPowerlevel: typeof CommandClasses[\"Powerlevel\"];\n\tProtection: typeof CommandClasses[\"Protection\"];\n\t\"Scene Activation\": typeof CommandClasses[\"Scene Activation\"];\n\t\"Scene Actuator Configuration\":\n\t\ttypeof CommandClasses[\"Scene Actuator Configuration\"];\n\t\"Scene Controller Configuration\":\n\t\ttypeof CommandClasses[\"Scene Controller Configuration\"];\n\t\"Schedule Entry Lock\": typeof CommandClasses[\"Schedule Entry Lock\"];\n\t\"Security 2\": typeof CommandClasses[\"Security 2\"];\n\tSecurity: typeof CommandClasses[\"Security\"];\n\t\"Sound Switch\": typeof CommandClasses[\"Sound Switch\"];\n\tSupervision: typeof CommandClasses[\"Supervision\"];\n\t\"Thermostat Fan Mode\": typeof CommandClasses[\"Thermostat Fan Mode\"];\n\t\"Thermostat Fan State\": typeof CommandClasses[\"Thermostat Fan State\"];\n\t\"Thermostat Mode\": typeof CommandClasses[\"Thermostat Mode\"];\n\t\"Thermostat Operating State\":\n\t\ttypeof CommandClasses[\"Thermostat Operating State\"];\n\t\"Thermostat Setback\": typeof CommandClasses[\"Thermostat Setback\"];\n\t\"Thermostat Setpoint\": typeof CommandClasses[\"Thermostat Setpoint\"];\n\tTime: typeof CommandClasses[\"Time\"];\n\t\"Time Parameters\": typeof CommandClasses[\"Time Parameters\"];\n\t\"User Code\": typeof CommandClasses[\"User Code\"];\n\tVersion: typeof CommandClasses[\"Version\"];\n\t\"Wake Up\": typeof CommandClasses[\"Wake Up\"];\n\t\"Window Covering\": typeof CommandClasses[\"Window Covering\"];\n\t\"Z-Wave Plus Info\": typeof CommandClasses[\"Z-Wave Plus Info\"];\n};\nexport type CCToName<CC extends CommandClasses> = {\n\t[K in keyof CCNameMap]: CCNameMap[K] extends CC ? K : never;\n}[keyof CCNameMap];\n\nexport type CCNameOrId = CommandClasses | Extract<keyof CCAPIs, string>;\n\nexport type CCToAPI<CC extends CCNameOrId> = CC extends CommandClasses\n\t? CCToName<CC> extends keyof CCAPIs ? CCAPIs[CCToName<CC>]\n\t: never\n\t: CC extends keyof CCAPIs ? CCAPIs[CC]\n\t: never;\n\nexport type APIMethodsOf<CC extends CCNameOrId> = Omit<\n\tOnlyMethods<CCToAPI<CC>>,\n\t| \"ccId\"\n\t| \"getNode\"\n\t| \"tryGetNode\"\n\t| \"isSetValueOptimistic\"\n\t| \"isSupported\"\n\t| \"pollValue\"\n\t| \"setValue\"\n\t| \"version\"\n\t| \"supportsCommand\"\n\t| \"withOptions\"\n\t| \"withTXReport\"\n>;\n\nexport type OwnMethodsOf<API extends CCAPI> = Omit<\n\tOnlyMethods<API>,\n\tkeyof OnlyMethods<CCAPI>\n>;\n\n// Wraps the given type in an object that contains a TX report\nexport type WrapWithTXReport<T> = [T] extends [Promise<infer U>]\n\t? Promise<WrapWithTXReport<U>>\n\t: [T] extends [void] ? { txReport: TXReport | undefined }\n\t: { result: T; txReport: TXReport | undefined };\n\nexport type ReturnWithTXReport<T> = T extends (...args: any[]) => any\n\t? (...args: Parameters<T>) => WrapWithTXReport<ReturnType<T>>\n\t: undefined;\n\n// Converts the type of the given API implementation so the API methods return an object including the TX report\nexport type WithTXReport<API extends CCAPI> =\n\t& Omit<\n\t\tAPI,\n\t\tkeyof OwnMethodsOf<API> | \"withOptions\" | \"withTXReport\" | \"setValue\"\n\t>\n\t& {\n\t\t[\n\t\t\tK in\n\t\t\t\t| keyof OwnMethodsOf<API>\n\t\t\t\t| \"setValue\"\n\t\t\t\t| \"pollValue\"\n\t\t]: ReturnWithTXReport<API[K]>;\n\t};\n\nexport function normalizeCCNameOrId(\n\tccNameOrId: number | string,\n): CommandClasses | undefined {\n\tif (!(ccNameOrId in CommandClasses)) return undefined;\n\n\tlet ret: CommandClasses | undefined;\n\tif (typeof ccNameOrId === \"string\") {\n\t\tif (/^\\d+$/.test(ccNameOrId)) {\n\t\t\t// This can happen on property access\n\t\t\tret = +ccNameOrId;\n\t\t} else if (typeof (CommandClasses as any)[ccNameOrId] === \"number\") {\n\t\t\tret = (CommandClasses as any)[ccNameOrId];\n\t\t}\n\t} else {\n\t\tret = ccNameOrId;\n\t}\n\n\treturn ret;\n}\n\n// This interface is auto-generated by maintenance/generateCCAPIInterface.ts\n// Do not edit it by hand or your changes will be lost\nexport interface CCAPIs {\n\t[Symbol.iterator](): Iterator<CCAPI>;\n\n\t// AUTO GENERATION BELOW\n\t\"Alarm Sensor\": import(\"../cc/AlarmSensorCC.js\").AlarmSensorCCAPI;\n\tAssociation: import(\"../cc/AssociationCC.js\").AssociationCCAPI;\n\t\"Association Group Information\":\n\t\timport(\"../cc/AssociationGroupInfoCC.js\").AssociationGroupInfoCCAPI;\n\t\"Barrier Operator\":\n\t\timport(\"../cc/BarrierOperatorCC.js\").BarrierOperatorCCAPI;\n\tBasic: import(\"../cc/BasicCC.js\").BasicCCAPI;\n\t\"Basic Window Covering\":\n\t\timport(\"../cc/BasicWindowCoveringCC.js\").BasicWindowCoveringCCAPI;\n\tBattery: import(\"../cc/BatteryCC.js\").BatteryCCAPI;\n\t\"Binary Sensor\": import(\"../cc/BinarySensorCC.js\").BinarySensorCCAPI;\n\t\"Binary Switch\": import(\"../cc/BinarySwitchCC.js\").BinarySwitchCCAPI;\n\t\"CRC-16 Encapsulation\": import(\"../cc/CRC16CC.js\").CRC16CCAPI;\n\t\"Central Scene\": import(\"../cc/CentralSceneCC.js\").CentralSceneCCAPI;\n\t\"Climate Control Schedule\":\n\t\timport(\"../cc/ClimateControlScheduleCC.js\").ClimateControlScheduleCCAPI;\n\tClock: import(\"../cc/ClockCC.js\").ClockCCAPI;\n\t\"Color Switch\": import(\"../cc/ColorSwitchCC.js\").ColorSwitchCCAPI;\n\tConfiguration: import(\"../cc/ConfigurationCC.js\").ConfigurationCCAPI;\n\t\"Device Reset Locally\":\n\t\timport(\"../cc/DeviceResetLocallyCC.js\").DeviceResetLocallyCCAPI;\n\t\"Door Lock\": import(\"../cc/DoorLockCC.js\").DoorLockCCAPI;\n\t\"Door Lock Logging\":\n\t\timport(\"../cc/DoorLockLoggingCC.js\").DoorLockLoggingCCAPI;\n\t\"Energy Production\":\n\t\timport(\"../cc/EnergyProductionCC.js\").EnergyProductionCCAPI;\n\t\"Entry Control\": import(\"../cc/EntryControlCC.js\").EntryControlCCAPI;\n\t\"Firmware Update Meta Data\":\n\t\timport(\"../cc/FirmwareUpdateMetaDataCC.js\").FirmwareUpdateMetaDataCCAPI;\n\t\"Humidity Control Mode\":\n\t\timport(\"../cc/HumidityControlModeCC.js\").HumidityControlModeCCAPI;\n\t\"Humidity Control Operating State\":\n\t\timport(\"../cc/HumidityControlOperatingStateCC.js\").HumidityControlOperatingStateCCAPI;\n\t\"Humidity Control Setpoint\":\n\t\timport(\"../cc/HumidityControlSetpointCC.js\").HumidityControlSetpointCCAPI;\n\t\"Inclusion Controller\":\n\t\timport(\"../cc/InclusionControllerCC.js\").InclusionControllerCCAPI;\n\tIndicator: import(\"../cc/IndicatorCC.js\").IndicatorCCAPI;\n\tIrrigation: import(\"../cc/IrrigationCC.js\").IrrigationCCAPI;\n\tLanguage: import(\"../cc/LanguageCC.js\").LanguageCCAPI;\n\tLock: import(\"../cc/LockCC.js\").LockCCAPI;\n\t\"Manufacturer Proprietary\":\n\t\timport(\"../cc/ManufacturerProprietaryCC.js\").ManufacturerProprietaryCCAPI;\n\t\"Manufacturer Specific\":\n\t\timport(\"../cc/ManufacturerSpecificCC.js\").ManufacturerSpecificCCAPI;\n\tMeter: import(\"../cc/MeterCC.js\").MeterCCAPI;\n\t\"Multi Channel Association\":\n\t\timport(\"../cc/MultiChannelAssociationCC.js\").MultiChannelAssociationCCAPI;\n\t\"Multi Channel\": import(\"../cc/MultiChannelCC.js\").MultiChannelCCAPI;\n\t\"Multi Command\": import(\"../cc/MultiCommandCC.js\").MultiCommandCCAPI;\n\t\"Multilevel Sensor\":\n\t\timport(\"../cc/MultilevelSensorCC.js\").MultilevelSensorCCAPI;\n\t\"Multilevel Switch\":\n\t\timport(\"../cc/MultilevelSwitchCC.js\").MultilevelSwitchCCAPI;\n\t\"No Operation\": import(\"../cc/NoOperationCC.js\").NoOperationCCAPI;\n\t\"Node Naming and Location\":\n\t\timport(\"../cc/NodeNamingCC.js\").NodeNamingAndLocationCCAPI;\n\tNotification: import(\"../cc/NotificationCC.js\").NotificationCCAPI;\n\tPowerlevel: import(\"../cc/PowerlevelCC.js\").PowerlevelCCAPI;\n\tProtection: import(\"../cc/ProtectionCC.js\").ProtectionCCAPI;\n\t\"Scene Activation\":\n\t\timport(\"../cc/SceneActivationCC.js\").SceneActivationCCAPI;\n\t\"Scene Actuator Configuration\":\n\t\timport(\"../cc/SceneActuatorConfigurationCC.js\").SceneActuatorConfigurationCCAPI;\n\t\"Scene Controller Configuration\":\n\t\timport(\"../cc/SceneControllerConfigurationCC.js\").SceneControllerConfigurationCCAPI;\n\t\"Schedule Entry Lock\":\n\t\timport(\"../cc/ScheduleEntryLockCC.js\").ScheduleEntryLockCCAPI;\n\t\"Security 2\": import(\"../cc/Security2CC.js\").Security2CCAPI;\n\tSecurity: import(\"../cc/SecurityCC.js\").SecurityCCAPI;\n\t\"Sound Switch\": import(\"../cc/SoundSwitchCC.js\").SoundSwitchCCAPI;\n\tSupervision: import(\"../cc/SupervisionCC.js\").SupervisionCCAPI;\n\t\"Thermostat Fan Mode\":\n\t\timport(\"../cc/ThermostatFanModeCC.js\").ThermostatFanModeCCAPI;\n\t\"Thermostat Fan State\":\n\t\timport(\"../cc/ThermostatFanStateCC.js\").ThermostatFanStateCCAPI;\n\t\"Thermostat Mode\": import(\"../cc/ThermostatModeCC.js\").ThermostatModeCCAPI;\n\t\"Thermostat Operating State\":\n\t\timport(\"../cc/ThermostatOperatingStateCC.js\").ThermostatOperatingStateCCAPI;\n\t\"Thermostat Setback\":\n\t\timport(\"../cc/ThermostatSetbackCC.js\").ThermostatSetbackCCAPI;\n\t\"Thermostat Setpoint\":\n\t\timport(\"../cc/ThermostatSetpointCC.js\").ThermostatSetpointCCAPI;\n\tTime: import(\"../cc/TimeCC.js\").TimeCCAPI;\n\t\"Time Parameters\": import(\"../cc/TimeParametersCC.js\").TimeParametersCCAPI;\n\t\"User Code\": import(\"../cc/UserCodeCC.js\").UserCodeCCAPI;\n\tVersion: import(\"../cc/VersionCC.js\").VersionCCAPI;\n\t\"Wake Up\": import(\"../cc/WakeUpCC.js\").WakeUpCCAPI;\n\t\"Window Covering\": import(\"../cc/WindowCoveringCC.js\").WindowCoveringCCAPI;\n\t\"Z-Wave Plus Info\": import(\"../cc/ZWavePlusCC.js\").ZWavePlusCCAPI;\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;;;;AAAA,kBAiCO;AACP,oBAMO;AACP,wBAAwB;AACxB,oCAKO;AAWA,MAAM,YAA2B,OAAO,IAAI,iBAAiB;AAQ7D,MAAM,kBAAiC,OAAO,IACpD,uBAAuB;AAqCjB,MAAM,aAA4B,OAAO,IAAI,kBAAkB;AAOhE,SAAU,yBACf,IACA,UAAyB;AAEzB,QAAM,IAAI,uBACT,GAAG,2BAAe,EAAE,CAAC,MAAM,QAAQ,iCACnC,4BAAgB,gBAAgB;AAElC;AARgB;AAUV,SAAU,4BACf,IACA,UACA,aAA4B;AAE5B,QAAM,IAAI,uBACT,GACC,2BAAe,EAAE,CAClB,MAAM,WAAW,mDAAmD,QAAQ,KAC5E,4BAAgB,gBAAgB;AAElC;AAXgB;AAaV,SAAU,wBACf,IACA,UAAyB;AAEzB,QAAM,IAAI,uBACT,GACC,2BAA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AAE7B,YAAM,CAAC;IACR,WAAW,OAAQ,2BAAuB,UAAU,MAAM,UAAU;AACnE,YAAO,2BAAuB,UAAU;IACzC;EACD,OAAO;AACN,UAAM;EACP;AAEA,SAAO;AACR;AAlBgB;",
6
6
  "names": []
7
7
  }
@@ -35,32 +35,6 @@ export declare const BatteryCCValues: Readonly<{
35
35
  readonly autoCreate: true;
36
36
  };
37
37
  };
38
- isLow: {
39
- id: {
40
- readonly commandClass: CommandClasses.Battery;
41
- readonly property: "isLow";
42
- };
43
- endpoint: (endpoint?: number) => {
44
- readonly commandClass: CommandClasses.Battery;
45
- readonly endpoint: number;
46
- readonly property: "isLow";
47
- };
48
- is: (valueId: import("@zwave-js/core").ValueID) => boolean;
49
- readonly meta: {
50
- readonly label: "Low battery level";
51
- readonly writeable: false;
52
- readonly type: "boolean";
53
- readonly readable: true;
54
- };
55
- options: {
56
- readonly internal: false;
57
- readonly minVersion: 1;
58
- readonly secret: false;
59
- readonly stateful: true;
60
- readonly supportsEndpoints: true;
61
- readonly autoCreate: true;
62
- };
63
- };
64
38
  maximumCapacity: {
65
39
  id: {
66
40
  readonly commandClass: CommandClasses.Battery;
@@ -337,7 +311,7 @@ export declare const BatteryCCValues: Readonly<{
337
311
  export declare class BatteryCCAPI extends PhysicalCCAPI {
338
312
  supportsCommand(cmd: BatteryCommand): MaybeNotKnown<boolean>;
339
313
  protected get [POLL_VALUE](): PollValueImplementation;
340
- get(): Promise<Pick<BatteryCCReport, "level" | "isLow" | "chargingStatus" | "rechargeable" | "backup" | "overheating" | "lowFluid" | "rechargeOrReplace" | "disconnected" | "lowTemperatureStatus"> | undefined>;
314
+ get(): Promise<Pick<BatteryCCReport, "level" | "chargingStatus" | "rechargeable" | "backup" | "overheating" | "lowFluid" | "rechargeOrReplace" | "disconnected" | "lowTemperatureStatus"> | undefined>;
341
315
  getHealth(): Promise<Pick<BatteryCCHealthReport, "maximumCapacity" | "temperature"> | undefined>;
342
316
  }
343
317
  export declare class BatteryCC extends CommandClass {
@@ -346,13 +320,9 @@ export declare class BatteryCC extends CommandClass {
346
320
  refreshValues(ctx: RefreshValuesContext): Promise<void>;
347
321
  shouldRefreshValues(this: SinglecastCC<this>, ctx: GetValueDB & GetSupportedCCVersion & GetDeviceConfig & GetNode<NodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>): boolean;
348
322
  }
349
- export type BatteryCCReportOptions = ({
350
- isLow?: false;
351
- level: number;
352
- } | {
353
- isLow: true;
354
- level?: undefined;
355
- }) & AllOrNone<{
323
+ export type BatteryCCReportOptions = {
324
+ level: number | "low";
325
+ } & AllOrNone<{
356
326
  chargingStatus: BatteryChargingStatus;
357
327
  rechargeable: boolean;
358
328
  backup: boolean;
@@ -368,7 +338,6 @@ export declare class BatteryCCReport extends BatteryCC {
368
338
  static from(raw: CCRaw, ctx: CCParsingContext): BatteryCCReport;
369
339
  persistValues(ctx: PersistValuesContext): boolean;
370
340
  readonly level: number;
371
- readonly isLow: boolean;
372
341
  readonly chargingStatus: BatteryChargingStatus | undefined;
373
342
  readonly rechargeable: boolean | undefined;
374
343
  readonly backup: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BatteryCC.d.ts","sourceRoot":"","sources":["../../../src/cc/BatteryCC.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACN,cAAc,EACd,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAGxB,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,UAAU,EAEf,KAAK,WAAW,EAMhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,SAAS,EACd,KAAK,EAGL,M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G,SAAS,CAAC;IAElD,SAAgB,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAyBjD,UAAU,CAAC,GAAG,CAAC,EAAE,UAAU,GAAG,mBAAmB;CAwCxD;AAED,qBAEa,YAAa,SAAQ,SAAS;CAAG;AAG9C,MAAM,WAAW,4BAA4B;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,qBAGa,qBAAsB,SAAQ,SAAS;gBAElD,OAAO,EAAE,WAAW,CAAC,4BAA4B,CAAC;WAUrC,IAAI,CACjB,GAAG,EAAE,KAAK,EACV,GAAG,EAAE,gBAAgB,GACnB,qBAAqB;IAqBxB,SAAgB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpD,SAAgB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IAE/C,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAgBjD,UAAU,CAAC,GAAG,CAAC,EAAE,UAAU,GAAG,mBAAmB;CAaxD;AAED,qBAEa,kBAAmB,SAAQ,SAAS;CAAG"}
@@ -71,7 +71,6 @@ let BatteryCCAPI = (() => {
71
71
  return async function ({ property }) {
72
72
  switch (property) {
73
73
  case "level":
74
- case "isLow":
75
74
  case "chargingStatus":
76
75
  case "rechargeable":
77
76
  case "backup":
@@ -100,7 +99,6 @@ let BatteryCCAPI = (() => {
100
99
  if (response) {
101
100
  return pick(response, [
102
101
  "level",
103
- "isLow",
104
102
  "chargingStatus",
105
103
  "rechargeable",
106
104
  "backup",
@@ -169,7 +167,9 @@ let BatteryCC = (() => {
169
167
  const batteryStatus = await api.get();
170
168
  if (batteryStatus) {
171
169
  let logMessage = `received response for battery information:
172
- level: ${batteryStatus.level}${batteryStatus.isLow ? " (low)" : ""}`;
170
+ level: ${batteryStatus.level === 0xff
171
+ ? "low"
172
+ : (batteryStatus.level + " %")}`;
173
173
  if (api.version >= 2) {
174
174
  logMessage += `
175
175
  status: ${BatteryChargingStatus[batteryStatus.chargingStatus]}
@@ -223,7 +223,7 @@ temperature: ${batteryHealth.temperature} °C`;
223
223
  })();
224
224
  export { BatteryCC };
225
225
  let BatteryCCReport = (() => {
226
- let _classDecorators = [CCCommand(BatteryCommand.Report), ccValueProperty("level", BatteryCCValues.level), ccValueProperty("isLow", BatteryCCValues.isLow), ccValueProperty("chargingStatus", BatteryCCValues.chargingStatus), ccValueProperty("rechargeable", BatteryCCValues.rechargeable), ccValueProperty("backup", BatteryCCValues.backup), ccValueProperty("overheating", BatteryCCValues.overheating), ccValueProperty("lowFluid", BatteryCCValues.lowFluid), ccValueProperty("rechargeOrReplace", BatteryCCValues.rechargeOrReplace), ccValueProperty("disconnected", BatteryCCValues.disconnected), ccValueProperty("lowTemperatureStatus", BatteryCCValues.lowTemperatureStatus)];
226
+ let _classDecorators = [CCCommand(BatteryCommand.Report), ccValueProperty("level", BatteryCCValues.level), ccValueProperty("chargingStatus", BatteryCCValues.chargingStatus), ccValueProperty("rechargeable", BatteryCCValues.rechargeable), ccValueProperty("backup", BatteryCCValues.backup), ccValueProperty("overheating", BatteryCCValues.overheating), ccValueProperty("lowFluid", BatteryCCValues.lowFluid), ccValueProperty("rechargeOrReplace", BatteryCCValues.rechargeOrReplace), ccValueProperty("disconnected", BatteryCCValues.disconnected), ccValueProperty("lowTemperatureStatus", BatteryCCValues.lowTemperatureStatus)];
227
227
  let _classDescriptor;
228
228
  let _classExtraInitializers = [];
229
229
  let _classThis;
@@ -239,8 +239,7 @@ let BatteryCCReport = (() => {
239
239
  }
240
240
  constructor(options) {
241
241
  super(options);
242
- this.level = options.isLow ? 0 : options.level;
243
- this.isLow = !!options.isLow;
242
+ this.level = typeof options.level === "number" ? options.level : 0xff;
244
243
  this.chargingStatus = options.chargingStatus;
245
244
  this.rechargeable = options.rechargeable;
246
245
  this.backup = options.backup;
@@ -254,17 +253,9 @@ let BatteryCCReport = (() => {
254
253
  let ccOptions;
255
254
  validatePayload(raw.payload.length >= 1);
256
255
  const level = raw.payload[0];
257
- if (level === 0xff) {
258
- ccOptions = {
259
- isLow: true,
260
- };
261
- }
262
- else {
263
- ccOptions = {
264
- isLow: false,
265
- level,
266
- };
267
- }
256
+ ccOptions = {
257
+ level,
258
+ };
268
259
  if (raw.payload.length >= 3) {
269
260
  // Starting with V2
270
261
  const chargingStatus = raw.payload[1] >>> 6;
@@ -297,8 +288,18 @@ let BatteryCCReport = (() => {
297
288
  });
298
289
  }
299
290
  persistValues(ctx) {
291
+ // This is a bit hacky, but we need to avoid persisting 0xff as the battery level
292
+ // because the report is meant as a notification in that case.
293
+ if (this.level === 0xff) {
294
+ // @ts-expect-error
295
+ this.level = undefined;
296
+ }
300
297
  if (!super.persistValues(ctx))
301
298
  return false;
299
+ if (this.level === undefined) {
300
+ // @ts-expect-error
301
+ this.level = 0xff;
302
+ }
302
303
  // Naïve heuristic for a full battery
303
304
  if (this.level >= 90) {
304
305
  // Some devices send Notification CC Reports with battery information,
@@ -321,7 +322,6 @@ let BatteryCCReport = (() => {
321
322
  return true;
322
323
  }
323
324
  level;
324
- isLow;
325
325
  chargingStatus;
326
326
  rechargeable;
327
327
  backup;
@@ -331,7 +331,7 @@ let BatteryCCReport = (() => {
331
331
  disconnected;
332
332
  lowTemperatureStatus;
333
333
  serialize(ctx) {
334
- this.payload = Bytes.from([this.isLow ? 0xff : this.level]);
334
+ this.payload = Bytes.from([this.level]);
335
335
  if (this.chargingStatus != undefined) {
336
336
  this.payload = Bytes.concat([
337
337
  this.payload,
@@ -355,10 +355,9 @@ let BatteryCCReport = (() => {
355
355
  return super.serialize(ctx);
356
356
  }
357
357
  toLogEntry(ctx) {
358
- const message = {
359
- level: this.level,
360
- "is low": this.isLow,
361
- };
358
+ const message = this.level === 0xff
359
+ ? { "is low": true }
360
+ : { level: this.level };
362
361
  if (this.chargingStatus != undefined) {
363
362
  message["charging status"] = getEnumMemberName(BatteryChargingStatus, this.chargingStatus);
364
363
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BatteryCC.js","sourceRoot":"","sources":["../../../src/cc/BatteryCC.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EACN,cAAc,EASd,eAAe,EAKf,aAAa,EAEb,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,QAAQ,EACR,eAAe,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEN,KAAK,EACL,iBAAiB,EACjB,IAAI,GACJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,EACL,UAAU,EACV,aAAa,EAEb,wBAAwB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEN,YAAY,GAIZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,GAAG,EACH,SAAS,EACT,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EACN,qBAAqB,EACrB,cAAc,EACd,wBAAwB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;;;AA2I3D,sCAAsC;IAGzB,YAAY;4BADxB,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC;;;;sBACM,aAAa;4BAArB,SAAQ,WAAa;;;;YAA/C,6KAgFC;;;YAhFY,uDAAY;;QACjB,eAAe,CAAC,GAAmB;YACzC,QAAQ,GAAG,EAAE,CAAC;gBACb,KAAK,cAAc,CAAC,GAAG;oBACtB,OAAO,IAAI,CAAC,CAAC,oBAAoB;gBAClC,KAAK,cA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