@zwave-js/cc 15.15.2 → 15.16.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/BatteryCC.js +4 -0
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.d.ts +6 -0
- package/build/cjs/cc/ConfigurationCC.js +49 -1
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +2 -2
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +4 -4
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +4 -4
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +3 -3
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.d.ts +14 -14
- package/build/cjs/cc/Security2CC.js.map +2 -2
- package/build/cjs/cc/SecurityCC.d.ts +10 -10
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/TransportServiceCC.d.ts +7 -7
- package/build/cjs/cc/TransportServiceCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.d.ts +6 -6
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +4 -4
- package/build/cjs/lib/CommandClass.js.map +2 -2
- package/build/cjs/lib/NotificationEventPayload.d.ts +2 -1
- package/build/cjs/lib/NotificationEventPayload.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +12 -12
- package/build/cjs/lib/Security2/Extension.js.map +2 -2
- package/build/cjs/lib/_Types.d.ts +2 -1
- package/build/cjs/lib/_Types.js.map +2 -2
- package/build/cjs/lib/serializers.d.ts +4 -4
- package/build/cjs/lib/serializers.js.map +2 -2
- package/build/cjs/lib/traits.d.ts +5 -0
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +3 -0
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +6 -0
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +62 -1
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +2 -2
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +4 -4
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +4 -4
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +3 -3
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +14 -14
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +1 -1
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +10 -10
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +1 -1
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +6 -6
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +1 -1
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +7 -7
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +6 -6
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +1 -1
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +3 -3
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +4 -4
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/NotificationEventPayload.d.ts +2 -1
- package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -1
- package/build/esm/lib/NotificationEventPayload.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +12 -12
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +1 -1
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/_Types.d.ts +2 -1
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js.map +1 -1
- package/build/esm/lib/serializers.d.ts +4 -4
- package/build/esm/lib/serializers.d.ts.map +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/build/esm/lib/traits.d.ts +5 -0
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/package.json +10 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/NodeNamingCC.ts"],
|
|
4
|
-
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\tBytes,\n\tstringToUint8ArrayUTF16BE,\n\tuint8ArrayToStringUTF16BE,\n} from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NodeNamingAndLocationCommand } from \"../lib/_Types.js\";\n\nexport const NodeNamingAndLocationCCValues = V.defineCCValues(\n\tCommandClasses[\"Node Naming and Location\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"name\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.String,\n\t\t\t\tlabel: \"Node name\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"location\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.String,\n\t\t\t\tlabel: \"Node location\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t},\n);\n\nfunction isASCII(str: string): boolean {\n\treturn /^[\\x00-\\x7F]*$/.test(str);\n}\n\n@API(CommandClasses[\"Node Naming and Location\"])\nexport class NodeNamingAndLocationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: NodeNamingAndLocationCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase NodeNamingAndLocationCommand.NameGet:\n\t\t\tcase NodeNamingAndLocationCommand.NameSet:\n\t\t\tcase NodeNamingAndLocationCommand.LocationGet:\n\t\t\tcase NodeNamingAndLocationCommand.LocationSet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: NodeNamingAndLocationCCAPI,\n\t\t\t{ property },\n\t\t\tvalue,\n\t\t) {\n\t\t\tif (property !== \"name\" && property !== \"location\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (typeof value !== \"string\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"string\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tswitch (property) {\n\t\t\t\tcase \"name\":\n\t\t\t\t\treturn this.setName(value);\n\t\t\t\tcase \"location\":\n\t\t\t\t\treturn this.setLocation(value);\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprotected override get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: NodeNamingAndLocationCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"name\":\n\t\t\t\t\treturn this.getName();\n\t\t\t\tcase \"location\":\n\t\t\t\t\treturn this.getLocation();\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic async getName(): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.NameGet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCNameGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNodeNamingAndLocationCCNameReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.name;\n\t}\n\n\t@validateArgs()\n\tpublic async setName(name: string): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.NameSet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCNameSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tname,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getLocation(): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.LocationGet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCLocationGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNodeNamingAndLocationCCLocationReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.location;\n\t}\n\n\t@validateArgs()\n\tpublic async setLocation(\n\t\tlocation: string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.LocationSet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCLocationSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tlocation,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Node Naming and Location\"])\n@implementedVersion(1)\n@ccValues(NodeNamingAndLocationCCValues)\nexport class NodeNamingAndLocationCC extends CommandClass {\n\tdeclare ccCommand: NodeNamingAndLocationCommand;\n\n\tpublic skipEndpointInterview(): boolean {\n\t\t// As the name says, this is for the node, not for endpoints\n\t\treturn true;\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Node Naming and Location\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"retrieving node name...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst name = await api.getName();\n\t\tif (name != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: `is named \"${name}\"`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"retrieving node location...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst location = await api.getLocation();\n\t\tif (location != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: `received location: ${location}`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCNameSetOptions {\n\tname: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameSet)\n@useSupervision()\nexport class NodeNamingAndLocationCCNameSet extends NodeNamingAndLocationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCNameSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): NodeNamingAndLocationCCNameSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new NodeNamingAndLocationCCNameSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic name: string;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encoding = isASCII(this.name) ? \"ascii\" : \"utf16le\";\n\t\tthis.payload = new Bytes(\n\t\t\t1 + this.name.length * (encoding === \"ascii\" ? 1 : 2),\n\t\t);\n\t\tthis.payload[0] = encoding === \"ascii\" ? 0x0 : 0x2;\n\t\tlet nameBuffer: Uint8Array;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tnameBuffer = stringToUint8ArrayUTF16BE(this.name);\n\t\t} else {\n\t\t\tnameBuffer = Bytes.from(this.name, \"ascii\");\n\t\t}\n\t\t// Copy at most 16 bytes\n\t\tthis.payload.set(\n\t\t\tnameBuffer.subarray(0, Math.min(16, nameBuffer.length)),\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { name: this.name },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCNameReportOptions {\n\tname: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameReport)\n@ccValueProperty(\"name\", NodeNamingAndLocationCCValues.name)\nexport class NodeNamingAndLocationCCNameReport extends NodeNamingAndLocationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCNameReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NodeNamingAndLocationCCNameReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst encoding = raw.payload[0] === 2 ? \"utf16le\" : \"ascii\";\n\t\tconst nameBuffer = raw.payload.subarray(1);\n\t\tlet name: string;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tvalidatePayload(nameBuffer.length % 2 === 0);\n\t\t\tname = uint8ArrayToStringUTF16BE(nameBuffer);\n\t\t} else {\n\t\t\tname = nameBuffer.toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tname,\n\t\t});\n\t}\n\n\tpublic readonly name: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { name: this.name },\n\t\t};\n\t}\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameGet)\n@expectedCCResponse(NodeNamingAndLocationCCNameReport)\nexport class NodeNamingAndLocationCCNameGet extends NodeNamingAndLocationCC {}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCLocationSetOptions {\n\tlocation: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationSet)\n@useSupervision()\nexport class NodeNamingAndLocationCCLocationSet\n\textends NodeNamingAndLocationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCLocationSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.location = options.location;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): NodeNamingAndLocationCCLocationSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new NodeNamingAndLocationCCLocationSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic location: string;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encoding = isASCII(this.location) ? \"ascii\" : \"utf16le\";\n\t\tthis.payload = new Bytes(\n\t\t\t1 + this.location.length * (encoding === \"ascii\" ? 1 : 2),\n\t\t);\n\t\tthis.payload[0] = encoding === \"ascii\" ? 0x0 : 0x2;\n\t\tlet locationBuffer: Uint8Array;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tlocationBuffer = stringToUint8ArrayUTF16BE(this.location);\n\t\t} else {\n\t\t\tlocationBuffer = Bytes.from(this.location, \"ascii\");\n\t\t}\n\t\t// Copy at most 16 bytes\n\t\tthis.payload.set(\n\t\t\tlocationBuffer.subarray(0, Math.min(16, locationBuffer.length)),\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { location: this.location },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCLocationReportOptions {\n\tlocation: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationReport)\n@ccValueProperty(\"location\", NodeNamingAndLocationCCValues.location)\nexport class NodeNamingAndLocationCCLocationReport\n\textends NodeNamingAndLocationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCLocationReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.location = options.location;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NodeNamingAndLocationCCLocationReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst encoding = raw.payload[0] === 2 ? \"utf16le\" : \"ascii\";\n\t\tconst locationBuffer = raw.payload.subarray(1);\n\t\tlet location: string;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tvalidatePayload(locationBuffer.length % 2 === 0);\n\t\t\tlocation = uint8ArrayToStringUTF16BE(locationBuffer);\n\t\t} else {\n\t\t\tlocation = locationBuffer.toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tlocation,\n\t\t});\n\t}\n\n\tpublic readonly location: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { location: this.location },\n\t\t};\n\t}\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationGet)\n@expectedCCResponse(NodeNamingAndLocationCCLocationReport)\nexport class NodeNamingAndLocationCCLocationGet\n\textends NodeNamingAndLocationCC\n{}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAYO;AACP,
|
|
4
|
+
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\tBytes,\n\ttype BytesView,\n\tstringToUint8ArrayUTF16BE,\n\tuint8ArrayToStringUTF16BE,\n} from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NodeNamingAndLocationCommand } from \"../lib/_Types.js\";\n\nexport const NodeNamingAndLocationCCValues = V.defineCCValues(\n\tCommandClasses[\"Node Naming and Location\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"name\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.String,\n\t\t\t\tlabel: \"Node name\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"location\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.String,\n\t\t\t\tlabel: \"Node location\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t},\n);\n\nfunction isASCII(str: string): boolean {\n\treturn /^[\\x00-\\x7F]*$/.test(str);\n}\n\n@API(CommandClasses[\"Node Naming and Location\"])\nexport class NodeNamingAndLocationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: NodeNamingAndLocationCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase NodeNamingAndLocationCommand.NameGet:\n\t\t\tcase NodeNamingAndLocationCommand.NameSet:\n\t\t\tcase NodeNamingAndLocationCommand.LocationGet:\n\t\t\tcase NodeNamingAndLocationCommand.LocationSet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: NodeNamingAndLocationCCAPI,\n\t\t\t{ property },\n\t\t\tvalue,\n\t\t) {\n\t\t\tif (property !== \"name\" && property !== \"location\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (typeof value !== \"string\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"string\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tswitch (property) {\n\t\t\t\tcase \"name\":\n\t\t\t\t\treturn this.setName(value);\n\t\t\t\tcase \"location\":\n\t\t\t\t\treturn this.setLocation(value);\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprotected override get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: NodeNamingAndLocationCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"name\":\n\t\t\t\t\treturn this.getName();\n\t\t\t\tcase \"location\":\n\t\t\t\t\treturn this.getLocation();\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic async getName(): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.NameGet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCNameGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNodeNamingAndLocationCCNameReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.name;\n\t}\n\n\t@validateArgs()\n\tpublic async setName(name: string): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.NameSet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCNameSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tname,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getLocation(): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.LocationGet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCLocationGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNodeNamingAndLocationCCLocationReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.location;\n\t}\n\n\t@validateArgs()\n\tpublic async setLocation(\n\t\tlocation: string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.LocationSet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCLocationSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tlocation,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Node Naming and Location\"])\n@implementedVersion(1)\n@ccValues(NodeNamingAndLocationCCValues)\nexport class NodeNamingAndLocationCC extends CommandClass {\n\tdeclare ccCommand: NodeNamingAndLocationCommand;\n\n\tpublic skipEndpointInterview(): boolean {\n\t\t// As the name says, this is for the node, not for endpoints\n\t\treturn true;\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Node Naming and Location\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"retrieving node name...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst name = await api.getName();\n\t\tif (name != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: `is named \"${name}\"`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"retrieving node location...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst location = await api.getLocation();\n\t\tif (location != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: `received location: ${location}`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCNameSetOptions {\n\tname: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameSet)\n@useSupervision()\nexport class NodeNamingAndLocationCCNameSet extends NodeNamingAndLocationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCNameSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): NodeNamingAndLocationCCNameSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new NodeNamingAndLocationCCNameSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic name: string;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encoding = isASCII(this.name) ? \"ascii\" : \"utf16le\";\n\t\tthis.payload = new Bytes(\n\t\t\t1 + this.name.length * (encoding === \"ascii\" ? 1 : 2),\n\t\t);\n\t\tthis.payload[0] = encoding === \"ascii\" ? 0x0 : 0x2;\n\t\tlet nameBuffer: BytesView;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tnameBuffer = stringToUint8ArrayUTF16BE(this.name);\n\t\t} else {\n\t\t\tnameBuffer = Bytes.from(this.name, \"ascii\");\n\t\t}\n\t\t// Copy at most 16 bytes\n\t\tthis.payload.set(\n\t\t\tnameBuffer.subarray(0, Math.min(16, nameBuffer.length)),\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { name: this.name },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCNameReportOptions {\n\tname: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameReport)\n@ccValueProperty(\"name\", NodeNamingAndLocationCCValues.name)\nexport class NodeNamingAndLocationCCNameReport extends NodeNamingAndLocationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCNameReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NodeNamingAndLocationCCNameReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst encoding = raw.payload[0] === 2 ? \"utf16le\" : \"ascii\";\n\t\tconst nameBuffer = raw.payload.subarray(1);\n\t\tlet name: string;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tvalidatePayload(nameBuffer.length % 2 === 0);\n\t\t\tname = uint8ArrayToStringUTF16BE(nameBuffer);\n\t\t} else {\n\t\t\tname = nameBuffer.toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tname,\n\t\t});\n\t}\n\n\tpublic readonly name: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { name: this.name },\n\t\t};\n\t}\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameGet)\n@expectedCCResponse(NodeNamingAndLocationCCNameReport)\nexport class NodeNamingAndLocationCCNameGet extends NodeNamingAndLocationCC {}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCLocationSetOptions {\n\tlocation: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationSet)\n@useSupervision()\nexport class NodeNamingAndLocationCCLocationSet\n\textends NodeNamingAndLocationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCLocationSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.location = options.location;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): NodeNamingAndLocationCCLocationSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new NodeNamingAndLocationCCLocationSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic location: string;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encoding = isASCII(this.location) ? \"ascii\" : \"utf16le\";\n\t\tthis.payload = new Bytes(\n\t\t\t1 + this.location.length * (encoding === \"ascii\" ? 1 : 2),\n\t\t);\n\t\tthis.payload[0] = encoding === \"ascii\" ? 0x0 : 0x2;\n\t\tlet locationBuffer: BytesView;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tlocationBuffer = stringToUint8ArrayUTF16BE(this.location);\n\t\t} else {\n\t\t\tlocationBuffer = Bytes.from(this.location, \"ascii\");\n\t\t}\n\t\t// Copy at most 16 bytes\n\t\tthis.payload.set(\n\t\t\tlocationBuffer.subarray(0, Math.min(16, locationBuffer.length)),\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { location: this.location },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCLocationReportOptions {\n\tlocation: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationReport)\n@ccValueProperty(\"location\", NodeNamingAndLocationCCValues.location)\nexport class NodeNamingAndLocationCCLocationReport\n\textends NodeNamingAndLocationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCLocationReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.location = options.location;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NodeNamingAndLocationCCLocationReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst encoding = raw.payload[0] === 2 ? \"utf16le\" : \"ascii\";\n\t\tconst locationBuffer = raw.payload.subarray(1);\n\t\tlet location: string;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tvalidatePayload(locationBuffer.length % 2 === 0);\n\t\t\tlocation = uint8ArrayToStringUTF16BE(locationBuffer);\n\t\t} else {\n\t\t\tlocation = locationBuffer.toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tlocation,\n\t\t});\n\t}\n\n\tpublic readonly location: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { location: this.location },\n\t\t};\n\t}\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationGet)\n@expectedCCResponse(NodeNamingAndLocationCCLocationReport)\nexport class NodeNamingAndLocationCCLocationGet\n\textends NodeNamingAndLocationCC\n{}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAYO;AACP,oBAKO;AAEP,iBASO;AACP,0BAKO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwB7C,SAAS,QAAQ,KAAW;AAC3B,SAAO,iBAAiB,KAAK,GAAG;AACjC;AAFS;IAKI,8BAA0B,MAAA;8BADtC,mCAAI,2BAAe,0BAA0B,CAAC,CAAC;;;;oBACA;;;;kDAAA,YAAa;WAAA;;;;;;;;6BA2E3D,gDAAA,CAAc;iCAkCd,oDAAA,CAAc;AAjCf,mBAAA,MAAA,MAAA,qBAAA,EAAA,MAAA,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AAkC,MAAA;8BAF9C,yCAAU,0CAA6B,WAAW,OAClD,kDAAmB,qCAAqC,CAAC;;;;oBAEjD;0DAAA,YAAuB;WAAA;;;;;;;;AADhC,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
|
|
2
2
|
import type { GetDeviceConfig } from "@zwave-js/config";
|
|
3
3
|
import { CommandClasses, type ControlsCC, Duration, type EndpointId, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type NodeId, type Notification, type NotificationState, type SinglecastCC, type SupervisionResult, type SupportsCC, type ValueID, type ValueMetadataNumeric, type WithAddress } from "@zwave-js/core";
|
|
4
|
-
import { Bytes } from "@zwave-js/shared";
|
|
4
|
+
import { Bytes, type BytesView } from "@zwave-js/shared";
|
|
5
5
|
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation } from "../lib/API.js";
|
|
6
6
|
import { CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
7
7
|
import { NotificationCommand } from "../lib/_Types.js";
|
|
@@ -405,7 +405,7 @@ export type NotificationCCReportOptions = {
|
|
|
405
405
|
notificationType?: number;
|
|
406
406
|
notificationEvent?: number;
|
|
407
407
|
notificationStatus?: number;
|
|
408
|
-
eventParameters?:
|
|
408
|
+
eventParameters?: BytesView;
|
|
409
409
|
sequenceNumber?: number;
|
|
410
410
|
};
|
|
411
411
|
export declare class NotificationCCReport extends NotificationCC {
|
|
@@ -417,7 +417,7 @@ export declare class NotificationCCReport extends NotificationCC {
|
|
|
417
417
|
notificationType: number | undefined;
|
|
418
418
|
notificationStatus: boolean | number | undefined;
|
|
419
419
|
notificationEvent: number | undefined;
|
|
420
|
-
eventParameters:
|
|
420
|
+
eventParameters: BytesView | Duration | Record<string, number> | number | undefined;
|
|
421
421
|
sequenceNumber: number | undefined;
|
|
422
422
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
423
423
|
private parseEventParameters;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/NotificationCC.ts"],
|
|
4
|
-
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\tDuration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype LogNode,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype NodeId,\n\ttype Notification,\n\ttype NotificationState,\n\ttype NotificationValue,\n\tSecurityClass,\n\ttype SinglecastCC,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype ValueID,\n\tValueMetadata,\n\ttype ValueMetadataNumeric,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodeBitMask,\n\tgetCCName,\n\tgetNotification,\n\tgetNotificationEventName,\n\tgetNotificationName,\n\tgetNotificationValue,\n\tgetNotificationValueName,\n\tisZWaveError,\n\tparseBitMask,\n\ttimespan,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\tBytes,\n\tbuffer2hex,\n\tisUint8Array,\n\tnum2hex,\n\tpick,\n} from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tthrowUnsupportedProperty,\n} from \"../lib/API.js\";\nimport {\n\tCCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\tInvalidCC,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n\tgetEffectiveCCVersion,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\tgetCCCommandConstructor,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { isNotificationEventPayload } from \"../lib/NotificationEventPayload.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NotificationCommand, UserCodeCommand } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\nimport { AssociationGroupInfoCC } from \"./AssociationGroupInfoCC.js\";\n\nexport const NotificationCCValues = V.defineCCValues(\n\tCommandClasses.Notification,\n\t{\n\t\t...V.staticProperty(\"supportsV1Alarm\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"supportedNotificationTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"notificationMode\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"lastRefresh\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\n\t\t\t\"alarmType\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Alarm Type\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"alarmLevel\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Alarm Level\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticPropertyAndKeyWithName(\n\t\t\t\"doorStateSimple\",\n\t\t\t\"Access Control\",\n\t\t\t\"Door state (simple)\",\n\t\t\t{\n\t\t\t\t// Must be a number for compatibility reasons\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Door state (simple)\",\n\t\t\t\tstates: {\n\t\t\t\t\t[0x16]: \"Window/door is open\",\n\t\t\t\t\t[0x17]: \"Window/door is closed\",\n\t\t\t\t},\n\t\t\t\tccSpecific: {\n\t\t\t\t\tnotificationType: 0x06,\n\t\t\t\t},\n\t\t\t} as const,\n\t\t\t{\n\t\t\t\tautoCreate: shouldAutoCreateSimpleDoorSensorValue,\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticPropertyAndKeyWithName(\n\t\t\t\"doorTiltState\",\n\t\t\t\"Access Control\",\n\t\t\t\"Door tilt state\",\n\t\t\t{\n\t\t\t\t// Must be a number for compatibility reasons\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Door tilt state\",\n\t\t\t\tstates: {\n\t\t\t\t\t[0x00]: \"Window/door is not tilted\",\n\t\t\t\t\t[0x01]: \"Window/door is tilted\",\n\t\t\t\t},\n\t\t\t\tccSpecific: {\n\t\t\t\t\tnotificationType: 0x06,\n\t\t\t\t},\n\t\t\t} as const,\n\t\t\t{\n\t\t\t\t// This is created when the tilt state is first received.\n\t\t\t\tautoCreate: false,\n\t\t\t} as const,\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"supportedNotificationEvents\",\n\t\t\t\"supportedNotificationEvents\",\n\t\t\t(notificationType: number) => notificationType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"supportedNotificationEvents\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true, supportsEndpoints: false },\n\t\t),\n\t\t...V.dynamicPropertyWithName(\n\t\t\t\"unknownNotificationType\",\n\t\t\t(notificationType: number) =>\n\t\t\t\t`UNKNOWN_${num2hex(notificationType)}`,\n\t\t\t({ property }) =>\n\t\t\t\ttypeof property === \"string\"\n\t\t\t\t&& property.startsWith(\"UNKNOWN_0x\"),\n\t\t\t(notificationType: number) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `Unknown notification (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tnotificationType,\n\t\t\t\t\t)\n\t\t\t\t})`,\n\t\t\t\tccSpecific: { notificationType },\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"unknownNotificationVariable\",\n\t\t\t(notificationType: number, notificationName: string) =>\n\t\t\t\tnotificationName,\n\t\t\t\"unknown\",\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"string\" && propertyKey === \"unknown\",\n\t\t\t(notificationType: number, notificationName: string) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `${notificationName}: Unknown value`,\n\t\t\t\tccSpecific: { notificationType },\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"notificationVariable\",\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\t(notificationName: string, variableName: string) =>\n\t\t\t\tnotificationName,\n\t\t\t(notificationName: string, variableName: string) => variableName,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"string\" && typeof propertyKey === \"string\",\n\t\t\t// Notification metadata is so dynamic, it does not make sense to define it here\n\t\t\tundefined,\n\t\t),\n\t},\n);\n\nexport function shouldAutoCreateSimpleDoorSensorValue(\n\tctx: GetValueDB,\n\tendpoint: EndpointId,\n): boolean {\n\tconst valueDB = ctx.tryGetValueDB(endpoint.nodeId);\n\tif (!valueDB) return false;\n\tconst supportedACEvents = valueDB.getValue<readonly number[]>(\n\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t// Access Control\n\t\t\t0x06,\n\t\t).endpoint(endpoint.index),\n\t);\n\tif (!supportedACEvents) return false;\n\treturn (\n\t\tsupportedACEvents.includes(\n\t\t\t// Window/door is open\n\t\t\t0x16,\n\t\t)\n\t\t&& supportedACEvents.includes(\n\t\t\t// Window/door is closed\n\t\t\t0x17,\n\t\t)\n\t);\n}\n\n@API(CommandClasses.Notification)\nexport class NotificationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: NotificationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase NotificationCommand.Report:\n\t\t\tcase NotificationCommand.Get:\n\t\t\t\treturn true; // These exist starting with V1\n\n\t\t\tcase NotificationCommand.Set:\n\t\t\tcase NotificationCommand.SupportedGet:\n\t\t\t\treturn this.version >= 2;\n\n\t\t\tcase NotificationCommand.EventSupportedGet:\n\t\t\t\treturn this.version >= 3;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: NotificationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tconst valueId: ValueID = {\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t};\n\t\t\tif (NotificationCCValues.notificationVariable.is(valueId)) {\n\t\t\t\tconst notificationType: number | undefined = this\n\t\t\t\t\t.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific\n\t\t\t\t\t?.notificationType;\n\t\t\t\tif (notificationType != undefined) {\n\t\t\t\t\treturn this.getInternal({ notificationType });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic async getInternal(\n\t\toptions: NotificationCCGetOptions,\n\t): Promise<NotificationCCReport | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Get,\n\t\t);\n\n\t\tconst cc = new NotificationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand<NotificationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: NotificationCCReportOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Report,\n\t\t);\n\n\t\tconst cc = new NotificationCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(options: NotificationCCGetOptions) {\n\t\tconst response = await this.getInternal(options);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"notificationStatus\",\n\t\t\t\t\"notificationEvent\",\n\t\t\t\t\"alarmLevel\",\n\t\t\t\t\"eventParameters\",\n\t\t\t\t\"sequenceNumber\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tnotificationType: number,\n\t\tnotificationStatus: boolean,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Set,\n\t\t);\n\n\t\tconst cc = new NotificationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tnotificationType,\n\t\t\tnotificationStatus,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupported() {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new NotificationCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNotificationCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"supportsV1Alarm\",\n\t\t\t\t\"supportedNotificationTypes\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async getSupportedEvents(\n\t\tnotificationType: number,\n\t): Promise<MaybeNotKnown<readonly number[]>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.EventSupportedGet,\n\t\t);\n\n\t\tconst cc = new NotificationCCEventSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tnotificationType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNotificationCCEventSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.supportedEvents;\n\t}\n}\n\nexport function getNotificationEnumBehavior(\n\tnotification: Notification,\n\tvalueConfig: NotificationState,\n): \"none\" | \"extend\" | \"replace\" {\n\tconst variable = notification.variables.find((v) =>\n\t\tv.states.has(valueConfig.value)\n\t);\n\tif (!variable) return \"none\";\n\tconst numStatesWithEnums = [...variable.states.values()].filter(\n\t\t(val) => val.parameter?.type === \"enum\",\n\t).length;\n\tif (numStatesWithEnums === 0) return \"none\";\n\t// An enum value replaces the original value if there is only a single possible state\n\t// which also has an enum parameter\n\tif (numStatesWithEnums === 1 && variable.states.size === 1) {\n\t\treturn \"replace\";\n\t}\n\treturn \"extend\";\n}\n\nexport function getNotificationStateValueWithEnum(\n\tstateValue: number,\n\tenumValue: number,\n): number {\n\treturn (stateValue << 8) | enumValue;\n}\n\n/**\n * Returns the metadata to use for a known notification value.\n * Can be used to extend a previously defined metadata,\n * e.g. for V2 notifications that don't allow discovering supported events.\n */\nexport function getNotificationValueMetadata(\n\tprevious: ValueMetadataNumeric | undefined,\n\tnotification: Notification,\n\tvalueConfig: NotificationState,\n): ValueMetadataNumeric {\n\tconst metadata: ValueMetadataNumeric = previous ?? {\n\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\tlabel: valueConfig.variableName,\n\t\tstates: {},\n\t\tccSpecific: {\n\t\t\tnotificationType: notification.type,\n\t\t},\n\t};\n\tif (valueConfig.idle) {\n\t\tmetadata.states![0] = \"idle\";\n\t}\n\tconst enumBehavior = getNotificationEnumBehavior(\n\t\tnotification,\n\t\tvalueConfig,\n\t);\n\tif (enumBehavior !== \"replace\") {\n\t\tmetadata.states![valueConfig.value] = valueConfig.label;\n\t}\n\tif (valueConfig.parameter?.type === \"enum\") {\n\t\tfor (\n\t\t\tconst [key, label] of Object.entries(valueConfig.parameter.values)\n\t\t) {\n\t\t\tconst value = parseInt(key);\n\t\t\tconst stateKey = enumBehavior === \"replace\"\n\t\t\t\t? value\n\t\t\t\t: getNotificationStateValueWithEnum(valueConfig.value, value);\n\t\t\tmetadata.states![stateKey] = label;\n\t\t}\n\t}\n\n\treturn metadata;\n}\n\n@commandClass(CommandClasses.Notification)\n@implementedVersion(8)\n@ccValues(NotificationCCValues)\nexport class NotificationCC extends CommandClass {\n\tdeclare ccCommand: NotificationCommand;\n\n\t// former AlarmCC (v1..v2)\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t];\n\t}\n\n\tprivate async determineNotificationMode(\n\t\tctx: GetValueDB & GetNode<NodeId & SupportsCC> & LogNode,\n\t\tapi: NotificationCCAPI,\n\t\tsupportedNotificationEvents: ReadonlyMap<number, readonly number[]>,\n\t): Promise<\"push\" | \"pull\"> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// SDS14223: If the supporting node does not support the Association Command Class,\n\t\t// it may be concluded that the supporting node implements Pull Mode and discovery may be aborted.\n\t\tif (!node.supportsCC(CommandClasses.Association)) return \"pull\";\n\n\t\tif (node.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\t\ttry {\n\t\t\t\tconst groupsIssueingNotifications = AssociationGroupInfoCC\n\t\t\t\t\t.findGroupsForIssuedCommand(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tNotificationCommand.Report,\n\t\t\t\t\t);\n\t\t\t\treturn groupsIssueingNotifications.length > 0 ? \"push\" : \"pull\";\n\t\t\t} catch {\n\t\t\t\t// We might be dealing with an older cache file, fall back to testing\n\t\t\t}\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `determining whether this node is pull or push...`,\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\t// Find a notification type with at least one supported event\n\t\tfor (const [type, events] of supportedNotificationEvents) {\n\t\t\tif (events.length === 0) continue;\n\t\t\t// Enable the event and request the status\n\t\t\tawait api.set(type, true);\n\t\t\ttry {\n\t\t\t\tconst resp = await api.get({\n\t\t\t\t\tnotificationType: type,\n\t\t\t\t\tnotificationEvent: events[0],\n\t\t\t\t});\n\t\t\t\tswitch (resp?.notificationStatus) {\n\t\t\t\t\tcase 0xff:\n\t\t\t\t\t\treturn \"push\";\n\t\t\t\t\tcase 0xfe:\n\t\t\t\t\tcase 0x00:\n\t\t\t\t\t\treturn \"pull\";\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t}\n\n\t\t// If everything failed, e.g. because the node is V1/V2, assume this is a \"push\" node.\n\t\t// If we assumed \"pull\", we would have to query the node regularly, which can cause\n\t\t// the node to return old (already handled) notifications.\n\t\t// https://github.com/zwave-js/zwave-js/issues/5626\n\t\treturn \"push\";\n\t}\n\n\t/** Whether the node implements push or pull notifications */\n\tpublic static getNotificationMode(\n\t\tctx: GetValueDB,\n\t\tnode: NodeId,\n\t): MaybeNotKnown<\"push\" | \"pull\"> {\n\t\treturn ctx\n\t\t\t.getValueDB(node.id)\n\t\t\t.getValue(NotificationCCValues.notificationMode.id);\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Notification,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// If one Association group issues Notification Reports,\n\t\t// we must associate ourselves with that channel\n\t\ttry {\n\t\t\tawait ccUtils.assignLifelineIssueingCommand(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tthis.ccId,\n\t\t\t\tNotificationCommand.Report,\n\t\t\t);\n\t\t} catch {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage: `Configuring associations to receive ${\n\t\t\t\t\tgetCCName(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t)\n\t\t\t\t} reports failed!`,\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t}\n\n\t\tlet supportsV1Alarm = false;\n\t\tif (api.version >= 2) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying supported notification types...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\n\t\t\tconst suppResponse = await api.getSupported();\n\t\t\tif (!suppResponse) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"Querying supported notification types timed out, skipping interview...\",\n\t\t\t\t\tlevel: \"warn\",\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsupportsV1Alarm = suppResponse.supportsV1Alarm;\n\t\t\tconst supportedNotificationTypes =\n\t\t\t\tsuppResponse.supportedNotificationTypes;\n\t\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\t\tgetNotificationName,\n\t\t\t);\n\t\t\tconst supportedNotificationEvents = new Map<\n\t\t\t\tnumber,\n\t\t\t\treadonly number[]\n\t\t\t>();\n\n\t\t\tconst logMessage = `received supported notification types:${\n\t\t\t\tsupportedNotificationNames\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\n\t\t\tif (api.version >= 3) {\n\t\t\t\t// Query each notification for its supported events\n\t\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`querying supported notification events for ${name}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tconst supportedEvents = await api.getSupportedEvents(type);\n\t\t\t\t\tif (supportedEvents) {\n\t\t\t\t\t\tsupportedNotificationEvents.set(type, supportedEvents);\n\t\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`received supported notification events for ${name}: ${\n\t\t\t\t\t\t\t\t\tsupportedEvents\n\t\t\t\t\t\t\t\t\t\t.map(String)\n\t\t\t\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tdirection: \"inbound\",\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// Determine whether the node is a push or pull node\n\t\t\tlet notificationMode = this.getValue<\"push\" | \"pull\">(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.notificationMode,\n\t\t\t);\n\t\t\tif (notificationMode !== \"push\" && notificationMode !== \"pull\") {\n\t\t\t\tnotificationMode = await this.determineNotificationMode(\n\t\t\t\t\tctx,\n\t\t\t\t\tapi,\n\t\t\t\t\tsupportedNotificationEvents,\n\t\t\t\t);\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tNotificationCCValues.notificationMode,\n\t\t\t\t\tnotificationMode,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (notificationMode === \"pull\") {\n\t\t\t\tawait this.refreshValues(ctx);\n\t\t\t} /* if (notificationMode === \"push\") */ else {\n\t\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\t\tconst name = supportedNotificationNames[i];\n\t\t\t\t\tconst notification = getNotification(type);\n\n\t\t\t\t\t// Enable reports for each notification type\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage: `enabling notifications for ${name}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tawait api.set(type, true);\n\n\t\t\t\t\t// Set the value to idle if possible and there is no value yet\n\t\t\t\t\tif (notification) {\n\t\t\t\t\t\tconst events = supportedNotificationEvents.get(type);\n\t\t\t\t\t\tif (events) {\n\t\t\t\t\t\t\t// Find all variables that are supported by this node and have an idle state\n\t\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\t\tconst variable of notification.variables\n\t\t\t\t\t\t\t\t\t.filter((v) => !!v.idle)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t[...variable.states.keys()].some((key) =>\n\t\t\t\t\t\t\t\t\t\tevents.includes(key)\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\t\t\tconst value = NotificationCCValues\n\t\t\t\t\t\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\t\t\t\t\t\tvariable.name,\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t// Set the value to idle if it has no value yet\n\t\t\t\t\t\t\t\t\t// TODO: GH#1028\n\t\t\t\t\t\t\t\t\t// * do this only if the last update was more than 5 minutes ago\n\t\t\t\t\t\t\t\t\t// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tthis.getValue(ctx, value)\n\t\t\t\t\t\t\t\t\t\t\t== undefined\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\t\t0, /* idle */\n\t\t\t\t\t\t\t\t\t\t);\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\t}\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// Only create metadata for V1 values if necessary\n\t\tif (api.version === 1 || supportsV1Alarm) {\n\t\t\tthis.ensureMetadata(ctx, NotificationCCValues.alarmType);\n\t\t\tthis.ensureMetadata(ctx, NotificationCCValues.alarmLevel);\n\t\t}\n\n\t\t// Also create metadata for values mapped through compat config\n\t\tconst mappings = ctx.getDeviceConfig?.(this.nodeId as number)\n\t\t\t?.compat?.alarmMapping;\n\t\tif (mappings) {\n\t\t\t// Find all mappings to a valid notification variable\n\t\t\tconst supportedNotifications = new Map<number, Set<number>>();\n\t\t\tfor (const { to } of mappings) {\n\t\t\t\tconst notification = getNotification(to.notificationType);\n\t\t\t\tif (!notification) continue;\n\t\t\t\tconst valueConfig = getNotificationValue(\n\t\t\t\t\tnotification,\n\t\t\t\t\tto.notificationEvent,\n\t\t\t\t);\n\n\t\t\t\t// Remember supported notification types and events to create the internal values later\n\t\t\t\tif (!supportedNotifications.has(to.notificationType)) {\n\t\t\t\t\tsupportedNotifications.set(\n\t\t\t\t\t\tto.notificationType,\n\t\t\t\t\t\tnew Set(),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst supportedNotificationTypesSet = supportedNotifications\n\t\t\t\t\t.get(to.notificationType)!;\n\t\t\t\tsupportedNotificationTypesSet.add(to.notificationEvent);\n\n\t\t\t\tif (valueConfig?.type !== \"state\") continue;\n\n\t\t\t\tconst notificationValue = NotificationCCValues\n\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\tvalueConfig.variableName,\n\t\t\t\t\t);\n\n\t\t\t\t// Create or update the metadata\n\t\t\t\tconst metadata = getNotificationValueMetadata(\n\t\t\t\t\tthis.getMetadata(ctx, notificationValue),\n\t\t\t\t\tnotification,\n\t\t\t\t\tvalueConfig,\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(ctx, notificationValue, metadata);\n\n\t\t\t\t// Set the value to idle if it has no value yet\n\t\t\t\tif (valueConfig.idle) {\n\t\t\t\t\t// TODO: GH#1028\n\t\t\t\t\t// * do this only if the last update was more than 5 minutes ago\n\t\t\t\t\t// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.getValue(ctx, notificationValue) == undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tnotificationValue,\n\t\t\t\t\t\t\t0, /* idle */\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// Remember supported notification types and events in the cache\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t\t\t[...supportedNotifications.keys()],\n\t\t\t);\n\t\t\tfor (const [type, events] of supportedNotifications) {\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tNotificationCCValues.supportedNotificationEvents(type),\n\t\t\t\t\t[...events],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\t// Refreshing values only works on pull nodes\n\t\tif (NotificationCC.getNotificationMode(ctx, node) === \"pull\") {\n\t\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\t\tconst api = CCAPI.create(\n\t\t\t\tCommandClasses.Notification,\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t).withOptions({\n\t\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t\t});\n\n\t\t\t// Load supported notification types and events from cache\n\t\t\tconst supportedNotificationTypes = this.getValue<readonly number[]>(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t\t) ?? [];\n\t\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\t\tgetNotificationName,\n\t\t\t);\n\n\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t\t// Always query each notification for its current status\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: `querying notification status for ${name}...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tconst response = await api.getInternal({\n\t\t\t\t\tnotificationType: type,\n\t\t\t\t});\n\t\t\t\t// NotificationReports don't store their values themselves,\n\t\t\t\t// because the behaviour is too complex and spans the lifetime\n\t\t\t\t// of several reports. Thus we handle it in the Node instance\n\n\t\t\t\t// @ts-expect-error\n\t\t\t\tif (response) await node.handleCommand(response);\n\t\t\t}\n\n\t\t\t// Remember when we did this\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.lastRefresh,\n\t\t\t\tDate.now(),\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic shouldRefreshValues(\n\t\tthis: SinglecastCC<this>,\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t): boolean {\n\t\t// Pull-mode nodes must be polled regularly\n\n\t\tconst isPullMode = NotificationCC.getNotificationMode(\n\t\t\tctx,\n\t\t\tthis.getNode(ctx)!,\n\t\t) === \"pull\";\n\t\tif (!isPullMode) return false;\n\n\t\tconst lastUpdated = this.getValue<number>(\n\t\t\tctx,\n\t\t\tNotificationCCValues.lastRefresh,\n\t\t);\n\n\t\treturn (\n\t\t\tlastUpdated == undefined\n\t\t\t|| Date.now() - lastUpdated > timespan.hours(6)\n\t\t);\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCSetOptions {\n\tnotificationType: number;\n\tnotificationStatus: boolean;\n}\n\n@CCCommand(NotificationCommand.Set)\n@useSupervision()\nexport class NotificationCCSet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.notificationType = options.notificationType;\n\t\tthis.notificationStatus = options.notificationStatus;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst notificationType = raw.payload[0];\n\t\tconst notificationStatus = raw.payload[1] === 0xff;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t\tnotificationStatus,\n\t\t});\n\t}\n\n\tpublic notificationType: number;\n\tpublic notificationStatus: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.notificationType,\n\t\t\tthis.notificationStatus ? 0xff : 0x00,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t\tstatus: this.notificationStatus,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type NotificationCCReportOptions = {\n\talarmType?: number;\n\talarmLevel?: number;\n\tnotificationType?: number;\n\tnotificationEvent?: number;\n\tnotificationStatus?: number;\n\teventParameters?: Uint8Array;\n\tsequenceNumber?: number;\n};\n\n@CCCommand(NotificationCommand.Report)\n@useSupervision()\nexport class NotificationCCReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tif (options.alarmType != undefined) {\n\t\t\tthis.alarmType = options.alarmType;\n\t\t\tthis.alarmLevel = options.alarmLevel;\n\t\t}\n\n\t\tif (options.notificationType != undefined) {\n\t\t\tthis.notificationType = options.notificationType;\n\t\t\tthis.notificationStatus = options.notificationStatus ?? true;\n\t\t\tthis.notificationEvent = options.notificationEvent;\n\t\t\tthis.eventParameters = options.eventParameters;\n\t\t\tthis.sequenceNumber = options.sequenceNumber;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst alarmType = raw.payload[0];\n\t\tconst alarmLevel = raw.payload[1];\n\n\t\t// Byte 2 used to be zensorNetSourceNodeId in V2 and V3, but we don't care about that\n\n\t\tif (raw.payload.length < 7) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\talarmType,\n\t\t\t\talarmLevel,\n\t\t\t});\n\t\t}\n\n\t\t// V2+ requires the alarm bytes to be zero. Manufacturers don't care though, so we don't enforce that.\n\t\t// Don't use the version to decide because we might discard notifications\n\t\t// before the interview is complete\n\n\t\tconst notificationStatus = raw.payload[3];\n\t\tconst notificationType = raw.payload[4];\n\t\tconst notificationEvent = raw.payload[5];\n\n\t\tconst containsSeqNum = !!(raw.payload[6] & 0b1000_0000);\n\t\tconst numEventParams = raw.payload[6] & 0b11111;\n\t\tlet eventParameters: Uint8Array | undefined;\n\t\tif (numEventParams > 0) {\n\t\t\tvalidatePayload(raw.payload.length >= 7 + numEventParams);\n\t\t\teventParameters = raw.payload.subarray(7, 7 + numEventParams);\n\t\t}\n\t\tlet sequenceNumber: number | undefined;\n\t\tif (containsSeqNum) {\n\t\t\tvalidatePayload(\n\t\t\t\traw.payload.length >= 7 + numEventParams + 1,\n\t\t\t);\n\t\t\tsequenceNumber = raw.payload[7 + numEventParams];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\talarmType,\n\t\t\talarmLevel,\n\t\t\tnotificationStatus,\n\t\t\tnotificationType,\n\t\t\tnotificationEvent,\n\t\t\teventParameters,\n\t\t\tsequenceNumber,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tconst ccVersion = getEffectiveCCVersion(ctx, this);\n\n\t\t// Check if we need to re-interpret the alarm values somehow\n\t\tif (\n\t\t\tthis.alarmType != undefined\n\t\t\t&& this.alarmLevel != undefined\n\t\t\t&& this.alarmType !== 0\n\t\t) {\n\t\t\tif (ccVersion >= 2) {\n\t\t\t\t// Check if the device actually supports Notification CC, but chooses\n\t\t\t\t// to send Alarm frames instead (GH#1034)\n\t\t\t\tconst supportedNotificationTypes = this.getValue<\n\t\t\t\t\treadonly number[]\n\t\t\t\t>(ctx, NotificationCCValues.supportedNotificationTypes);\n\t\t\t\tif (\n\t\t\t\t\tisArray(supportedNotificationTypes)\n\t\t\t\t\t&& supportedNotificationTypes.includes(this.alarmType)\n\t\t\t\t) {\n\t\t\t\t\tconst supportedNotificationEvents = this.getValue<\n\t\t\t\t\t\treadonly number[]\n\t\t\t\t\t>(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t\t\t\t\tthis.alarmType,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\tisArray(supportedNotificationEvents)\n\t\t\t\t\t\t&& supportedNotificationEvents.includes(this.alarmLevel)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// This alarm frame corresponds to a valid notification event\n\t\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t\t`treating V1 Alarm frame as Notification Report`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.notificationType = this.alarmType;\n\t\t\t\t\t\tthis.notificationEvent = this.alarmLevel;\n\t\t\t\t\t\tthis.alarmType = undefined;\n\t\t\t\t\t\tthis.alarmLevel = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// V1 Alarm, check if there is a compat option to map this V1 report to a V2+ report\n\t\t\t\tconst mapping = ctx.getDeviceConfig?.(\n\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t)?.compat?.alarmMapping;\n\t\t\t\tconst match = mapping?.find(\n\t\t\t\t\t(m) =>\n\t\t\t\t\t\tm.from.alarmType === this.alarmType\n\t\t\t\t\t\t&& (m.from.alarmLevel == undefined\n\t\t\t\t\t\t\t|| m.from.alarmLevel === this.alarmLevel),\n\t\t\t\t);\n\t\t\t\tif (match) {\n\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t`compat mapping found, treating V1 Alarm frame as Notification Report`,\n\t\t\t\t\t);\n\t\t\t\t\tthis.notificationType = match.to.notificationType;\n\t\t\t\t\tthis.notificationEvent = match.to.notificationEvent;\n\t\t\t\t\tif (match.to.eventParameters) {\n\t\t\t\t\t\tthis.eventParameters = {};\n\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\tconst [key, val] of Object.entries(\n\t\t\t\t\t\t\t\tmatch.to.eventParameters,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif (typeof val === \"number\") {\n\t\t\t\t\t\t\t\tthis.eventParameters[key] = val;\n\t\t\t\t\t\t\t} else if (val === \"alarmLevel\") {\n\t\t\t\t\t\t\t\tthis.eventParameters[key] = this.alarmLevel;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// After mapping we do not set the legacy V1 values to undefined\n\t\t\t\t\t// Otherwise, adding a new mapping will be a breaking change\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Now we can interpret the event parameters and turn them into something useful\n\t\tthis.parseEventParameters(ctx);\n\n\t\tif (this.alarmType != undefined) {\n\t\t\tconst alarmTypeValue = NotificationCCValues.alarmType;\n\t\t\tthis.ensureMetadata(ctx, alarmTypeValue);\n\t\t\tthis.setValue(ctx, alarmTypeValue, this.alarmType);\n\t\t}\n\t\tif (this.alarmLevel != undefined) {\n\t\t\tconst alarmLevelValue = NotificationCCValues.alarmLevel;\n\t\t\tthis.ensureMetadata(ctx, alarmLevelValue);\n\t\t\tthis.setValue(ctx, alarmLevelValue, this.alarmLevel);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic alarmType: number | undefined;\n\tpublic alarmLevel: number | undefined;\n\n\tpublic notificationType: number | undefined;\n\tpublic notificationStatus: boolean | number | undefined;\n\tpublic notificationEvent: number | undefined;\n\n\tpublic eventParameters:\n\t\t| Uint8Array\n\t\t| Duration\n\t\t| Record<string, number>\n\t\t| number\n\t\t| undefined;\n\n\tpublic sequenceNumber: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord = {};\n\t\tif (this.alarmType) {\n\t\t\tmessage = {\n\t\t\t\t\"V1 alarm type\": this.alarmType,\n\t\t\t\t\"V1 alarm level\": this.alarmLevel!,\n\t\t\t};\n\t\t}\n\n\t\tlet valueConfig: NotificationValue | undefined;\n\t\tif (this.notificationType) {\n\t\t\tconst notification = getNotification(this.notificationType);\n\t\t\tif (notification) {\n\t\t\t\tvalueConfig = getNotificationValue(\n\t\t\t\t\tnotification,\n\t\t\t\t\tthis.notificationEvent!,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (valueConfig) {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": getNotificationName(\n\t\t\t\t\t\tthis.notificationType,\n\t\t\t\t\t),\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t[`notification ${valueConfig.type}`]: valueConfig.label\n\t\t\t\t\t\t?? `Unknown (${num2hex(this.notificationEvent)})`,\n\t\t\t\t};\n\t\t\t} else if (this.notificationEvent === 0x00) {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": this.notificationType,\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t\"notification state\": \"idle\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": this.notificationType,\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t\"notification event\": num2hex(this.notificationEvent),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (this.sequenceNumber != undefined) {\n\t\t\tmessage[\"sequence number\"] = this.sequenceNumber;\n\t\t}\n\t\tif (this.eventParameters != undefined) {\n\t\t\tif (typeof this.eventParameters === \"number\") {\n\t\t\t\t// Try to look up the enum label\n\t\t\t\tlet found = false;\n\t\t\t\tif (\n\t\t\t\t\tvalueConfig?.parameter?.type === \"enum\"\n\t\t\t\t) {\n\t\t\t\t\tconst label =\n\t\t\t\t\t\tvalueConfig.parameter.values[this.eventParameters];\n\t\t\t\t\tif (label) {\n\t\t\t\t\t\tmessage[\"state parameters\"] = label;\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found) {\n\t\t\t\t\tmessage[\"state parameters\"] = num2hex(this.eventParameters);\n\t\t\t\t}\n\t\t\t} else if (isUint8Array(this.eventParameters)) {\n\t\t\t\tmessage[\"event parameters\"] = buffer2hex(this.eventParameters);\n\t\t\t} else if (this.eventParameters instanceof Duration) {\n\t\t\t\tmessage[\"event parameters\"] = this.eventParameters.toString();\n\t\t\t} else {\n\t\t\t\tmessage[\"event parameters\"] = Object.entries(\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t)\n\t\t\t\t\t.map(([param, val]) => `\\n ${param}: ${num2hex(val)}`)\n\t\t\t\t\t.join(\"\");\n\t\t\t}\n\t\t} else if (\n\t\t\tvalueConfig?.parameter?.type === \"enum\"\n\t\t\t&& valueConfig.parameter.default != undefined\n\t\t) {\n\t\t\tconst label = valueConfig.parameter.values[\n\t\t\t\tvalueConfig.parameter.default\n\t\t\t];\n\t\t\tif (label) {\n\t\t\t\tmessage[\"state parameters\"] = `${label} (omitted)`;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tprivate parseEventParameters(ctx: PersistValuesContext): void {\n\t\t// This only makes sense for V2+ notifications\n\t\tif (\n\t\t\tthis.notificationType == undefined\n\t\t\t|| this.notificationEvent == undefined\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Look up the received notification and value in the config\n\t\tconst notification = getNotification(this.notificationType);\n\t\tif (!notification) return;\n\t\tconst valueConfig = getNotificationValue(\n\t\t\tnotification,\n\t\t\tthis.notificationEvent,\n\t\t);\n\t\tif (!valueConfig) return;\n\n\t\t// Parse the event parameters if possible\n\t\tif (valueConfig.parameter?.type === \"duration\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters contain a Duration\n\t\t\tthis.eventParameters = Duration.parseReport(\n\t\t\t\tthis.eventParameters[0],\n\t\t\t);\n\t\t} else if (valueConfig.parameter?.type === \"commandclass\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters **should** contain a CC, however there might be some exceptions\n\t\t\tif (\n\t\t\t\tthis.eventParameters.length === 1\n\t\t\t\t&& notification.type === 0x06\n\t\t\t\t&& (this.notificationEvent === 0x05\n\t\t\t\t\t|| this.notificationEvent === 0x06)\n\t\t\t) {\n\t\t\t\t// Access control -> Keypad Lock/Unlock operation\n\t\t\t\t// Some devices only send the User ID, not a complete CC payload\n\t\t\t\tthis.eventParameters = {\n\t\t\t\t\tuserId: this.eventParameters[0],\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Try to parse the event parameters - if this fails, we should still handle the notification report\n\t\t\t\ttry {\n\t\t\t\t\t// Convert CommandClass instances to a standardized object representation\n\n\t\t\t\t\t// We do not want to parse asynchronously here, but the `CommandClass.parse` method is async.\n\t\t\t\t\t// However, we only deal with simple CCs that can be parsed synchronously. We can do this\n\t\t\t\t\t// by replicating what `CommandClass.parse` does: determine the correct CC class and call its\n\t\t\t\t\t// `from` method. If that returns a CC instance, we're good to continue.\n\n\t\t\t\t\tconst raw = CCRaw.parse(this.eventParameters);\n\t\t\t\t\tif (raw.ccCommand == undefined) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"event parameters contain an invalid CC\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tconst CommandConstructor = getCCCommandConstructor(\n\t\t\t\t\t\traw.ccId,\n\t\t\t\t\t\traw.ccCommand,\n\t\t\t\t\t);\n\t\t\t\t\tif (!CommandConstructor) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"event parameters contain an invalid CC\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cc = CommandConstructor.from(raw, {\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tframeType: \"singlecast\",\n\t\t\t\t\t\tsourceNodeId: this.nodeId as number,\n\t\t\t\t\t\t// Security encapsulation is handled outside of this CC,\n\t\t\t\t\t\t// so it is not needed here:\n\t\t\t\t\t\thasSecurityClass: () => false,\n\t\t\t\t\t\tgetHighestSecurityClass: () => SecurityClass.None,\n\t\t\t\t\t\tsetSecurityClass: () => {},\n\t\t\t\t\t\tsecurityManager: undefined,\n\t\t\t\t\t\tsecurityManager2: undefined,\n\t\t\t\t\t\tsecurityManagerLR: undefined,\n\t\t\t\t\t});\n\t\t\t\t\tif (cc instanceof Promise) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"Cannot asynchronously parse CC from event parameters\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tvalidatePayload(!(cc instanceof InvalidCC));\n\t\t\t\t\tcc.encapsulatingCC = this as any;\n\n\t\t\t\t\tif (isNotificationEventPayload(cc)) {\n\t\t\t\t\t\tthis.eventParameters = cc\n\t\t\t\t\t\t\t.toNotificationEventParameters();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If a CC has no good toJSON() representation, we're only interested in the payload\n\t\t\t\t\t\tlet json = cc.toJSON();\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\"nodeId\" in json\n\t\t\t\t\t\t\t&& \"ccId\" in json\n\t\t\t\t\t\t\t&& \"payload\" in json\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tjson = pick(json, [\"payload\"]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.eventParameters = json;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisZWaveError(e)\n\t\t\t\t\t\t&& e.code\n\t\t\t\t\t\t\t=== ZWaveErrorCodes.PacketFormat_InvalidPayload\n\t\t\t\t\t\t&& isUint8Array(this.eventParameters)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst { ccId, ccCommand } = CCRaw.parse(\n\t\t\t\t\t\t\tthis.eventParameters,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tccId === CommandClasses[\"User Code\"]\n\t\t\t\t\t\t\t&& ccCommand === UserCodeCommand.Report\n\t\t\t\t\t\t\t&& this.eventParameters.length >= 3\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Access control -> Keypad Lock/Unlock operation\n\t\t\t\t\t\t\t// Some devices report the user code with truncated UserCode reports\n\t\t\t\t\t\t\tthis.eventParameters = {\n\t\t\t\t\t\t\t\tuserId: this.eventParameters[2],\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(\n\t\t\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t\t\t`Failed to parse Notification CC event parameters, ignoring them...`,\n\t\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unexpected error\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (valueConfig.parameter?.type === \"value\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters contain a named value\n\t\t\tthis.eventParameters = {\n\t\t\t\t[valueConfig.parameter.propertyName]: Bytes.view(\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t)\n\t\t\t\t\t.readUIntBE(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tthis.eventParameters.length,\n\t\t\t\t\t),\n\t\t\t};\n\t\t} else if (valueConfig.parameter?.type === \"enum\") {\n\t\t\t// The parameters may contain an enum value\n\t\t\tthis.eventParameters = isUint8Array(this.eventParameters)\n\t\t\t\t\t&& this.eventParameters.length === 1\n\t\t\t\t? this.eventParameters[0]\n\t\t\t\t: undefined;\n\n\t\t\t// Some devices send notifications without an event parameter when they should.\n\t\t\t// In this case, fall back to the default value where possible.\n\n\t\t\tif (\n\t\t\t\tthis.eventParameters == undefined\n\t\t\t\t&& valueConfig.parameter.default != undefined\n\t\t\t) {\n\t\t\t\tthis.eventParameters = valueConfig.parameter.default;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tif (this.notificationType != undefined) {\n\t\t\tif (\n\t\t\t\tthis.notificationEvent == undefined\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`Notification CC reports requires the notification event to be set!`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tthis.eventParameters != undefined\n\t\t\t\t&& !isUint8Array(this.eventParameters)\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`When sending Notification CC reports, the event parameters can only be buffers!`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst controlByte =\n\t\t\t\t(this.sequenceNumber != undefined ? 0b1000_0000 : 0)\n\t\t\t\t| ((this.eventParameters?.length ?? 0) & 0b11111);\n\t\t\tthis.payload = Bytes.from([\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0xff,\n\t\t\t\tthis.notificationType,\n\t\t\t\tthis.notificationEvent,\n\t\t\t\tcontrolByte,\n\t\t\t]);\n\t\t\tif (this.eventParameters) {\n\t\t\t\tthis.payload = Bytes.concat([\n\t\t\t\t\tthis.payload,\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t]);\n\t\t\t}\n\t\t\tif (this.sequenceNumber != undefined) {\n\t\t\t\tthis.payload = Bytes.concat([\n\t\t\t\t\tthis.payload,\n\t\t\t\t\tBytes.from([this.sequenceNumber]),\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.payload = Bytes.from([\n\t\t\t\tthis.alarmType ?? 0x00,\n\t\t\t\tthis.alarmLevel ?? 0x00,\n\t\t\t]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n}\n\n// @publicAPI\nexport type NotificationCCGetOptions =\n\t| {\n\t\talarmType: number;\n\t}\n\t| {\n\t\tnotificationType: number;\n\t\tnotificationEvent?: number;\n\t};\n\n@CCCommand(NotificationCommand.Get)\n@expectedCCResponse(NotificationCCReport)\nexport class NotificationCCGet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (\"alarmType\" in options) {\n\t\t\tthis.alarmType = options.alarmType;\n\t\t} else {\n\t\t\tthis.notificationType = options.notificationType;\n\t\t\tthis.notificationEvent = options.notificationEvent;\n\t\t}\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tif (raw.payload.length >= 2) {\n\t\t\tconst notificationType = raw.payload[1];\n\t\t\tlet notificationEvent: number | undefined;\n\t\t\tif (raw.payload.length >= 3 && notificationType != 0xff) {\n\t\t\t\tnotificationEvent = raw.payload[2];\n\t\t\t}\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tnotificationType,\n\t\t\t\tnotificationEvent,\n\t\t\t});\n\t\t} else {\n\t\t\tconst alarmType = raw.payload[0];\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\talarmType,\n\t\t\t});\n\t\t}\n\t}\n\n\t/** Proprietary V1/V2 alarm type */\n\tpublic alarmType: number | undefined;\n\t/** Regulated V3+ notification type */\n\tpublic notificationType: number | undefined;\n\tpublic notificationEvent: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst notificationEvent = this.notificationEvent === 0xff\n\t\t\t? 0x00\n\t\t\t: this.notificationEvent;\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.alarmType ?? 0x00,\n\t\t\tthis.notificationType ?? 0xff,\n\t\t\tnotificationEvent ?? 0x00,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.alarmType != undefined) {\n\t\t\tmessage[\"V1 alarm type\"] = this.alarmType;\n\t\t}\n\t\tif (this.notificationType != undefined) {\n\t\t\tmessage[\"notification type\"] = getNotificationName(\n\t\t\t\tthis.notificationType,\n\t\t\t);\n\t\t\tif (this.notificationEvent != undefined) {\n\t\t\t\tmessage[\"notification event\"] = getNotificationEventName(\n\t\t\t\t\tthis.notificationType,\n\t\t\t\t\tthis.notificationEvent,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCSupportedReportOptions {\n\tsupportsV1Alarm: boolean;\n\tsupportedNotificationTypes: number[];\n}\n\n@CCCommand(NotificationCommand.SupportedReport)\n@ccValueProperty(\"supportsV1Alarm\", NotificationCCValues.supportsV1Alarm)\n@ccValueProperty(\n\t\"supportedNotificationTypes\",\n\tNotificationCCValues.supportedNotificationTypes,\n)\nexport class NotificationCCSupportedReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.supportsV1Alarm = options.supportsV1Alarm;\n\t\tthis.supportedNotificationTypes = options.supportedNotificationTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst supportsV1Alarm = !!(raw.payload[0] & 0b1000_0000);\n\t\tconst numBitMaskBytes = raw.payload[0] & 0b0001_1111;\n\t\tvalidatePayload(\n\t\t\tnumBitMaskBytes > 0,\n\t\t\traw.payload.length >= 1 + numBitMaskBytes,\n\t\t);\n\t\tconst notificationBitMask = raw.payload.subarray(\n\t\t\t1,\n\t\t\t1 + numBitMaskBytes,\n\t\t);\n\t\tconst supportedNotificationTypes = parseBitMask(\n\t\t\tnotificationBitMask,\n\t\t\t// bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n\t\t\t0,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportsV1Alarm,\n\t\t\tsupportedNotificationTypes,\n\t\t});\n\t}\n\n\tpublic supportsV1Alarm: boolean;\n\n\tpublic supportedNotificationTypes: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst bitMask = encodeBitMask(\n\t\t\tthis.supportedNotificationTypes,\n\t\t\tMath.max(...this.supportedNotificationTypes),\n\t\t\t0,\n\t\t);\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.supportsV1Alarm ? 0b1000_0000 : 0) | bitMask.length,\n\t\t\t]),\n\t\t\tbitMask,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supports V1 alarm\": this.supportsV1Alarm,\n\t\t\t\t\"supported notification types\": this.supportedNotificationTypes\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(t) => `\\n\u00B7 ${getNotificationName(t)}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(NotificationCommand.SupportedGet)\n@expectedCCResponse(NotificationCCSupportedReport)\nexport class NotificationCCSupportedGet extends NotificationCC {}\n\n// @publicAPI\nexport interface NotificationCCEventSupportedReportOptions {\n\tnotificationType: number;\n\tsupportedEvents: number[];\n}\n\n@CCCommand(NotificationCommand.EventSupportedReport)\nexport class NotificationCCEventSupportedReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCEventSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.notificationType = options.notificationType;\n\t\tthis.supportedEvents = options.supportedEvents;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCEventSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst notificationType = raw.payload[0];\n\t\tconst numBitMaskBytes = raw.payload[1] & 0b000_11111;\n\n\t\tif (numBitMaskBytes === 0) {\n\t\t\t// Notification type is not supported\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tnotificationType,\n\t\t\t\tsupportedEvents: [],\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 2 + numBitMaskBytes);\n\t\tconst eventBitMask = raw.payload.subarray(2, 2 + numBitMaskBytes);\n\t\tconst supportedEvents = parseBitMask(\n\t\t\teventBitMask,\n\t\t\t// In this mask, bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n\t\t\t0,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t\tsupportedEvents,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Store which events this notification supports\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t\tthis.notificationType,\n\t\t\t),\n\t\t\tthis.supportedEvents,\n\t\t);\n\n\t\t// For each event, predefine the value metadata\n\t\tconst notification = getNotification(this.notificationType);\n\n\t\tif (!notification) {\n\t\t\t// This is an unknown notification\n\t\t\tthis.setMetadata(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.unknownNotificationType(\n\t\t\t\t\tthis.notificationType,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// This is a standardized notification\n\t\t\tlet isFirst = true;\n\t\t\tfor (const value of this.supportedEvents) {\n\t\t\t\t// Find out which property we need to update\n\t\t\t\tconst valueConfig = getNotificationValue(notification, value);\n\t\t\t\tif (valueConfig?.type === \"state\") {\n\t\t\t\t\tconst notificationValue = NotificationCCValues\n\t\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\t\tvalueConfig.variableName,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// After we've created the metadata initially, extend it\n\t\t\t\t\tconst metadata = getNotificationValueMetadata(\n\t\t\t\t\t\tisFirst\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: this.getMetadata(ctx, notificationValue),\n\t\t\t\t\t\tnotification,\n\t\t\t\t\t\tvalueConfig,\n\t\t\t\t\t);\n\n\t\t\t\t\tthis.setMetadata(ctx, notificationValue, metadata);\n\n\t\t\t\t\tisFirst = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic notificationType: number;\n\tpublic supportedEvents: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.notificationType, 0]);\n\t\tif (this.supportedEvents.length > 0) {\n\t\t\tconst bitMask = encodeBitMask(\n\t\t\t\tthis.supportedEvents,\n\t\t\t\tMath.max(...this.supportedEvents),\n\t\t\t\t0,\n\t\t\t);\n\t\t\tthis.payload[1] = bitMask.length;\n\t\t\tthis.payload = Bytes.concat([this.payload, bitMask]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t\t\"supported events\": this.supportedEvents\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(e) =>\n\t\t\t\t\t\t\t`\\n\u00B7 ${\n\t\t\t\t\t\t\t\tgetNotificationValueName(\n\t\t\t\t\t\t\t\t\tthis.notificationType,\n\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCEventSupportedGetOptions {\n\tnotificationType: number;\n}\n\n@CCCommand(NotificationCommand.EventSupportedGet)\n@expectedCCResponse(NotificationCCEventSupportedReport)\nexport class NotificationCCEventSupportedGet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCEventSupportedGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.notificationType = options.notificationType;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCEventSupportedGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst notificationType = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t});\n\t}\n\n\tpublic notificationType: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.notificationType]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAuCO;AACP,oBAMO;AAEP,wBAAwB;AACxB,iBAMO;AACP,0BAQO;AACP,oCAUO;AACP,sCAA2C;AAC3C,oBAAkB;AAClB,mBAAqD;AACrD,cAAyB;AACzB,oCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiIjC,SAAU,sCACf,KACA,UAAoB;AAEpB,QAAM,UAAU,IAAI,cAAc,SAAS,MAAM;AACjD,MAAI,CAAC;AAAS,WAAO;AACrB,QAAM,oBAAoB,QAAQ,SACjC,+CAAqB;;IAEpB;EAAI,EACH,SAAS,SAAS,KAAK,CAAC;AAE3B,MAAI,CAAC;AAAmB,WAAO;AAC/B,SACC,kBAAkB;;IAEjB;EAAI,KAEF,kBAAkB;;IAEpB;EAAI;AAGP;AAvBgB;IA0BH,qBAAiB,MAAA;8BAD7B,mCAAI,2BAAe,YAAY,CAAC;;;;oBACM;;;;;;yCAAA,YAAa;WAAA;;;;;;;;gCA+DlD,0CAAA,CAAc;yBAiBd,mCAAA,CAAc;yBAed,mCAAA,CAAc;wCA4Cd,kDAAA,CAAc;AA3Ef,mBAAA,MAAA,MAAA,wBAAA,EAAA,MAAA,UAAA,MAA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;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,yBAAqB,iCAAoB,KAAK,gBAAgB;UAC9D,oBAAoB,KAAK,gBACvB,IACA,CAAC,MACA;WACC,sCACC,KAAK,kBACL,CAAC,CAEH,EAAE,EAEH,KAAK,EAAE;;;IAGZ;;;;IAUY,mCAA+B,MAAA;8BAF3C,yCAAU,iCAAoB,iBAAiB,OAC/C,kDAAmB,kCAAkC,CAAC;;;;oBACF;uDAAA,YAAc;WAAA;;;;;;;;AAAnE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA4D;AAE5D,YAAM,OAAO;AACb,WAAK,mBAAmB,QAAQ;IACjC;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,mBAAmB,IAAI,QAAQ,CAAC;AAEtC,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;OACA;IACF;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,gBAAgB,CAAC;AACjD,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,yBAAqB,iCAAoB,KAAK,gBAAgB;;;IAGjE;;;;",
|
|
4
|
+
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\tDuration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype LogNode,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype NodeId,\n\ttype Notification,\n\ttype NotificationState,\n\ttype NotificationValue,\n\tSecurityClass,\n\ttype SinglecastCC,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype ValueID,\n\tValueMetadata,\n\ttype ValueMetadataNumeric,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodeBitMask,\n\tgetCCName,\n\tgetNotification,\n\tgetNotificationEventName,\n\tgetNotificationName,\n\tgetNotificationValue,\n\tgetNotificationValueName,\n\tisZWaveError,\n\tparseBitMask,\n\ttimespan,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\tBytes,\n\ttype BytesView,\n\tbuffer2hex,\n\tisUint8Array,\n\tnum2hex,\n\tpick,\n} from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tthrowUnsupportedProperty,\n} from \"../lib/API.js\";\nimport {\n\tCCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\tInvalidCC,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n\tgetEffectiveCCVersion,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\tgetCCCommandConstructor,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { isNotificationEventPayload } from \"../lib/NotificationEventPayload.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NotificationCommand, UserCodeCommand } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\nimport { AssociationGroupInfoCC } from \"./AssociationGroupInfoCC.js\";\n\nexport const NotificationCCValues = V.defineCCValues(\n\tCommandClasses.Notification,\n\t{\n\t\t...V.staticProperty(\"supportsV1Alarm\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"supportedNotificationTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"notificationMode\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"lastRefresh\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\n\t\t\t\"alarmType\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Alarm Type\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"alarmLevel\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Alarm Level\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticPropertyAndKeyWithName(\n\t\t\t\"doorStateSimple\",\n\t\t\t\"Access Control\",\n\t\t\t\"Door state (simple)\",\n\t\t\t{\n\t\t\t\t// Must be a number for compatibility reasons\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Door state (simple)\",\n\t\t\t\tstates: {\n\t\t\t\t\t[0x16]: \"Window/door is open\",\n\t\t\t\t\t[0x17]: \"Window/door is closed\",\n\t\t\t\t},\n\t\t\t\tccSpecific: {\n\t\t\t\t\tnotificationType: 0x06,\n\t\t\t\t},\n\t\t\t} as const,\n\t\t\t{\n\t\t\t\tautoCreate: shouldAutoCreateSimpleDoorSensorValue,\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticPropertyAndKeyWithName(\n\t\t\t\"doorTiltState\",\n\t\t\t\"Access Control\",\n\t\t\t\"Door tilt state\",\n\t\t\t{\n\t\t\t\t// Must be a number for compatibility reasons\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Door tilt state\",\n\t\t\t\tstates: {\n\t\t\t\t\t[0x00]: \"Window/door is not tilted\",\n\t\t\t\t\t[0x01]: \"Window/door is tilted\",\n\t\t\t\t},\n\t\t\t\tccSpecific: {\n\t\t\t\t\tnotificationType: 0x06,\n\t\t\t\t},\n\t\t\t} as const,\n\t\t\t{\n\t\t\t\t// This is created when the tilt state is first received.\n\t\t\t\tautoCreate: false,\n\t\t\t} as const,\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"supportedNotificationEvents\",\n\t\t\t\"supportedNotificationEvents\",\n\t\t\t(notificationType: number) => notificationType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"supportedNotificationEvents\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true, supportsEndpoints: false },\n\t\t),\n\t\t...V.dynamicPropertyWithName(\n\t\t\t\"unknownNotificationType\",\n\t\t\t(notificationType: number) =>\n\t\t\t\t`UNKNOWN_${num2hex(notificationType)}`,\n\t\t\t({ property }) =>\n\t\t\t\ttypeof property === \"string\"\n\t\t\t\t&& property.startsWith(\"UNKNOWN_0x\"),\n\t\t\t(notificationType: number) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `Unknown notification (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tnotificationType,\n\t\t\t\t\t)\n\t\t\t\t})`,\n\t\t\t\tccSpecific: { notificationType },\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"unknownNotificationVariable\",\n\t\t\t(notificationType: number, notificationName: string) =>\n\t\t\t\tnotificationName,\n\t\t\t\"unknown\",\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"string\" && propertyKey === \"unknown\",\n\t\t\t(notificationType: number, notificationName: string) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `${notificationName}: Unknown value`,\n\t\t\t\tccSpecific: { notificationType },\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"notificationVariable\",\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\t(notificationName: string, variableName: string) =>\n\t\t\t\tnotificationName,\n\t\t\t(notificationName: string, variableName: string) => variableName,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"string\" && typeof propertyKey === \"string\",\n\t\t\t// Notification metadata is so dynamic, it does not make sense to define it here\n\t\t\tundefined,\n\t\t),\n\t},\n);\n\nexport function shouldAutoCreateSimpleDoorSensorValue(\n\tctx: GetValueDB,\n\tendpoint: EndpointId,\n): boolean {\n\tconst valueDB = ctx.tryGetValueDB(endpoint.nodeId);\n\tif (!valueDB) return false;\n\tconst supportedACEvents = valueDB.getValue<readonly number[]>(\n\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t// Access Control\n\t\t\t0x06,\n\t\t).endpoint(endpoint.index),\n\t);\n\tif (!supportedACEvents) return false;\n\treturn (\n\t\tsupportedACEvents.includes(\n\t\t\t// Window/door is open\n\t\t\t0x16,\n\t\t)\n\t\t&& supportedACEvents.includes(\n\t\t\t// Window/door is closed\n\t\t\t0x17,\n\t\t)\n\t);\n}\n\n@API(CommandClasses.Notification)\nexport class NotificationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: NotificationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase NotificationCommand.Report:\n\t\t\tcase NotificationCommand.Get:\n\t\t\t\treturn true; // These exist starting with V1\n\n\t\t\tcase NotificationCommand.Set:\n\t\t\tcase NotificationCommand.SupportedGet:\n\t\t\t\treturn this.version >= 2;\n\n\t\t\tcase NotificationCommand.EventSupportedGet:\n\t\t\t\treturn this.version >= 3;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: NotificationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tconst valueId: ValueID = {\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t};\n\t\t\tif (NotificationCCValues.notificationVariable.is(valueId)) {\n\t\t\t\tconst notificationType: number | undefined = this\n\t\t\t\t\t.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific\n\t\t\t\t\t?.notificationType;\n\t\t\t\tif (notificationType != undefined) {\n\t\t\t\t\treturn this.getInternal({ notificationType });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic async getInternal(\n\t\toptions: NotificationCCGetOptions,\n\t): Promise<NotificationCCReport | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Get,\n\t\t);\n\n\t\tconst cc = new NotificationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand<NotificationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: NotificationCCReportOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Report,\n\t\t);\n\n\t\tconst cc = new NotificationCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(options: NotificationCCGetOptions) {\n\t\tconst response = await this.getInternal(options);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"notificationStatus\",\n\t\t\t\t\"notificationEvent\",\n\t\t\t\t\"alarmLevel\",\n\t\t\t\t\"eventParameters\",\n\t\t\t\t\"sequenceNumber\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tnotificationType: number,\n\t\tnotificationStatus: boolean,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Set,\n\t\t);\n\n\t\tconst cc = new NotificationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tnotificationType,\n\t\t\tnotificationStatus,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupported() {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new NotificationCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNotificationCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"supportsV1Alarm\",\n\t\t\t\t\"supportedNotificationTypes\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async getSupportedEvents(\n\t\tnotificationType: number,\n\t): Promise<MaybeNotKnown<readonly number[]>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.EventSupportedGet,\n\t\t);\n\n\t\tconst cc = new NotificationCCEventSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tnotificationType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNotificationCCEventSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.supportedEvents;\n\t}\n}\n\nexport function getNotificationEnumBehavior(\n\tnotification: Notification,\n\tvalueConfig: NotificationState,\n): \"none\" | \"extend\" | \"replace\" {\n\tconst variable = notification.variables.find((v) =>\n\t\tv.states.has(valueConfig.value)\n\t);\n\tif (!variable) return \"none\";\n\tconst numStatesWithEnums = [...variable.states.values()].filter(\n\t\t(val) => val.parameter?.type === \"enum\",\n\t).length;\n\tif (numStatesWithEnums === 0) return \"none\";\n\t// An enum value replaces the original value if there is only a single possible state\n\t// which also has an enum parameter\n\tif (numStatesWithEnums === 1 && variable.states.size === 1) {\n\t\treturn \"replace\";\n\t}\n\treturn \"extend\";\n}\n\nexport function getNotificationStateValueWithEnum(\n\tstateValue: number,\n\tenumValue: number,\n): number {\n\treturn (stateValue << 8) | enumValue;\n}\n\n/**\n * Returns the metadata to use for a known notification value.\n * Can be used to extend a previously defined metadata,\n * e.g. for V2 notifications that don't allow discovering supported events.\n */\nexport function getNotificationValueMetadata(\n\tprevious: ValueMetadataNumeric | undefined,\n\tnotification: Notification,\n\tvalueConfig: NotificationState,\n): ValueMetadataNumeric {\n\tconst metadata: ValueMetadataNumeric = previous ?? {\n\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\tlabel: valueConfig.variableName,\n\t\tstates: {},\n\t\tccSpecific: {\n\t\t\tnotificationType: notification.type,\n\t\t},\n\t};\n\tif (valueConfig.idle) {\n\t\tmetadata.states![0] = \"idle\";\n\t}\n\tconst enumBehavior = getNotificationEnumBehavior(\n\t\tnotification,\n\t\tvalueConfig,\n\t);\n\tif (enumBehavior !== \"replace\") {\n\t\tmetadata.states![valueConfig.value] = valueConfig.label;\n\t}\n\tif (valueConfig.parameter?.type === \"enum\") {\n\t\tfor (\n\t\t\tconst [key, label] of Object.entries(valueConfig.parameter.values)\n\t\t) {\n\t\t\tconst value = parseInt(key);\n\t\t\tconst stateKey = enumBehavior === \"replace\"\n\t\t\t\t? value\n\t\t\t\t: getNotificationStateValueWithEnum(valueConfig.value, value);\n\t\t\tmetadata.states![stateKey] = label;\n\t\t}\n\t}\n\n\treturn metadata;\n}\n\n@commandClass(CommandClasses.Notification)\n@implementedVersion(8)\n@ccValues(NotificationCCValues)\nexport class NotificationCC extends CommandClass {\n\tdeclare ccCommand: NotificationCommand;\n\n\t// former AlarmCC (v1..v2)\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t];\n\t}\n\n\tprivate async determineNotificationMode(\n\t\tctx: GetValueDB & GetNode<NodeId & SupportsCC> & LogNode,\n\t\tapi: NotificationCCAPI,\n\t\tsupportedNotificationEvents: ReadonlyMap<number, readonly number[]>,\n\t): Promise<\"push\" | \"pull\"> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// SDS14223: If the supporting node does not support the Association Command Class,\n\t\t// it may be concluded that the supporting node implements Pull Mode and discovery may be aborted.\n\t\tif (!node.supportsCC(CommandClasses.Association)) return \"pull\";\n\n\t\tif (node.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\t\ttry {\n\t\t\t\tconst groupsIssueingNotifications = AssociationGroupInfoCC\n\t\t\t\t\t.findGroupsForIssuedCommand(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tNotificationCommand.Report,\n\t\t\t\t\t);\n\t\t\t\treturn groupsIssueingNotifications.length > 0 ? \"push\" : \"pull\";\n\t\t\t} catch {\n\t\t\t\t// We might be dealing with an older cache file, fall back to testing\n\t\t\t}\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `determining whether this node is pull or push...`,\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\t// Find a notification type with at least one supported event\n\t\tfor (const [type, events] of supportedNotificationEvents) {\n\t\t\tif (events.length === 0) continue;\n\t\t\t// Enable the event and request the status\n\t\t\tawait api.set(type, true);\n\t\t\ttry {\n\t\t\t\tconst resp = await api.get({\n\t\t\t\t\tnotificationType: type,\n\t\t\t\t\tnotificationEvent: events[0],\n\t\t\t\t});\n\t\t\t\tswitch (resp?.notificationStatus) {\n\t\t\t\t\tcase 0xff:\n\t\t\t\t\t\treturn \"push\";\n\t\t\t\t\tcase 0xfe:\n\t\t\t\t\tcase 0x00:\n\t\t\t\t\t\treturn \"pull\";\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t}\n\n\t\t// If everything failed, e.g. because the node is V1/V2, assume this is a \"push\" node.\n\t\t// If we assumed \"pull\", we would have to query the node regularly, which can cause\n\t\t// the node to return old (already handled) notifications.\n\t\t// https://github.com/zwave-js/zwave-js/issues/5626\n\t\treturn \"push\";\n\t}\n\n\t/** Whether the node implements push or pull notifications */\n\tpublic static getNotificationMode(\n\t\tctx: GetValueDB,\n\t\tnode: NodeId,\n\t): MaybeNotKnown<\"push\" | \"pull\"> {\n\t\treturn ctx\n\t\t\t.getValueDB(node.id)\n\t\t\t.getValue(NotificationCCValues.notificationMode.id);\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Notification,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// If one Association group issues Notification Reports,\n\t\t// we must associate ourselves with that channel\n\t\ttry {\n\t\t\tawait ccUtils.assignLifelineIssueingCommand(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tthis.ccId,\n\t\t\t\tNotificationCommand.Report,\n\t\t\t);\n\t\t} catch {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage: `Configuring associations to receive ${\n\t\t\t\t\tgetCCName(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t)\n\t\t\t\t} reports failed!`,\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t}\n\n\t\tlet supportsV1Alarm = false;\n\t\tif (api.version >= 2) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying supported notification types...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\n\t\t\tconst suppResponse = await api.getSupported();\n\t\t\tif (!suppResponse) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"Querying supported notification types timed out, skipping interview...\",\n\t\t\t\t\tlevel: \"warn\",\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsupportsV1Alarm = suppResponse.supportsV1Alarm;\n\t\t\tconst supportedNotificationTypes =\n\t\t\t\tsuppResponse.supportedNotificationTypes;\n\t\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\t\tgetNotificationName,\n\t\t\t);\n\t\t\tconst supportedNotificationEvents = new Map<\n\t\t\t\tnumber,\n\t\t\t\treadonly number[]\n\t\t\t>();\n\n\t\t\tconst logMessage = `received supported notification types:${\n\t\t\t\tsupportedNotificationNames\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\n\t\t\tif (api.version >= 3) {\n\t\t\t\t// Query each notification for its supported events\n\t\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`querying supported notification events for ${name}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tconst supportedEvents = await api.getSupportedEvents(type);\n\t\t\t\t\tif (supportedEvents) {\n\t\t\t\t\t\tsupportedNotificationEvents.set(type, supportedEvents);\n\t\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`received supported notification events for ${name}: ${\n\t\t\t\t\t\t\t\t\tsupportedEvents\n\t\t\t\t\t\t\t\t\t\t.map(String)\n\t\t\t\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tdirection: \"inbound\",\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// Determine whether the node is a push or pull node\n\t\t\tlet notificationMode = this.getValue<\"push\" | \"pull\">(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.notificationMode,\n\t\t\t);\n\t\t\tif (notificationMode !== \"push\" && notificationMode !== \"pull\") {\n\t\t\t\tnotificationMode = await this.determineNotificationMode(\n\t\t\t\t\tctx,\n\t\t\t\t\tapi,\n\t\t\t\t\tsupportedNotificationEvents,\n\t\t\t\t);\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tNotificationCCValues.notificationMode,\n\t\t\t\t\tnotificationMode,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (notificationMode === \"pull\") {\n\t\t\t\tawait this.refreshValues(ctx);\n\t\t\t} /* if (notificationMode === \"push\") */ else {\n\t\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\t\tconst name = supportedNotificationNames[i];\n\t\t\t\t\tconst notification = getNotification(type);\n\n\t\t\t\t\t// Enable reports for each notification type\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage: `enabling notifications for ${name}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tawait api.set(type, true);\n\n\t\t\t\t\t// Set the value to idle if possible and there is no value yet\n\t\t\t\t\tif (notification) {\n\t\t\t\t\t\tconst events = supportedNotificationEvents.get(type);\n\t\t\t\t\t\tif (events) {\n\t\t\t\t\t\t\t// Find all variables that are supported by this node and have an idle state\n\t\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\t\tconst variable of notification.variables\n\t\t\t\t\t\t\t\t\t.filter((v) => !!v.idle)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t[...variable.states.keys()].some((key) =>\n\t\t\t\t\t\t\t\t\t\tevents.includes(key)\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\t\t\tconst value = NotificationCCValues\n\t\t\t\t\t\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\t\t\t\t\t\tvariable.name,\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t// Set the value to idle if it has no value yet\n\t\t\t\t\t\t\t\t\t// TODO: GH#1028\n\t\t\t\t\t\t\t\t\t// * do this only if the last update was more than 5 minutes ago\n\t\t\t\t\t\t\t\t\t// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tthis.getValue(ctx, value)\n\t\t\t\t\t\t\t\t\t\t\t== undefined\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\t\t0, /* idle */\n\t\t\t\t\t\t\t\t\t\t);\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\t}\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// Only create metadata for V1 values if necessary\n\t\tif (api.version === 1 || supportsV1Alarm) {\n\t\t\tthis.ensureMetadata(ctx, NotificationCCValues.alarmType);\n\t\t\tthis.ensureMetadata(ctx, NotificationCCValues.alarmLevel);\n\t\t}\n\n\t\t// Also create metadata for values mapped through compat config\n\t\tconst mappings = ctx.getDeviceConfig?.(this.nodeId as number)\n\t\t\t?.compat?.alarmMapping;\n\t\tif (mappings) {\n\t\t\t// Find all mappings to a valid notification variable\n\t\t\tconst supportedNotifications = new Map<number, Set<number>>();\n\t\t\tfor (const { to } of mappings) {\n\t\t\t\tconst notification = getNotification(to.notificationType);\n\t\t\t\tif (!notification) continue;\n\t\t\t\tconst valueConfig = getNotificationValue(\n\t\t\t\t\tnotification,\n\t\t\t\t\tto.notificationEvent,\n\t\t\t\t);\n\n\t\t\t\t// Remember supported notification types and events to create the internal values later\n\t\t\t\tif (!supportedNotifications.has(to.notificationType)) {\n\t\t\t\t\tsupportedNotifications.set(\n\t\t\t\t\t\tto.notificationType,\n\t\t\t\t\t\tnew Set(),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst supportedNotificationTypesSet = supportedNotifications\n\t\t\t\t\t.get(to.notificationType)!;\n\t\t\t\tsupportedNotificationTypesSet.add(to.notificationEvent);\n\n\t\t\t\tif (valueConfig?.type !== \"state\") continue;\n\n\t\t\t\tconst notificationValue = NotificationCCValues\n\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\tvalueConfig.variableName,\n\t\t\t\t\t);\n\n\t\t\t\t// Create or update the metadata\n\t\t\t\tconst metadata = getNotificationValueMetadata(\n\t\t\t\t\tthis.getMetadata(ctx, notificationValue),\n\t\t\t\t\tnotification,\n\t\t\t\t\tvalueConfig,\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(ctx, notificationValue, metadata);\n\n\t\t\t\t// Set the value to idle if it has no value yet\n\t\t\t\tif (valueConfig.idle) {\n\t\t\t\t\t// TODO: GH#1028\n\t\t\t\t\t// * do this only if the last update was more than 5 minutes ago\n\t\t\t\t\t// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.getValue(ctx, notificationValue) == undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tnotificationValue,\n\t\t\t\t\t\t\t0, /* idle */\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// Remember supported notification types and events in the cache\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t\t\t[...supportedNotifications.keys()],\n\t\t\t);\n\t\t\tfor (const [type, events] of supportedNotifications) {\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tNotificationCCValues.supportedNotificationEvents(type),\n\t\t\t\t\t[...events],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\t// Refreshing values only works on pull nodes\n\t\tif (NotificationCC.getNotificationMode(ctx, node) === \"pull\") {\n\t\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\t\tconst api = CCAPI.create(\n\t\t\t\tCommandClasses.Notification,\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t).withOptions({\n\t\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t\t});\n\n\t\t\t// Load supported notification types and events from cache\n\t\t\tconst supportedNotificationTypes = this.getValue<readonly number[]>(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t\t) ?? [];\n\t\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\t\tgetNotificationName,\n\t\t\t);\n\n\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t\t// Always query each notification for its current status\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: `querying notification status for ${name}...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tconst response = await api.getInternal({\n\t\t\t\t\tnotificationType: type,\n\t\t\t\t});\n\t\t\t\t// NotificationReports don't store their values themselves,\n\t\t\t\t// because the behaviour is too complex and spans the lifetime\n\t\t\t\t// of several reports. Thus we handle it in the Node instance\n\n\t\t\t\t// @ts-expect-error\n\t\t\t\tif (response) await node.handleCommand(response);\n\t\t\t}\n\n\t\t\t// Remember when we did this\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.lastRefresh,\n\t\t\t\tDate.now(),\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic shouldRefreshValues(\n\t\tthis: SinglecastCC<this>,\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t): boolean {\n\t\t// Pull-mode nodes must be polled regularly\n\n\t\tconst isPullMode = NotificationCC.getNotificationMode(\n\t\t\tctx,\n\t\t\tthis.getNode(ctx)!,\n\t\t) === \"pull\";\n\t\tif (!isPullMode) return false;\n\n\t\tconst lastUpdated = this.getValue<number>(\n\t\t\tctx,\n\t\t\tNotificationCCValues.lastRefresh,\n\t\t);\n\n\t\treturn (\n\t\t\tlastUpdated == undefined\n\t\t\t|| Date.now() - lastUpdated > timespan.hours(6)\n\t\t);\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCSetOptions {\n\tnotificationType: number;\n\tnotificationStatus: boolean;\n}\n\n@CCCommand(NotificationCommand.Set)\n@useSupervision()\nexport class NotificationCCSet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.notificationType = options.notificationType;\n\t\tthis.notificationStatus = options.notificationStatus;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst notificationType = raw.payload[0];\n\t\tconst notificationStatus = raw.payload[1] === 0xff;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t\tnotificationStatus,\n\t\t});\n\t}\n\n\tpublic notificationType: number;\n\tpublic notificationStatus: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.notificationType,\n\t\t\tthis.notificationStatus ? 0xff : 0x00,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t\tstatus: this.notificationStatus,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type NotificationCCReportOptions = {\n\talarmType?: number;\n\talarmLevel?: number;\n\tnotificationType?: number;\n\tnotificationEvent?: number;\n\tnotificationStatus?: number;\n\teventParameters?: BytesView;\n\tsequenceNumber?: number;\n};\n\n@CCCommand(NotificationCommand.Report)\n@useSupervision()\nexport class NotificationCCReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tif (options.alarmType != undefined) {\n\t\t\tthis.alarmType = options.alarmType;\n\t\t\tthis.alarmLevel = options.alarmLevel;\n\t\t}\n\n\t\tif (options.notificationType != undefined) {\n\t\t\tthis.notificationType = options.notificationType;\n\t\t\tthis.notificationStatus = options.notificationStatus ?? true;\n\t\t\tthis.notificationEvent = options.notificationEvent;\n\t\t\tthis.eventParameters = options.eventParameters;\n\t\t\tthis.sequenceNumber = options.sequenceNumber;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst alarmType = raw.payload[0];\n\t\tconst alarmLevel = raw.payload[1];\n\n\t\t// Byte 2 used to be zensorNetSourceNodeId in V2 and V3, but we don't care about that\n\n\t\tif (raw.payload.length < 7) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\talarmType,\n\t\t\t\talarmLevel,\n\t\t\t});\n\t\t}\n\n\t\t// V2+ requires the alarm bytes to be zero. Manufacturers don't care though, so we don't enforce that.\n\t\t// Don't use the version to decide because we might discard notifications\n\t\t// before the interview is complete\n\n\t\tconst notificationStatus = raw.payload[3];\n\t\tconst notificationType = raw.payload[4];\n\t\tconst notificationEvent = raw.payload[5];\n\n\t\tconst containsSeqNum = !!(raw.payload[6] & 0b1000_0000);\n\t\tconst numEventParams = raw.payload[6] & 0b11111;\n\t\tlet eventParameters: BytesView | undefined;\n\t\tif (numEventParams > 0) {\n\t\t\tvalidatePayload(raw.payload.length >= 7 + numEventParams);\n\t\t\teventParameters = raw.payload.subarray(7, 7 + numEventParams);\n\t\t}\n\t\tlet sequenceNumber: number | undefined;\n\t\tif (containsSeqNum) {\n\t\t\tvalidatePayload(\n\t\t\t\traw.payload.length >= 7 + numEventParams + 1,\n\t\t\t);\n\t\t\tsequenceNumber = raw.payload[7 + numEventParams];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\talarmType,\n\t\t\talarmLevel,\n\t\t\tnotificationStatus,\n\t\t\tnotificationType,\n\t\t\tnotificationEvent,\n\t\t\teventParameters,\n\t\t\tsequenceNumber,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tconst ccVersion = getEffectiveCCVersion(ctx, this);\n\n\t\t// Check if we need to re-interpret the alarm values somehow\n\t\tif (\n\t\t\tthis.alarmType != undefined\n\t\t\t&& this.alarmLevel != undefined\n\t\t\t&& this.alarmType !== 0\n\t\t) {\n\t\t\tif (ccVersion >= 2) {\n\t\t\t\t// Check if the device actually supports Notification CC, but chooses\n\t\t\t\t// to send Alarm frames instead (GH#1034)\n\t\t\t\tconst supportedNotificationTypes = this.getValue<\n\t\t\t\t\treadonly number[]\n\t\t\t\t>(ctx, NotificationCCValues.supportedNotificationTypes);\n\t\t\t\tif (\n\t\t\t\t\tisArray(supportedNotificationTypes)\n\t\t\t\t\t&& supportedNotificationTypes.includes(this.alarmType)\n\t\t\t\t) {\n\t\t\t\t\tconst supportedNotificationEvents = this.getValue<\n\t\t\t\t\t\treadonly number[]\n\t\t\t\t\t>(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t\t\t\t\tthis.alarmType,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\tisArray(supportedNotificationEvents)\n\t\t\t\t\t\t&& supportedNotificationEvents.includes(this.alarmLevel)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// This alarm frame corresponds to a valid notification event\n\t\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t\t`treating V1 Alarm frame as Notification Report`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.notificationType = this.alarmType;\n\t\t\t\t\t\tthis.notificationEvent = this.alarmLevel;\n\t\t\t\t\t\tthis.alarmType = undefined;\n\t\t\t\t\t\tthis.alarmLevel = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// V1 Alarm, check if there is a compat option to map this V1 report to a V2+ report\n\t\t\t\tconst mapping = ctx.getDeviceConfig?.(\n\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t)?.compat?.alarmMapping;\n\t\t\t\tconst match = mapping?.find(\n\t\t\t\t\t(m) =>\n\t\t\t\t\t\tm.from.alarmType === this.alarmType\n\t\t\t\t\t\t&& (m.from.alarmLevel == undefined\n\t\t\t\t\t\t\t|| m.from.alarmLevel === this.alarmLevel),\n\t\t\t\t);\n\t\t\t\tif (match) {\n\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t`compat mapping found, treating V1 Alarm frame as Notification Report`,\n\t\t\t\t\t);\n\t\t\t\t\tthis.notificationType = match.to.notificationType;\n\t\t\t\t\tthis.notificationEvent = match.to.notificationEvent;\n\t\t\t\t\tif (match.to.eventParameters) {\n\t\t\t\t\t\tthis.eventParameters = {};\n\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\tconst [key, val] of Object.entries(\n\t\t\t\t\t\t\t\tmatch.to.eventParameters,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif (typeof val === \"number\") {\n\t\t\t\t\t\t\t\tthis.eventParameters[key] = val;\n\t\t\t\t\t\t\t} else if (val === \"alarmLevel\") {\n\t\t\t\t\t\t\t\tthis.eventParameters[key] = this.alarmLevel;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// After mapping we do not set the legacy V1 values to undefined\n\t\t\t\t\t// Otherwise, adding a new mapping will be a breaking change\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Now we can interpret the event parameters and turn them into something useful\n\t\tthis.parseEventParameters(ctx);\n\n\t\tif (this.alarmType != undefined) {\n\t\t\tconst alarmTypeValue = NotificationCCValues.alarmType;\n\t\t\tthis.ensureMetadata(ctx, alarmTypeValue);\n\t\t\tthis.setValue(ctx, alarmTypeValue, this.alarmType);\n\t\t}\n\t\tif (this.alarmLevel != undefined) {\n\t\t\tconst alarmLevelValue = NotificationCCValues.alarmLevel;\n\t\t\tthis.ensureMetadata(ctx, alarmLevelValue);\n\t\t\tthis.setValue(ctx, alarmLevelValue, this.alarmLevel);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic alarmType: number | undefined;\n\tpublic alarmLevel: number | undefined;\n\n\tpublic notificationType: number | undefined;\n\tpublic notificationStatus: boolean | number | undefined;\n\tpublic notificationEvent: number | undefined;\n\n\tpublic eventParameters:\n\t\t| BytesView\n\t\t| Duration\n\t\t| Record<string, number>\n\t\t| number\n\t\t| undefined;\n\n\tpublic sequenceNumber: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord = {};\n\t\tif (this.alarmType) {\n\t\t\tmessage = {\n\t\t\t\t\"V1 alarm type\": this.alarmType,\n\t\t\t\t\"V1 alarm level\": this.alarmLevel!,\n\t\t\t};\n\t\t}\n\n\t\tlet valueConfig: NotificationValue | undefined;\n\t\tif (this.notificationType) {\n\t\t\tconst notification = getNotification(this.notificationType);\n\t\t\tif (notification) {\n\t\t\t\tvalueConfig = getNotificationValue(\n\t\t\t\t\tnotification,\n\t\t\t\t\tthis.notificationEvent!,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (valueConfig) {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": getNotificationName(\n\t\t\t\t\t\tthis.notificationType,\n\t\t\t\t\t),\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t[`notification ${valueConfig.type}`]: valueConfig.label\n\t\t\t\t\t\t?? `Unknown (${num2hex(this.notificationEvent)})`,\n\t\t\t\t};\n\t\t\t} else if (this.notificationEvent === 0x00) {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": this.notificationType,\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t\"notification state\": \"idle\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": this.notificationType,\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t\"notification event\": num2hex(this.notificationEvent),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (this.sequenceNumber != undefined) {\n\t\t\tmessage[\"sequence number\"] = this.sequenceNumber;\n\t\t}\n\t\tif (this.eventParameters != undefined) {\n\t\t\tif (typeof this.eventParameters === \"number\") {\n\t\t\t\t// Try to look up the enum label\n\t\t\t\tlet found = false;\n\t\t\t\tif (\n\t\t\t\t\tvalueConfig?.parameter?.type === \"enum\"\n\t\t\t\t) {\n\t\t\t\t\tconst label =\n\t\t\t\t\t\tvalueConfig.parameter.values[this.eventParameters];\n\t\t\t\t\tif (label) {\n\t\t\t\t\t\tmessage[\"state parameters\"] = label;\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found) {\n\t\t\t\t\tmessage[\"state parameters\"] = num2hex(this.eventParameters);\n\t\t\t\t}\n\t\t\t} else if (isUint8Array(this.eventParameters)) {\n\t\t\t\tmessage[\"event parameters\"] = buffer2hex(this.eventParameters);\n\t\t\t} else if (this.eventParameters instanceof Duration) {\n\t\t\t\tmessage[\"event parameters\"] = this.eventParameters.toString();\n\t\t\t} else {\n\t\t\t\tmessage[\"event parameters\"] = Object.entries(\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t)\n\t\t\t\t\t.map(([param, val]) => `\\n ${param}: ${num2hex(val)}`)\n\t\t\t\t\t.join(\"\");\n\t\t\t}\n\t\t} else if (\n\t\t\tvalueConfig?.parameter?.type === \"enum\"\n\t\t\t&& valueConfig.parameter.default != undefined\n\t\t) {\n\t\t\tconst label = valueConfig.parameter.values[\n\t\t\t\tvalueConfig.parameter.default\n\t\t\t];\n\t\t\tif (label) {\n\t\t\t\tmessage[\"state parameters\"] = `${label} (omitted)`;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tprivate parseEventParameters(ctx: PersistValuesContext): void {\n\t\t// This only makes sense for V2+ notifications\n\t\tif (\n\t\t\tthis.notificationType == undefined\n\t\t\t|| this.notificationEvent == undefined\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Look up the received notification and value in the config\n\t\tconst notification = getNotification(this.notificationType);\n\t\tif (!notification) return;\n\t\tconst valueConfig = getNotificationValue(\n\t\t\tnotification,\n\t\t\tthis.notificationEvent,\n\t\t);\n\t\tif (!valueConfig) return;\n\n\t\t// Parse the event parameters if possible\n\t\tif (valueConfig.parameter?.type === \"duration\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters contain a Duration\n\t\t\tthis.eventParameters = Duration.parseReport(\n\t\t\t\tthis.eventParameters[0],\n\t\t\t);\n\t\t} else if (valueConfig.parameter?.type === \"commandclass\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters **should** contain a CC, however there might be some exceptions\n\t\t\tif (\n\t\t\t\tthis.eventParameters.length === 1\n\t\t\t\t&& notification.type === 0x06\n\t\t\t\t&& (this.notificationEvent === 0x05\n\t\t\t\t\t|| this.notificationEvent === 0x06)\n\t\t\t) {\n\t\t\t\t// Access control -> Keypad Lock/Unlock operation\n\t\t\t\t// Some devices only send the User ID, not a complete CC payload\n\t\t\t\tthis.eventParameters = {\n\t\t\t\t\tuserId: this.eventParameters[0],\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Try to parse the event parameters - if this fails, we should still handle the notification report\n\t\t\t\ttry {\n\t\t\t\t\t// Convert CommandClass instances to a standardized object representation\n\n\t\t\t\t\t// We do not want to parse asynchronously here, but the `CommandClass.parse` method is async.\n\t\t\t\t\t// However, we only deal with simple CCs that can be parsed synchronously. We can do this\n\t\t\t\t\t// by replicating what `CommandClass.parse` does: determine the correct CC class and call its\n\t\t\t\t\t// `from` method. If that returns a CC instance, we're good to continue.\n\n\t\t\t\t\tconst raw = CCRaw.parse(this.eventParameters);\n\t\t\t\t\tif (raw.ccCommand == undefined) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"event parameters contain an invalid CC\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tconst CommandConstructor = getCCCommandConstructor(\n\t\t\t\t\t\traw.ccId,\n\t\t\t\t\t\traw.ccCommand,\n\t\t\t\t\t);\n\t\t\t\t\tif (!CommandConstructor) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"event parameters contain an invalid CC\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cc = CommandConstructor.from(raw, {\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tframeType: \"singlecast\",\n\t\t\t\t\t\tsourceNodeId: this.nodeId as number,\n\t\t\t\t\t\t// Security encapsulation is handled outside of this CC,\n\t\t\t\t\t\t// so it is not needed here:\n\t\t\t\t\t\thasSecurityClass: () => false,\n\t\t\t\t\t\tgetHighestSecurityClass: () => SecurityClass.None,\n\t\t\t\t\t\tsetSecurityClass: () => {},\n\t\t\t\t\t\tsecurityManager: undefined,\n\t\t\t\t\t\tsecurityManager2: undefined,\n\t\t\t\t\t\tsecurityManagerLR: undefined,\n\t\t\t\t\t});\n\t\t\t\t\tif (cc instanceof Promise) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"Cannot asynchronously parse CC from event parameters\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tvalidatePayload(!(cc instanceof InvalidCC));\n\t\t\t\t\tcc.encapsulatingCC = this as any;\n\n\t\t\t\t\tif (isNotificationEventPayload(cc)) {\n\t\t\t\t\t\tthis.eventParameters = cc\n\t\t\t\t\t\t\t.toNotificationEventParameters();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If a CC has no good toJSON() representation, we're only interested in the payload\n\t\t\t\t\t\tlet json = cc.toJSON();\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\"nodeId\" in json\n\t\t\t\t\t\t\t&& \"ccId\" in json\n\t\t\t\t\t\t\t&& \"payload\" in json\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tjson = pick(json, [\"payload\"]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.eventParameters = json;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisZWaveError(e)\n\t\t\t\t\t\t&& e.code\n\t\t\t\t\t\t\t=== ZWaveErrorCodes.PacketFormat_InvalidPayload\n\t\t\t\t\t\t&& isUint8Array(this.eventParameters)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst { ccId, ccCommand } = CCRaw.parse(\n\t\t\t\t\t\t\tthis.eventParameters,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tccId === CommandClasses[\"User Code\"]\n\t\t\t\t\t\t\t&& ccCommand === UserCodeCommand.Report\n\t\t\t\t\t\t\t&& this.eventParameters.length >= 3\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Access control -> Keypad Lock/Unlock operation\n\t\t\t\t\t\t\t// Some devices report the user code with truncated UserCode reports\n\t\t\t\t\t\t\tthis.eventParameters = {\n\t\t\t\t\t\t\t\tuserId: this.eventParameters[2],\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(\n\t\t\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t\t\t`Failed to parse Notification CC event parameters, ignoring them...`,\n\t\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unexpected error\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (valueConfig.parameter?.type === \"value\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters contain a named value\n\t\t\tthis.eventParameters = {\n\t\t\t\t[valueConfig.parameter.propertyName]: Bytes.view(\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t)\n\t\t\t\t\t.readUIntBE(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tthis.eventParameters.length,\n\t\t\t\t\t),\n\t\t\t};\n\t\t} else if (valueConfig.parameter?.type === \"enum\") {\n\t\t\t// The parameters may contain an enum value\n\t\t\tthis.eventParameters = isUint8Array(this.eventParameters)\n\t\t\t\t\t&& this.eventParameters.length === 1\n\t\t\t\t? this.eventParameters[0]\n\t\t\t\t: undefined;\n\n\t\t\t// Some devices send notifications without an event parameter when they should.\n\t\t\t// In this case, fall back to the default value where possible.\n\n\t\t\tif (\n\t\t\t\tthis.eventParameters == undefined\n\t\t\t\t&& valueConfig.parameter.default != undefined\n\t\t\t) {\n\t\t\t\tthis.eventParameters = valueConfig.parameter.default;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tif (this.notificationType != undefined) {\n\t\t\tif (\n\t\t\t\tthis.notificationEvent == undefined\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`Notification CC reports requires the notification event to be set!`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tthis.eventParameters != undefined\n\t\t\t\t&& !isUint8Array(this.eventParameters)\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`When sending Notification CC reports, the event parameters can only be buffers!`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst controlByte =\n\t\t\t\t(this.sequenceNumber != undefined ? 0b1000_0000 : 0)\n\t\t\t\t| ((this.eventParameters?.length ?? 0) & 0b11111);\n\t\t\tthis.payload = Bytes.from([\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0xff,\n\t\t\t\tthis.notificationType,\n\t\t\t\tthis.notificationEvent,\n\t\t\t\tcontrolByte,\n\t\t\t]);\n\t\t\tif (this.eventParameters) {\n\t\t\t\tthis.payload = Bytes.concat([\n\t\t\t\t\tthis.payload,\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t]);\n\t\t\t}\n\t\t\tif (this.sequenceNumber != undefined) {\n\t\t\t\tthis.payload = Bytes.concat([\n\t\t\t\t\tthis.payload,\n\t\t\t\t\tBytes.from([this.sequenceNumber]),\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.payload = Bytes.from([\n\t\t\t\tthis.alarmType ?? 0x00,\n\t\t\t\tthis.alarmLevel ?? 0x00,\n\t\t\t]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n}\n\n// @publicAPI\nexport type NotificationCCGetOptions =\n\t| {\n\t\talarmType: number;\n\t}\n\t| {\n\t\tnotificationType: number;\n\t\tnotificationEvent?: number;\n\t};\n\n@CCCommand(NotificationCommand.Get)\n@expectedCCResponse(NotificationCCReport)\nexport class NotificationCCGet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (\"alarmType\" in options) {\n\t\t\tthis.alarmType = options.alarmType;\n\t\t} else {\n\t\t\tthis.notificationType = options.notificationType;\n\t\t\tthis.notificationEvent = options.notificationEvent;\n\t\t}\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tif (raw.payload.length >= 2) {\n\t\t\tconst notificationType = raw.payload[1];\n\t\t\tlet notificationEvent: number | undefined;\n\t\t\tif (raw.payload.length >= 3 && notificationType != 0xff) {\n\t\t\t\tnotificationEvent = raw.payload[2];\n\t\t\t}\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tnotificationType,\n\t\t\t\tnotificationEvent,\n\t\t\t});\n\t\t} else {\n\t\t\tconst alarmType = raw.payload[0];\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\talarmType,\n\t\t\t});\n\t\t}\n\t}\n\n\t/** Proprietary V1/V2 alarm type */\n\tpublic alarmType: number | undefined;\n\t/** Regulated V3+ notification type */\n\tpublic notificationType: number | undefined;\n\tpublic notificationEvent: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst notificationEvent = this.notificationEvent === 0xff\n\t\t\t? 0x00\n\t\t\t: this.notificationEvent;\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.alarmType ?? 0x00,\n\t\t\tthis.notificationType ?? 0xff,\n\t\t\tnotificationEvent ?? 0x00,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.alarmType != undefined) {\n\t\t\tmessage[\"V1 alarm type\"] = this.alarmType;\n\t\t}\n\t\tif (this.notificationType != undefined) {\n\t\t\tmessage[\"notification type\"] = getNotificationName(\n\t\t\t\tthis.notificationType,\n\t\t\t);\n\t\t\tif (this.notificationEvent != undefined) {\n\t\t\t\tmessage[\"notification event\"] = getNotificationEventName(\n\t\t\t\t\tthis.notificationType,\n\t\t\t\t\tthis.notificationEvent,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCSupportedReportOptions {\n\tsupportsV1Alarm: boolean;\n\tsupportedNotificationTypes: number[];\n}\n\n@CCCommand(NotificationCommand.SupportedReport)\n@ccValueProperty(\"supportsV1Alarm\", NotificationCCValues.supportsV1Alarm)\n@ccValueProperty(\n\t\"supportedNotificationTypes\",\n\tNotificationCCValues.supportedNotificationTypes,\n)\nexport class NotificationCCSupportedReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.supportsV1Alarm = options.supportsV1Alarm;\n\t\tthis.supportedNotificationTypes = options.supportedNotificationTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst supportsV1Alarm = !!(raw.payload[0] & 0b1000_0000);\n\t\tconst numBitMaskBytes = raw.payload[0] & 0b0001_1111;\n\t\tvalidatePayload(\n\t\t\tnumBitMaskBytes > 0,\n\t\t\traw.payload.length >= 1 + numBitMaskBytes,\n\t\t);\n\t\tconst notificationBitMask = raw.payload.subarray(\n\t\t\t1,\n\t\t\t1 + numBitMaskBytes,\n\t\t);\n\t\tconst supportedNotificationTypes = parseBitMask(\n\t\t\tnotificationBitMask,\n\t\t\t// bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n\t\t\t0,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportsV1Alarm,\n\t\t\tsupportedNotificationTypes,\n\t\t});\n\t}\n\n\tpublic supportsV1Alarm: boolean;\n\n\tpublic supportedNotificationTypes: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst bitMask = encodeBitMask(\n\t\t\tthis.supportedNotificationTypes,\n\t\t\tMath.max(...this.supportedNotificationTypes),\n\t\t\t0,\n\t\t);\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.supportsV1Alarm ? 0b1000_0000 : 0) | bitMask.length,\n\t\t\t]),\n\t\t\tbitMask,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supports V1 alarm\": this.supportsV1Alarm,\n\t\t\t\t\"supported notification types\": this.supportedNotificationTypes\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(t) => `\\n\u00B7 ${getNotificationName(t)}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(NotificationCommand.SupportedGet)\n@expectedCCResponse(NotificationCCSupportedReport)\nexport class NotificationCCSupportedGet extends NotificationCC {}\n\n// @publicAPI\nexport interface NotificationCCEventSupportedReportOptions {\n\tnotificationType: number;\n\tsupportedEvents: number[];\n}\n\n@CCCommand(NotificationCommand.EventSupportedReport)\nexport class NotificationCCEventSupportedReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCEventSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.notificationType = options.notificationType;\n\t\tthis.supportedEvents = options.supportedEvents;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCEventSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst notificationType = raw.payload[0];\n\t\tconst numBitMaskBytes = raw.payload[1] & 0b000_11111;\n\n\t\tif (numBitMaskBytes === 0) {\n\t\t\t// Notification type is not supported\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tnotificationType,\n\t\t\t\tsupportedEvents: [],\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 2 + numBitMaskBytes);\n\t\tconst eventBitMask = raw.payload.subarray(2, 2 + numBitMaskBytes);\n\t\tconst supportedEvents = parseBitMask(\n\t\t\teventBitMask,\n\t\t\t// In this mask, bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n\t\t\t0,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t\tsupportedEvents,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Store which events this notification supports\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t\tthis.notificationType,\n\t\t\t),\n\t\t\tthis.supportedEvents,\n\t\t);\n\n\t\t// For each event, predefine the value metadata\n\t\tconst notification = getNotification(this.notificationType);\n\n\t\tif (!notification) {\n\t\t\t// This is an unknown notification\n\t\t\tthis.setMetadata(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.unknownNotificationType(\n\t\t\t\t\tthis.notificationType,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// This is a standardized notification\n\t\t\tlet isFirst = true;\n\t\t\tfor (const value of this.supportedEvents) {\n\t\t\t\t// Find out which property we need to update\n\t\t\t\tconst valueConfig = getNotificationValue(notification, value);\n\t\t\t\tif (valueConfig?.type === \"state\") {\n\t\t\t\t\tconst notificationValue = NotificationCCValues\n\t\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\t\tvalueConfig.variableName,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// After we've created the metadata initially, extend it\n\t\t\t\t\tconst metadata = getNotificationValueMetadata(\n\t\t\t\t\t\tisFirst\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: this.getMetadata(ctx, notificationValue),\n\t\t\t\t\t\tnotification,\n\t\t\t\t\t\tvalueConfig,\n\t\t\t\t\t);\n\n\t\t\t\t\tthis.setMetadata(ctx, notificationValue, metadata);\n\n\t\t\t\t\tisFirst = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic notificationType: number;\n\tpublic supportedEvents: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.notificationType, 0]);\n\t\tif (this.supportedEvents.length > 0) {\n\t\t\tconst bitMask = encodeBitMask(\n\t\t\t\tthis.supportedEvents,\n\t\t\t\tMath.max(...this.supportedEvents),\n\t\t\t\t0,\n\t\t\t);\n\t\t\tthis.payload[1] = bitMask.length;\n\t\t\tthis.payload = Bytes.concat([this.payload, bitMask]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t\t\"supported events\": this.supportedEvents\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(e) =>\n\t\t\t\t\t\t\t`\\n\u00B7 ${\n\t\t\t\t\t\t\t\tgetNotificationValueName(\n\t\t\t\t\t\t\t\t\tthis.notificationType,\n\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCEventSupportedGetOptions {\n\tnotificationType: number;\n}\n\n@CCCommand(NotificationCommand.EventSupportedGet)\n@expectedCCResponse(NotificationCCEventSupportedReport)\nexport class NotificationCCEventSupportedGet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCEventSupportedGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.notificationType = options.notificationType;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCEventSupportedGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst notificationType = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t});\n\t}\n\n\tpublic notificationType: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.notificationType]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAuCO;AACP,oBAOO;AAEP,wBAAwB;AACxB,iBAMO;AACP,0BAQO;AACP,oCAUO;AACP,sCAA2C;AAC3C,oBAAkB;AAClB,mBAAqD;AACrD,cAA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