@zwave-js/cc 15.24.3 → 15.25.1

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.
Files changed (127) hide show
  1. package/build/cjs/cc/AssociationCC.d.ts +1 -1
  2. package/build/cjs/cc/AssociationCC.js +6 -3
  3. package/build/cjs/cc/AssociationCC.js.map +2 -2
  4. package/build/cjs/cc/AssociationGroupInfoCC.js +5 -1
  5. package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
  6. package/build/cjs/cc/ColorSwitchCC.js +5 -2
  7. package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
  8. package/build/cjs/cc/ConfigurationCC.d.ts +14 -3
  9. package/build/cjs/cc/ConfigurationCC.js +65 -19
  10. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  11. package/build/cjs/cc/IndicatorCC.js +7 -3
  12. package/build/cjs/cc/IndicatorCC.js.map +2 -2
  13. package/build/cjs/cc/IrrigationCC.js +6 -2
  14. package/build/cjs/cc/IrrigationCC.js.map +2 -2
  15. package/build/cjs/cc/MeterCC.js +6 -1
  16. package/build/cjs/cc/MeterCC.js.map +2 -2
  17. package/build/cjs/cc/MultiChannelAssociationCC.d.ts +1 -1
  18. package/build/cjs/cc/MultiChannelAssociationCC.js +6 -3
  19. package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
  20. package/build/cjs/cc/MultiChannelCC.d.ts +1 -1
  21. package/build/cjs/cc/MultiChannelCC.js +4 -2
  22. package/build/cjs/cc/MultiChannelCC.js.map +2 -2
  23. package/build/cjs/cc/MultilevelSensorCC.js +7 -3
  24. package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
  25. package/build/cjs/cc/NotificationCC.js +9 -2
  26. package/build/cjs/cc/NotificationCC.js.map +2 -2
  27. package/build/cjs/cc/SceneControllerConfigurationCC.js +1 -0
  28. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
  29. package/build/cjs/cc/SecurityCC.d.ts +2 -2
  30. package/build/cjs/cc/SecurityCC.js +6 -4
  31. package/build/cjs/cc/SecurityCC.js.map +2 -2
  32. package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +1 -1
  33. package/build/cjs/cc/ThermostatOperatingStateCC.js +2 -2
  34. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
  35. package/build/cjs/cc/ThermostatSetpointCC.js +8 -3
  36. package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
  37. package/build/cjs/cc/TransportServiceCC.d.ts +0 -14
  38. package/build/cjs/cc/TransportServiceCC.js +0 -41
  39. package/build/cjs/cc/TransportServiceCC.js.map +2 -2
  40. package/build/cjs/cc/UserCodeCC.js +5 -1
  41. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  42. package/build/cjs/cc/UserCredentialCC.d.ts +2 -2
  43. package/build/cjs/cc/UserCredentialCC.js +7 -3
  44. package/build/cjs/cc/UserCredentialCC.js.map +2 -2
  45. package/build/cjs/cc/VersionCC.js +7 -5
  46. package/build/cjs/cc/VersionCC.js.map +2 -2
  47. package/build/cjs/cc/WindowCoveringCC.js +6 -4
  48. package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
  49. package/build/cjs/lib/CommandClass.d.ts +15 -6
  50. package/build/cjs/lib/CommandClass.js +10 -5
  51. package/build/cjs/lib/CommandClass.js.map +2 -2
  52. package/build/cjs/lib/traits.d.ts +16 -1
  53. package/build/esm/cc/AssociationCC.d.ts +1 -1
  54. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  55. package/build/esm/cc/AssociationCC.js +6 -3
  56. package/build/esm/cc/AssociationCC.js.map +1 -1
  57. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  58. package/build/esm/cc/AssociationGroupInfoCC.js +7 -1
  59. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  60. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  61. package/build/esm/cc/ColorSwitchCC.js +5 -2
  62. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  63. package/build/esm/cc/ConfigurationCC.d.ts +14 -3
  64. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  65. package/build/esm/cc/ConfigurationCC.js +98 -25
  66. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  67. package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
  68. package/build/esm/cc/IndicatorCC.js +8 -3
  69. package/build/esm/cc/IndicatorCC.js.map +1 -1
  70. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  71. package/build/esm/cc/IrrigationCC.js +6 -2
  72. package/build/esm/cc/IrrigationCC.js.map +1 -1
  73. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  74. package/build/esm/cc/MeterCC.js +6 -1
  75. package/build/esm/cc/MeterCC.js.map +1 -1
  76. package/build/esm/cc/MultiChannelAssociationCC.d.ts +1 -1
  77. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  78. package/build/esm/cc/MultiChannelAssociationCC.js +6 -3
  79. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  80. package/build/esm/cc/MultiChannelCC.d.ts +1 -1
  81. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  82. package/build/esm/cc/MultiChannelCC.js +4 -2
  83. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  84. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  85. package/build/esm/cc/MultilevelSensorCC.js +7 -3
  86. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  87. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  88. package/build/esm/cc/NotificationCC.js +9 -2
  89. package/build/esm/cc/NotificationCC.js.map +1 -1
  90. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  91. package/build/esm/cc/SceneControllerConfigurationCC.js +1 -0
  92. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  93. package/build/esm/cc/SecurityCC.d.ts +2 -2
  94. package/build/esm/cc/SecurityCC.d.ts.map +1 -1
  95. package/build/esm/cc/SecurityCC.js +7 -4
  96. package/build/esm/cc/SecurityCC.js.map +1 -1
  97. package/build/esm/cc/ThermostatOperatingStateCC.d.ts +1 -1
  98. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  99. package/build/esm/cc/ThermostatOperatingStateCC.js +2 -2
  100. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  101. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  102. package/build/esm/cc/ThermostatSetpointCC.js +10 -3
  103. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  104. package/build/esm/cc/TransportServiceCC.d.ts +0 -14
  105. package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
  106. package/build/esm/cc/TransportServiceCC.js +1 -54
  107. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  108. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  109. package/build/esm/cc/UserCodeCC.js +4 -0
  110. package/build/esm/cc/UserCodeCC.js.map +1 -1
  111. package/build/esm/cc/UserCredentialCC.d.ts +2 -2
  112. package/build/esm/cc/UserCredentialCC.d.ts.map +1 -1
  113. package/build/esm/cc/UserCredentialCC.js +7 -4
  114. package/build/esm/cc/UserCredentialCC.js.map +1 -1
  115. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  116. package/build/esm/cc/VersionCC.js +12 -6
  117. package/build/esm/cc/VersionCC.js.map +1 -1
  118. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  119. package/build/esm/cc/WindowCoveringCC.js +7 -5
  120. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  121. package/build/esm/lib/CommandClass.d.ts +15 -6
  122. package/build/esm/lib/CommandClass.d.ts.map +1 -1
  123. package/build/esm/lib/CommandClass.js +10 -5
  124. package/build/esm/lib/CommandClass.js.map +1 -1
  125. package/build/esm/lib/traits.d.ts +16 -1
  126. package/build/esm/lib/traits.d.ts.map +1 -1
  127. package/package.json +4 -4
@@ -334,11 +334,9 @@ let VersionCC = (() => {
334
334
  message: "querying CC versions...",
335
335
  direction: "outbound"
336
336
  });
337
- {
338
- const cc = import_core.CommandClasses.Basic;
339
- if (this.endpointIndex === 0 || node.getCCVersion(cc) === 0) {
340
- await queryCCVersion(cc);
341
- }
337
+ const ccsToQuery = [];
338
+ if (this.endpointIndex === 0 || node.getCCVersion(import_core.CommandClasses.Basic) === 0) {
339
+ ccsToQuery.push(import_core.CommandClasses.Basic);
342
340
  }
343
341
  for (const [cc] of endpoint.getCCs()) {
344
342
  if (cc === import_core.CommandClasses.Version)
@@ -347,7 +345,11 @@ let VersionCC = (() => {
347
345
  continue;
348
346
  if (this.endpointIndex > 0 && node.getCCVersion(cc) > 0)
349
347
  continue;
348
+ ccsToQuery.push(cc);
349
+ }
350
+ for (const [i, cc] of ccsToQuery.entries()) {
350
351
  await queryCCVersion(cc);
352
+ node.reportInterviewProgress(i + 1, ccsToQuery.length);
351
353
  }
352
354
  if (this.endpointIndex === 0 && api.version >= 3) {
353
355
  ctx.logNode(node.id, {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/VersionCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./VersionCC._validateArgs.js\";\nconst { validateArgs_VersionCCAPI_sendReport, validateArgs_VersionCCAPI_getCCVersion, validateArgs_VersionCCAPI_reportCCVersion } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, SecurityClass, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, ZWaveLibraryTypes, enumValuesToMetadataStates, getCCName, securityClassIsS2, securityClassOrder, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, type BytesView, getEnumMemberName, num2hex, pick, } from \"@zwave-js/shared\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, getImplementedVersion, implementedVersion, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { VersionCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { VersionCCValues } from \"./_CCValues.generated.js\";\nexport { VersionCCValues };\nfunction parseVersion(buffer: BytesView): string {\n if (buffer[0] === 0 && buffer[1] === 0 && buffer[2] === 0)\n return \"unused\";\n return `${buffer[0]}.${buffer[1]}.${buffer[2]}`;\n}\n// @noSetValueAPI This CC is read-only\n@API(CommandClasses.Version)\nexport class VersionCCAPI extends PhysicalCCAPI {\n public supportsCommand(cmd: VersionCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case VersionCommand.Get:\n case VersionCommand.Report:\n case VersionCommand.CommandClassGet:\n case VersionCommand.CommandClassReport:\n return true; // This is mandatory\n case VersionCommand.CapabilitiesGet:\n case VersionCommand.CapabilitiesReport:\n case VersionCommand.ZWaveSoftwareReport:\n return this.version >= 3;\n case VersionCommand.ZWaveSoftwareGet: {\n return this.getValueDB().getValue<boolean>(VersionCCValues.supportsZWaveSoftwareGet.endpoint(this.endpoint.index));\n }\n }\n return super.supportsCommand(cmd);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(VersionCommand, VersionCommand.Get);\n const cc = new VersionCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<VersionCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"libraryType\",\n \"protocolVersion\",\n \"firmwareVersions\",\n \"hardwareVersion\",\n ]);\n }\n }\n @validateArgs_VersionCCAPI_sendReport()\n public async sendReport(options: VersionCCReportOptions): Promise<void> {\n this.assertSupportsCommand(VersionCommand, VersionCommand.Report);\n const cc = new VersionCCReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...options,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_VersionCCAPI_getCCVersion()\n public async getCCVersion(requestedCC: CommandClasses): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(VersionCommand, VersionCommand.CommandClassGet);\n const cc = new VersionCCCommandClassGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n requestedCC,\n });\n const response = await this.host.sendCommand<VersionCCCommandClassReport>(cc, this.commandOptions);\n return response?.ccVersion;\n }\n @validateArgs_VersionCCAPI_reportCCVersion()\n /**\n * @param version The version to report. If not given, the implemented version will be used for the report.\n */\n public async reportCCVersion(requestedCC: CommandClasses, version?: number): Promise<void> {\n this.assertSupportsCommand(VersionCommand, VersionCommand.CommandClassReport);\n let ccVersion: number;\n switch (requestedCC) {\n case CommandClasses[\"Z-Wave Protocol\"]:\n case CommandClasses[\"Z-Wave Long Range\"]:\n // These two are only for internal use\n ccVersion = 0;\n break;\n case CommandClasses.Hail:\n case CommandClasses[\"Manufacturer Proprietary\"]:\n // These CCs are obsolete, we cannot enter them in the certification portal\n // but not doing so fails a certification test. Just respond that they\n // are not supported or controlled\n ccVersion = 0;\n break;\n default:\n ccVersion = version ?? getImplementedVersion(requestedCC);\n break;\n }\n const cc = new VersionCCCommandClassReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n requestedCC,\n ccVersion,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getCapabilities() {\n this.assertSupportsCommand(VersionCommand, VersionCommand.CapabilitiesGet);\n const cc = new VersionCCCapabilitiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<VersionCCCapabilitiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"supportsZWaveSoftwareGet\"]);\n }\n }\n public async reportCapabilities(): Promise<void> {\n this.assertSupportsCommand(VersionCommand, VersionCommand.CapabilitiesReport);\n const cc = new VersionCCCapabilitiesReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n // At this time, we do not support responding to Z-Wave Software Get\n supportsZWaveSoftwareGet: false,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getZWaveSoftware() {\n this.assertSupportsCommand(VersionCommand, VersionCommand.ZWaveSoftwareGet);\n const cc = new VersionCCZWaveSoftwareGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<VersionCCZWaveSoftwareReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"sdkVersion\",\n \"applicationFrameworkAPIVersion\",\n \"applicationFrameworkBuildNumber\",\n \"hostInterfaceVersion\",\n \"hostInterfaceBuildNumber\",\n \"zWaveProtocolVersion\",\n \"zWaveProtocolBuildNumber\",\n \"applicationVersion\",\n \"applicationBuildNumber\",\n ]);\n }\n }\n}\n@commandClass(CommandClasses.Version)\n@implementedVersion(3)\n@ccValues(VersionCCValues)\nexport class VersionCC extends CommandClass {\n declare ccCommand: VersionCommand;\n public determineRequiredCCInterviews(): readonly CommandClasses[] {\n // VersionCC must be the 2nd CC after ManufacturerSpecificCC\n return [CommandClasses[\"Manufacturer Specific\"]];\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n // SDS13782: In a Multi Channel device, the Version Command Class MUST be supported by the Root Device, while\n // the Version Command Class SHOULD NOT be supported by individual End Points.\n //\n // There may be cases where a given Command Class is not implemented by the Root Device of a Multi\n // Channel device. However, the Root Device MUST respond to Version requests for any Command Class\n // implemented by the Multi Channel device; also in cases where the actual Command Class is only\n // provided by an End Point.\n const endpoint = this.getEndpoint(ctx)!;\n // Use the CC API of the root device for all queries\n const api = CCAPI.create(CommandClasses.Version, ctx, node).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n const queryCCVersion = async (cc: CommandClasses): Promise<void> => {\n // Only query CCs we support. Theoretically we could skip queries where we support only V1,\n // but there are Z-Wave certification tests that require us to query all CCs\n const maxImplemented = getImplementedVersion(cc);\n if (maxImplemented === 0) {\n ctx.logNode(node.id, ` skipping query for ${CommandClasses[cc]} (${num2hex(cc)}) because max implemented version is ${maxImplemented}`);\n return;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: ` querying the CC version for ${getCCName(cc)}...`,\n direction: \"outbound\",\n });\n // query the CC version\n const supportedVersion = await api.getCCVersion(cc);\n if (supportedVersion != undefined) {\n // Remember which CC version this endpoint supports\n let logMessage: string;\n if (supportedVersion > 0) {\n // Basic CC has special rules for when it is considered supported\n // Therefore we mark all other CCs as supported, but not Basic CC,\n // for which support is determined later.\n if (cc === CommandClasses.Basic) {\n endpoint.addCC(cc, { version: supportedVersion });\n }\n else if (endpoint.controlsCC(cc) && !endpoint.supportsCC(cc)) {\n // The node only advertised this CC as controlled (e.g. in the NIF).\n // Remember the version so its values can be exposed, but do not\n // promote it to a supported CC.\n endpoint.addCC(cc, {\n isControlled: true,\n version: supportedVersion,\n });\n }\n else {\n endpoint.addCC(cc, {\n isSupported: true,\n version: supportedVersion,\n });\n }\n logMessage = ` supports CC ${CommandClasses[cc]} (${num2hex(cc)}) in version ${supportedVersion}`;\n }\n else {\n // We were lied to - the NIF said this CC is supported, now the node claims it isn't\n // Make sure this is not a critical CC, which must be supported though\n if (cc === CommandClasses.Version\n || cc === CommandClasses[\"Manufacturer Specific\"]) {\n logMessage = ` claims NOT to support CC ${CommandClasses[cc]} (${num2hex(cc)}), but it must. Assuming the ${this.endpointIndex === 0 ? \"node\" : \"endpoint\"} supports version 1...`;\n endpoint.addCC(cc, { version: 1 });\n }\n else if ((cc === CommandClasses.Security\n && node.hasSecurityClass(SecurityClass.S0_Legacy))\n || (cc === CommandClasses[\"Security 2\"]\n && securityClassOrder.some((sc) => securityClassIsS2(sc)\n && node.hasSecurityClass(sc)))) {\n logMessage = ` claims NOT to support CC ${CommandClasses[cc]} (${num2hex(cc)}), but it is known to support it. Assuming the ${this.endpointIndex === 0 ? \"node\" : \"endpoint\"} supports version 1...`;\n endpoint.addCC(cc, { version: 1 });\n }\n else {\n logMessage = ` does NOT support CC ${CommandClasses[cc]} (${num2hex(cc)})`;\n endpoint.removeCC(cc);\n }\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `CC version query for ${getCCName(cc)} timed out - assuming the ${this.endpointIndex === 0 ? \"node\" : \"endpoint\"} supports version 1...`,\n level: \"warn\",\n });\n endpoint.addCC(cc, { version: 1 });\n }\n };\n // Version information should not change (except for firmware updates)\n // And it is only relevant on the root endpoint (the node)\n if (this.endpointIndex === 0) {\n // Step 1: Query Version CC version\n await queryCCVersion(CommandClasses.Version);\n // Step 2: Query node versions\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying node versions...\",\n direction: \"outbound\",\n });\n const versionGetResponse = await api.get();\n if (versionGetResponse) {\n let logMessage = `received response for node versions:\n library type: ${ZWaveLibraryTypes[versionGetResponse.libraryType]} (${num2hex(versionGetResponse.libraryType)})\n protocol version: ${versionGetResponse.protocolVersion}\n firmware versions: ${versionGetResponse.firmwareVersions.join(\", \")}`;\n if (versionGetResponse.hardwareVersion != undefined) {\n logMessage +=\n `\\n hardware version: ${versionGetResponse.hardwareVersion}`;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n // Step 3: Query all other CC versions\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying CC versions...\",\n direction: \"outbound\",\n });\n // Basic CC is not included in the NIF, so it won't be returned by endpoint.getCCs() at this point\n {\n const cc = CommandClasses.Basic;\n // Skip the query of endpoint CCs that are also supported by the root device\n if (this.endpointIndex === 0 || node.getCCVersion(cc) === 0) {\n await queryCCVersion(cc);\n }\n }\n for (const [cc] of endpoint.getCCs()) {\n // We already queried the Version CC version at the start of this interview\n if (cc === CommandClasses.Version)\n continue;\n // And we queried Basic CC just before this\n if (cc === CommandClasses.Basic)\n continue;\n // Skip the query of endpoint CCs that are also supported by the root device\n if (this.endpointIndex > 0 && node.getCCVersion(cc) > 0)\n continue;\n await queryCCVersion(cc);\n }\n // Step 4: Query VersionCC capabilities (root device only)\n if (this.endpointIndex === 0 && api.version >= 3) {\n // Step 4a: Support for SoftwareGet\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying if Z-Wave Software Get is supported...\",\n direction: \"outbound\",\n });\n const capsResponse = await api.getCapabilities();\n if (capsResponse) {\n const { supportsZWaveSoftwareGet } = capsResponse;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Z-Wave Software Get is${supportsZWaveSoftwareGet ? \"\" : \" not\"} supported`,\n direction: \"inbound\",\n });\n if (supportsZWaveSoftwareGet) {\n // Step 4b: Query Z-Wave Software versions\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying Z-Wave software versions...\",\n direction: \"outbound\",\n });\n await api.getZWaveSoftware();\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"received Z-Wave software versions\",\n direction: \"inbound\",\n });\n }\n }\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n}\n// @publicAPI\nexport interface VersionCCReportOptions {\n libraryType: ZWaveLibraryTypes;\n protocolVersion: string;\n firmwareVersions: string[];\n hardwareVersion?: number;\n}\n@CCCommand(VersionCommand.Report)\n@ccValueProperty(\"libraryType\", VersionCCValues.libraryType)\n@ccValueProperty(\"protocolVersion\", VersionCCValues.protocolVersion)\n@ccValueProperty(\"firmwareVersions\", VersionCCValues.firmwareVersions)\n@ccValueProperty(\"hardwareVersion\", VersionCCValues.hardwareVersion)\nexport class VersionCCReport extends VersionCC {\n public constructor(options: WithAddress<VersionCCReportOptions>) {\n super(options);\n if (!/^\\d+\\.\\d+(\\.\\d+)?$/.test(options.protocolVersion)) {\n throw new ZWaveError(`protocolVersion must be a string in the format \"major.minor\" or \"major.minor.patch\", received \"${options.protocolVersion}\"`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (!options.firmwareVersions.every((fw) => /^\\d+\\.\\d+(\\.\\d+)?$/.test(fw))) {\n throw new ZWaveError(`firmwareVersions must be an array of strings in the format \"major.minor\" or \"major.minor.patch\", received \"${JSON.stringify(options.firmwareVersions)}\"`, ZWaveErrorCodes.Argument_Invalid);\n }\n this.libraryType = options.libraryType;\n this.protocolVersion = options.protocolVersion;\n this.firmwareVersions = options.firmwareVersions;\n this.hardwareVersion = options.hardwareVersion;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCReport {\n validatePayload(raw.payload.length >= 5);\n const libraryType: ZWaveLibraryTypes = raw.payload[0];\n const protocolVersion = `${raw.payload[1]}.${raw.payload[2]}`;\n const firmwareVersions = [`${raw.payload[3]}.${raw.payload[4]}`];\n let hardwareVersion: number | undefined;\n if (raw.payload.length >= 7) {\n // V2+\n hardwareVersion = raw.payload[5];\n const additionalFirmwares = raw.payload[6];\n validatePayload(raw.payload.length >= 7 + 2 * additionalFirmwares);\n for (let i = 0; i < additionalFirmwares; i++) {\n firmwareVersions.push(`${raw.payload[7 + 2 * i]}.${raw.payload[7 + 2 * i + 1]}`);\n }\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n libraryType,\n protocolVersion,\n firmwareVersions,\n hardwareVersion,\n });\n }\n public readonly libraryType: ZWaveLibraryTypes;\n public readonly protocolVersion: string;\n public readonly firmwareVersions: string[];\n public readonly hardwareVersion: number | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.libraryType,\n ...this.protocolVersion\n .split(\".\")\n .map((n) => parseInt(n))\n .slice(0, 2),\n ...this.firmwareVersions[0]\n .split(\".\")\n .map((n) => parseInt(n))\n .slice(0, 2),\n this.hardwareVersion ?? 0x00,\n this.firmwareVersions.length - 1,\n ]);\n if (this.firmwareVersions.length > 1) {\n const firmwaresBuffer = new Bytes((this.firmwareVersions.length - 1) * 2);\n for (let i = 1; i < this.firmwareVersions.length; i++) {\n const [major, minor] = this.firmwareVersions[i]\n .split(\".\")\n .map((n) => parseInt(n));\n firmwaresBuffer[2 * (i - 1)] = major;\n firmwaresBuffer[2 * (i - 1) + 1] = minor;\n }\n this.payload = Bytes.concat([this.payload, firmwaresBuffer]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"library type\": getEnumMemberName(ZWaveLibraryTypes, this.libraryType),\n \"protocol version\": this.protocolVersion,\n \"firmware versions\": this.firmwareVersions.join(\", \"),\n };\n if (this.hardwareVersion != undefined) {\n message[\"hardware version\"] = this.hardwareVersion;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(VersionCommand.Get)\n@expectedCCResponse(VersionCCReport)\nexport class VersionCCGet extends VersionCC {\n}\n// @publicAPI\nexport interface VersionCCCommandClassReportOptions {\n requestedCC: CommandClasses;\n ccVersion: number;\n}\n@CCCommand(VersionCommand.CommandClassReport)\nexport class VersionCCCommandClassReport extends VersionCC {\n public constructor(options: WithAddress<VersionCCCommandClassReportOptions>) {\n super(options);\n this.requestedCC = options.requestedCC;\n this.ccVersion = options.ccVersion;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCCommandClassReport {\n validatePayload(raw.payload.length >= 2);\n const requestedCC: CommandClasses = raw.payload[0];\n const ccVersion = raw.payload[1];\n return new this({\n nodeId: ctx.sourceNodeId,\n requestedCC,\n ccVersion,\n });\n }\n public ccVersion: number;\n public requestedCC: CommandClasses;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.requestedCC, this.ccVersion]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n CC: getCCName(this.requestedCC),\n version: this.ccVersion,\n },\n };\n }\n}\n// @publicAPI\nexport interface VersionCCCommandClassGetOptions {\n requestedCC: CommandClasses;\n}\nfunction testResponseForVersionCommandClassGet(sent: VersionCCCommandClassGet, received: VersionCCCommandClassReport) {\n // We expect a Version CommandClass Report that matches the requested CC\n return sent.requestedCC === received.requestedCC;\n}\n@CCCommand(VersionCommand.CommandClassGet)\n@expectedCCResponse(VersionCCCommandClassReport, testResponseForVersionCommandClassGet)\nexport class VersionCCCommandClassGet extends VersionCC {\n public constructor(options: WithAddress<VersionCCCommandClassGetOptions>) {\n super(options);\n this.requestedCC = options.requestedCC;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCCommandClassGet {\n validatePayload(raw.payload.length >= 1);\n const requestedCC: CommandClasses = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n requestedCC,\n });\n }\n public requestedCC: CommandClasses;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.requestedCC]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { CC: getCCName(this.requestedCC) },\n };\n }\n}\n// @publicAPI\nexport interface VersionCCCapabilitiesReportOptions {\n supportsZWaveSoftwareGet: boolean;\n}\n@CCCommand(VersionCommand.CapabilitiesReport)\n@ccValueProperty(\"supportsZWaveSoftwareGet\", VersionCCValues.supportsZWaveSoftwareGet)\nexport class VersionCCCapabilitiesReport extends VersionCC {\n public constructor(options: WithAddress<VersionCCCapabilitiesReportOptions>) {\n super(options);\n this.supportsZWaveSoftwareGet = options.supportsZWaveSoftwareGet;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCCapabilitiesReport {\n validatePayload(raw.payload.length >= 1);\n const capabilities = raw.payload[0];\n const supportsZWaveSoftwareGet = !!(capabilities & 0b100);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsZWaveSoftwareGet,\n });\n }\n public supportsZWaveSoftwareGet: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n (this.supportsZWaveSoftwareGet ? 0b100 : 0) | 0b11,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports Z-Wave Software Get command\": this.supportsZWaveSoftwareGet,\n },\n };\n }\n}\n@CCCommand(VersionCommand.CapabilitiesGet)\n@expectedCCResponse(VersionCCCapabilitiesReport)\nexport class VersionCCCapabilitiesGet extends VersionCC {\n}\n// @publicAPI\nexport interface VersionCCZWaveSoftwareReportOptions {\n sdkVersion: string;\n applicationFrameworkAPIVersion: string;\n applicationFrameworkBuildNumber: number;\n hostInterfaceVersion: string;\n hostInterfaceBuildNumber: number;\n zWaveProtocolVersion: string;\n zWaveProtocolBuildNumber: number;\n applicationVersion: string;\n applicationBuildNumber: number;\n}\n@CCCommand(VersionCommand.ZWaveSoftwareReport)\n@ccValueProperty(\"sdkVersion\", VersionCCValues.sdkVersion)\n@ccValueProperty(\"applicationFrameworkAPIVersion\", VersionCCValues.applicationFrameworkAPIVersion)\n@ccValueProperty(\"applicationFrameworkBuildNumber\", VersionCCValues.applicationFrameworkBuildNumber)\n@ccValueProperty(\"hostInterfaceVersion\", VersionCCValues.serialAPIVersion)\n@ccValueProperty(\"hostInterfaceBuildNumber\", VersionCCValues.serialAPIBuildNumber)\n@ccValueProperty(\"zWaveProtocolVersion\", VersionCCValues.zWaveProtocolVersion)\n@ccValueProperty(\"zWaveProtocolBuildNumber\", VersionCCValues.zWaveProtocolBuildNumber)\n@ccValueProperty(\"applicationVersion\", VersionCCValues.applicationVersion)\n@ccValueProperty(\"applicationBuildNumber\", VersionCCValues.applicationBuildNumber)\nexport class VersionCCZWaveSoftwareReport extends VersionCC {\n public constructor(options: WithAddress<VersionCCZWaveSoftwareReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.sdkVersion = options.sdkVersion;\n this.applicationFrameworkAPIVersion =\n options.applicationFrameworkAPIVersion;\n this.applicationFrameworkBuildNumber =\n options.applicationFrameworkBuildNumber;\n this.hostInterfaceVersion = options.hostInterfaceVersion;\n this.hostInterfaceBuildNumber = options.hostInterfaceBuildNumber;\n this.zWaveProtocolVersion = options.zWaveProtocolVersion;\n this.zWaveProtocolBuildNumber = options.zWaveProtocolBuildNumber;\n this.applicationVersion = options.applicationVersion;\n this.applicationBuildNumber = options.applicationBuildNumber;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCZWaveSoftwareReport {\n validatePayload(raw.payload.length >= 23);\n const sdkVersion = parseVersion(raw.payload);\n const applicationFrameworkAPIVersion = parseVersion(raw.payload.subarray(3));\n let applicationFrameworkBuildNumber;\n if (applicationFrameworkAPIVersion !== \"unused\") {\n applicationFrameworkBuildNumber = raw.payload.readUInt16BE(6);\n }\n else {\n applicationFrameworkBuildNumber = 0;\n }\n const hostInterfaceVersion = parseVersion(raw.payload.subarray(8));\n let hostInterfaceBuildNumber;\n if (hostInterfaceVersion !== \"unused\") {\n hostInterfaceBuildNumber = raw.payload.readUInt16BE(11);\n }\n else {\n hostInterfaceBuildNumber = 0;\n }\n const zWaveProtocolVersion = parseVersion(raw.payload.subarray(13));\n let zWaveProtocolBuildNumber;\n if (zWaveProtocolVersion !== \"unused\") {\n zWaveProtocolBuildNumber = raw.payload.readUInt16BE(16);\n }\n else {\n zWaveProtocolBuildNumber = 0;\n }\n const applicationVersion = parseVersion(raw.payload.subarray(18));\n let applicationBuildNumber;\n if (applicationVersion !== \"unused\") {\n applicationBuildNumber = raw.payload.readUInt16BE(21);\n }\n else {\n applicationBuildNumber = 0;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n sdkVersion,\n applicationFrameworkAPIVersion,\n applicationFrameworkBuildNumber,\n hostInterfaceVersion,\n hostInterfaceBuildNumber,\n zWaveProtocolVersion,\n zWaveProtocolBuildNumber,\n applicationVersion,\n applicationBuildNumber,\n });\n }\n public readonly sdkVersion: string;\n public readonly applicationFrameworkAPIVersion: string;\n public readonly applicationFrameworkBuildNumber: number;\n public readonly hostInterfaceVersion: string;\n public readonly hostInterfaceBuildNumber: number;\n public readonly zWaveProtocolVersion: string;\n public readonly zWaveProtocolBuildNumber: number;\n public readonly applicationVersion: string;\n public readonly applicationBuildNumber: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"SDK version\": this.sdkVersion,\n };\n message[\"appl. framework API version\"] =\n this.applicationFrameworkAPIVersion;\n if (this.applicationFrameworkAPIVersion !== \"unused\") {\n message[\"appl. framework build number\"] =\n this.applicationFrameworkBuildNumber;\n }\n message[\"host interface version\"] = this.hostInterfaceVersion;\n if (this.hostInterfaceVersion !== \"unused\") {\n message[\"host interface build number\"] =\n this.hostInterfaceBuildNumber;\n }\n message[\"Z-Wave protocol version\"] = this.zWaveProtocolVersion;\n if (this.zWaveProtocolVersion !== \"unused\") {\n message[\"Z-Wave protocol build number\"] =\n this.zWaveProtocolBuildNumber;\n }\n message[\"application version\"] = this.applicationVersion;\n if (this.applicationVersion !== \"unused\") {\n message[\"application build number\"] = this.applicationBuildNumber;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(VersionCommand.ZWaveSoftwareGet)\n@expectedCCResponse(VersionCCZWaveSoftwareReport)\nexport class VersionCCZWaveSoftwareGet extends VersionCC {\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAmU;AACnU,oBAAyE;AACzE,iBAAqC;AACrC,0BAAiE;AACjE,oCAAwI;AAExI,mBAA+B;AAE/B,gCAAgC;AAThC,MAAM,EAAE,sCAAsC,wCAA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uBAAuB,UAAU;AACjC,iCAAyB,IAAI,QAAQ,aAAa,EAAE;MACxD,OACK;AACD,iCAAyB;MAC7B;AACA,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;OACH;IACL;IACgB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACT,WAAW,KAAgB;AAC9B,YAAM,UAAyB;QAC3B,eAAe,KAAK;;AAExB,cAAQ,6BAA6B,IACjC,KAAK;AACT,UAAI,KAAK,mCAAmC,UAAU;AAClD,gBAAQ,8BAA8B,IAClC,KAAK;MACb;AACA,cAAQ,wBAAwB,IAAI,KAAK;AACzC,UAAI,KAAK,yBAAyB,UAAU;AACxC,gBAAQ,8BAA8B,IAClC,KAAK;MACb;AACA,cAAQ,yBAAyB,IAAI,KAAK;AAC1C,UAAI,KAAK,yBAAyB,UAAU;AACxC,gBAAQ,8BAA8B,IAClC,KAAK;MACb;AACA,cAAQ,qBAAqB,IAAI,KAAK;AACtC,UAAI,KAAK,uBAAuB,UAAU;AACtC,gBAAQ,0BAA0B,IAAI,KAAK;MAC/C;AACA,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB;;IAER;;;;IAIS,6BAAyB,MAAA;8BAFrC,yCAAU,4BAAe,gBAAgB,OACzC,kDAAmB,4BAA4B,CAAC;;;;oBACF;iDAAA,YAAS;WAAA;;;;;;;;AAAxD,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./VersionCC._validateArgs.js\";\nconst { validateArgs_VersionCCAPI_sendReport, validateArgs_VersionCCAPI_getCCVersion, validateArgs_VersionCCAPI_reportCCVersion } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, SecurityClass, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, ZWaveLibraryTypes, enumValuesToMetadataStates, getCCName, securityClassIsS2, securityClassOrder, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, type BytesView, getEnumMemberName, num2hex, pick, } from \"@zwave-js/shared\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, getImplementedVersion, implementedVersion, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { VersionCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { VersionCCValues } from \"./_CCValues.generated.js\";\nexport { VersionCCValues };\nfunction parseVersion(buffer: BytesView): string {\n if (buffer[0] === 0 && buffer[1] === 0 && buffer[2] === 0)\n return \"unused\";\n return `${buffer[0]}.${buffer[1]}.${buffer[2]}`;\n}\n// @noSetValueAPI This CC is read-only\n@API(CommandClasses.Version)\nexport class VersionCCAPI extends PhysicalCCAPI {\n public supportsCommand(cmd: VersionCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case VersionCommand.Get:\n case VersionCommand.Report:\n case VersionCommand.CommandClassGet:\n case VersionCommand.CommandClassReport:\n return true; // This is mandatory\n case VersionCommand.CapabilitiesGet:\n case VersionCommand.CapabilitiesReport:\n case VersionCommand.ZWaveSoftwareReport:\n return this.version >= 3;\n case VersionCommand.ZWaveSoftwareGet: {\n return this.getValueDB().getValue<boolean>(VersionCCValues.supportsZWaveSoftwareGet.endpoint(this.endpoint.index));\n }\n }\n return super.supportsCommand(cmd);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(VersionCommand, VersionCommand.Get);\n const cc = new VersionCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<VersionCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"libraryType\",\n \"protocolVersion\",\n \"firmwareVersions\",\n \"hardwareVersion\",\n ]);\n }\n }\n @validateArgs_VersionCCAPI_sendReport()\n public async sendReport(options: VersionCCReportOptions): Promise<void> {\n this.assertSupportsCommand(VersionCommand, VersionCommand.Report);\n const cc = new VersionCCReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...options,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_VersionCCAPI_getCCVersion()\n public async getCCVersion(requestedCC: CommandClasses): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(VersionCommand, VersionCommand.CommandClassGet);\n const cc = new VersionCCCommandClassGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n requestedCC,\n });\n const response = await this.host.sendCommand<VersionCCCommandClassReport>(cc, this.commandOptions);\n return response?.ccVersion;\n }\n @validateArgs_VersionCCAPI_reportCCVersion()\n /**\n * @param version The version to report. If not given, the implemented version will be used for the report.\n */\n public async reportCCVersion(requestedCC: CommandClasses, version?: number): Promise<void> {\n this.assertSupportsCommand(VersionCommand, VersionCommand.CommandClassReport);\n let ccVersion: number;\n switch (requestedCC) {\n case CommandClasses[\"Z-Wave Protocol\"]:\n case CommandClasses[\"Z-Wave Long Range\"]:\n // These two are only for internal use\n ccVersion = 0;\n break;\n case CommandClasses.Hail:\n case CommandClasses[\"Manufacturer Proprietary\"]:\n // These CCs are obsolete, we cannot enter them in the certification portal\n // but not doing so fails a certification test. Just respond that they\n // are not supported or controlled\n ccVersion = 0;\n break;\n default:\n ccVersion = version ?? getImplementedVersion(requestedCC);\n break;\n }\n const cc = new VersionCCCommandClassReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n requestedCC,\n ccVersion,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getCapabilities() {\n this.assertSupportsCommand(VersionCommand, VersionCommand.CapabilitiesGet);\n const cc = new VersionCCCapabilitiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<VersionCCCapabilitiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"supportsZWaveSoftwareGet\"]);\n }\n }\n public async reportCapabilities(): Promise<void> {\n this.assertSupportsCommand(VersionCommand, VersionCommand.CapabilitiesReport);\n const cc = new VersionCCCapabilitiesReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n // At this time, we do not support responding to Z-Wave Software Get\n supportsZWaveSoftwareGet: false,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getZWaveSoftware() {\n this.assertSupportsCommand(VersionCommand, VersionCommand.ZWaveSoftwareGet);\n const cc = new VersionCCZWaveSoftwareGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<VersionCCZWaveSoftwareReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"sdkVersion\",\n \"applicationFrameworkAPIVersion\",\n \"applicationFrameworkBuildNumber\",\n \"hostInterfaceVersion\",\n \"hostInterfaceBuildNumber\",\n \"zWaveProtocolVersion\",\n \"zWaveProtocolBuildNumber\",\n \"applicationVersion\",\n \"applicationBuildNumber\",\n ]);\n }\n }\n}\n@commandClass(CommandClasses.Version)\n@implementedVersion(3)\n@ccValues(VersionCCValues)\nexport class VersionCC extends CommandClass {\n declare ccCommand: VersionCommand;\n public determineRequiredCCInterviews(): readonly CommandClasses[] {\n // VersionCC must be the 2nd CC after ManufacturerSpecificCC\n return [CommandClasses[\"Manufacturer Specific\"]];\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n // SDS13782: In a Multi Channel device, the Version Command Class MUST be supported by the Root Device, while\n // the Version Command Class SHOULD NOT be supported by individual End Points.\n //\n // There may be cases where a given Command Class is not implemented by the Root Device of a Multi\n // Channel device. However, the Root Device MUST respond to Version requests for any Command Class\n // implemented by the Multi Channel device; also in cases where the actual Command Class is only\n // provided by an End Point.\n const endpoint = this.getEndpoint(ctx)!;\n // Use the CC API of the root device for all queries\n const api = CCAPI.create(CommandClasses.Version, ctx, node).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n const queryCCVersion = async (cc: CommandClasses): Promise<void> => {\n // Only query CCs we support. Theoretically we could skip queries where we support only V1,\n // but there are Z-Wave certification tests that require us to query all CCs\n const maxImplemented = getImplementedVersion(cc);\n if (maxImplemented === 0) {\n ctx.logNode(node.id, ` skipping query for ${CommandClasses[cc]} (${num2hex(cc)}) because max implemented version is ${maxImplemented}`);\n return;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: ` querying the CC version for ${getCCName(cc)}...`,\n direction: \"outbound\",\n });\n // query the CC version\n const supportedVersion = await api.getCCVersion(cc);\n if (supportedVersion != undefined) {\n // Remember which CC version this endpoint supports\n let logMessage: string;\n if (supportedVersion > 0) {\n // Basic CC has special rules for when it is considered supported\n // Therefore we mark all other CCs as supported, but not Basic CC,\n // for which support is determined later.\n if (cc === CommandClasses.Basic) {\n endpoint.addCC(cc, { version: supportedVersion });\n }\n else if (endpoint.controlsCC(cc) && !endpoint.supportsCC(cc)) {\n // The node only advertised this CC as controlled (e.g. in the NIF).\n // Remember the version so its values can be exposed, but do not\n // promote it to a supported CC.\n endpoint.addCC(cc, {\n isControlled: true,\n version: supportedVersion,\n });\n }\n else {\n endpoint.addCC(cc, {\n isSupported: true,\n version: supportedVersion,\n });\n }\n logMessage = ` supports CC ${CommandClasses[cc]} (${num2hex(cc)}) in version ${supportedVersion}`;\n }\n else {\n // We were lied to - the NIF said this CC is supported, now the node claims it isn't\n // Make sure this is not a critical CC, which must be supported though\n if (cc === CommandClasses.Version\n || cc === CommandClasses[\"Manufacturer Specific\"]) {\n logMessage = ` claims NOT to support CC ${CommandClasses[cc]} (${num2hex(cc)}), but it must. Assuming the ${this.endpointIndex === 0 ? \"node\" : \"endpoint\"} supports version 1...`;\n endpoint.addCC(cc, { version: 1 });\n }\n else if ((cc === CommandClasses.Security\n && node.hasSecurityClass(SecurityClass.S0_Legacy))\n || (cc === CommandClasses[\"Security 2\"]\n && securityClassOrder.some((sc) => securityClassIsS2(sc)\n && node.hasSecurityClass(sc)))) {\n logMessage = ` claims NOT to support CC ${CommandClasses[cc]} (${num2hex(cc)}), but it is known to support it. Assuming the ${this.endpointIndex === 0 ? \"node\" : \"endpoint\"} supports version 1...`;\n endpoint.addCC(cc, { version: 1 });\n }\n else {\n logMessage = ` does NOT support CC ${CommandClasses[cc]} (${num2hex(cc)})`;\n endpoint.removeCC(cc);\n }\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `CC version query for ${getCCName(cc)} timed out - assuming the ${this.endpointIndex === 0 ? \"node\" : \"endpoint\"} supports version 1...`,\n level: \"warn\",\n });\n endpoint.addCC(cc, { version: 1 });\n }\n };\n // Version information should not change (except for firmware updates)\n // And it is only relevant on the root endpoint (the node)\n if (this.endpointIndex === 0) {\n // Step 1: Query Version CC version\n await queryCCVersion(CommandClasses.Version);\n // Step 2: Query node versions\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying node versions...\",\n direction: \"outbound\",\n });\n const versionGetResponse = await api.get();\n if (versionGetResponse) {\n let logMessage = `received response for node versions:\n library type: ${ZWaveLibraryTypes[versionGetResponse.libraryType]} (${num2hex(versionGetResponse.libraryType)})\n protocol version: ${versionGetResponse.protocolVersion}\n firmware versions: ${versionGetResponse.firmwareVersions.join(\", \")}`;\n if (versionGetResponse.hardwareVersion != undefined) {\n logMessage +=\n `\\n hardware version: ${versionGetResponse.hardwareVersion}`;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n // Step 3: Query all other CC versions\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying CC versions...\",\n direction: \"outbound\",\n });\n // Determine the CCs whose version we still need to query, so we can report progress\n const ccsToQuery: CommandClasses[] = [];\n // Basic CC is not included in the NIF, so it won't be returned by endpoint.getCCs() at this point\n // Add it to the list if we are interviewing the root endpoint,\n // or if we are on an endpoint and the root endpoint does not support it\n if (this.endpointIndex === 0\n || node.getCCVersion(CommandClasses.Basic) === 0) {\n ccsToQuery.push(CommandClasses.Basic);\n }\n for (const [cc] of endpoint.getCCs()) {\n // We already queried the Version CC version at the start of this interview\n if (cc === CommandClasses.Version)\n continue;\n // And we queried Basic CC just before this\n if (cc === CommandClasses.Basic)\n continue;\n // Skip the query of endpoint CCs that are also supported by the root device\n if (this.endpointIndex > 0 && node.getCCVersion(cc) > 0)\n continue;\n ccsToQuery.push(cc);\n }\n // Actually query them\n for (const [i, cc] of ccsToQuery.entries()) {\n await queryCCVersion(cc);\n node.reportInterviewProgress(i + 1, ccsToQuery.length);\n }\n // Step 4: Query VersionCC capabilities (root device only)\n if (this.endpointIndex === 0 && api.version >= 3) {\n // Step 4a: Support for SoftwareGet\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying if Z-Wave Software Get is supported...\",\n direction: \"outbound\",\n });\n const capsResponse = await api.getCapabilities();\n if (capsResponse) {\n const { supportsZWaveSoftwareGet } = capsResponse;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Z-Wave Software Get is${supportsZWaveSoftwareGet ? \"\" : \" not\"} supported`,\n direction: \"inbound\",\n });\n if (supportsZWaveSoftwareGet) {\n // Step 4b: Query Z-Wave Software versions\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying Z-Wave software versions...\",\n direction: \"outbound\",\n });\n await api.getZWaveSoftware();\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"received Z-Wave software versions\",\n direction: \"inbound\",\n });\n }\n }\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n}\n// @publicAPI\nexport interface VersionCCReportOptions {\n libraryType: ZWaveLibraryTypes;\n protocolVersion: string;\n firmwareVersions: string[];\n hardwareVersion?: number;\n}\n@CCCommand(VersionCommand.Report)\n@ccValueProperty(\"libraryType\", VersionCCValues.libraryType)\n@ccValueProperty(\"protocolVersion\", VersionCCValues.protocolVersion)\n@ccValueProperty(\"firmwareVersions\", VersionCCValues.firmwareVersions)\n@ccValueProperty(\"hardwareVersion\", VersionCCValues.hardwareVersion)\nexport class VersionCCReport extends VersionCC {\n public constructor(options: WithAddress<VersionCCReportOptions>) {\n super(options);\n if (!/^\\d+\\.\\d+(\\.\\d+)?$/.test(options.protocolVersion)) {\n throw new ZWaveError(`protocolVersion must be a string in the format \"major.minor\" or \"major.minor.patch\", received \"${options.protocolVersion}\"`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (!options.firmwareVersions.every((fw) => /^\\d+\\.\\d+(\\.\\d+)?$/.test(fw))) {\n throw new ZWaveError(`firmwareVersions must be an array of strings in the format \"major.minor\" or \"major.minor.patch\", received \"${JSON.stringify(options.firmwareVersions)}\"`, ZWaveErrorCodes.Argument_Invalid);\n }\n this.libraryType = options.libraryType;\n this.protocolVersion = options.protocolVersion;\n this.firmwareVersions = options.firmwareVersions;\n this.hardwareVersion = options.hardwareVersion;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCReport {\n validatePayload(raw.payload.length >= 5);\n const libraryType: ZWaveLibraryTypes = raw.payload[0];\n const protocolVersion = `${raw.payload[1]}.${raw.payload[2]}`;\n const firmwareVersions = [`${raw.payload[3]}.${raw.payload[4]}`];\n let hardwareVersion: number | undefined;\n if (raw.payload.length >= 7) {\n // V2+\n hardwareVersion = raw.payload[5];\n const additionalFirmwares = raw.payload[6];\n validatePayload(raw.payload.length >= 7 + 2 * additionalFirmwares);\n for (let i = 0; i < additionalFirmwares; i++) {\n firmwareVersions.push(`${raw.payload[7 + 2 * i]}.${raw.payload[7 + 2 * i + 1]}`);\n }\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n libraryType,\n protocolVersion,\n firmwareVersions,\n hardwareVersion,\n });\n }\n public readonly libraryType: ZWaveLibraryTypes;\n public readonly protocolVersion: string;\n public readonly firmwareVersions: string[];\n public readonly hardwareVersion: number | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.libraryType,\n ...this.protocolVersion\n .split(\".\")\n .map((n) => parseInt(n))\n .slice(0, 2),\n ...this.firmwareVersions[0]\n .split(\".\")\n .map((n) => parseInt(n))\n .slice(0, 2),\n this.hardwareVersion ?? 0x00,\n this.firmwareVersions.length - 1,\n ]);\n if (this.firmwareVersions.length > 1) {\n const firmwaresBuffer = new Bytes((this.firmwareVersions.length - 1) * 2);\n for (let i = 1; i < this.firmwareVersions.length; i++) {\n const [major, minor] = this.firmwareVersions[i]\n .split(\".\")\n .map((n) => parseInt(n));\n firmwaresBuffer[2 * (i - 1)] = major;\n firmwaresBuffer[2 * (i - 1) + 1] = minor;\n }\n this.payload = Bytes.concat([this.payload, firmwaresBuffer]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"library type\": getEnumMemberName(ZWaveLibraryTypes, this.libraryType),\n \"protocol version\": this.protocolVersion,\n \"firmware versions\": this.firmwareVersions.join(\", \"),\n };\n if (this.hardwareVersion != undefined) {\n message[\"hardware version\"] = this.hardwareVersion;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(VersionCommand.Get)\n@expectedCCResponse(VersionCCReport)\nexport class VersionCCGet extends VersionCC {\n}\n// @publicAPI\nexport interface VersionCCCommandClassReportOptions {\n requestedCC: CommandClasses;\n ccVersion: number;\n}\n@CCCommand(VersionCommand.CommandClassReport)\nexport class VersionCCCommandClassReport extends VersionCC {\n public constructor(options: WithAddress<VersionCCCommandClassReportOptions>) {\n super(options);\n this.requestedCC = options.requestedCC;\n this.ccVersion = options.ccVersion;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCCommandClassReport {\n validatePayload(raw.payload.length >= 2);\n const requestedCC: CommandClasses = raw.payload[0];\n const ccVersion = raw.payload[1];\n return new this({\n nodeId: ctx.sourceNodeId,\n requestedCC,\n ccVersion,\n });\n }\n public ccVersion: number;\n public requestedCC: CommandClasses;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.requestedCC, this.ccVersion]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n CC: getCCName(this.requestedCC),\n version: this.ccVersion,\n },\n };\n }\n}\n// @publicAPI\nexport interface VersionCCCommandClassGetOptions {\n requestedCC: CommandClasses;\n}\nfunction testResponseForVersionCommandClassGet(sent: VersionCCCommandClassGet, received: VersionCCCommandClassReport) {\n // We expect a Version CommandClass Report that matches the requested CC\n return sent.requestedCC === received.requestedCC;\n}\n@CCCommand(VersionCommand.CommandClassGet)\n@expectedCCResponse(VersionCCCommandClassReport, testResponseForVersionCommandClassGet)\nexport class VersionCCCommandClassGet extends VersionCC {\n public constructor(options: WithAddress<VersionCCCommandClassGetOptions>) {\n super(options);\n this.requestedCC = options.requestedCC;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCCommandClassGet {\n validatePayload(raw.payload.length >= 1);\n const requestedCC: CommandClasses = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n requestedCC,\n });\n }\n public requestedCC: CommandClasses;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.requestedCC]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { CC: getCCName(this.requestedCC) },\n };\n }\n}\n// @publicAPI\nexport interface VersionCCCapabilitiesReportOptions {\n supportsZWaveSoftwareGet: boolean;\n}\n@CCCommand(VersionCommand.CapabilitiesReport)\n@ccValueProperty(\"supportsZWaveSoftwareGet\", VersionCCValues.supportsZWaveSoftwareGet)\nexport class VersionCCCapabilitiesReport extends VersionCC {\n public constructor(options: WithAddress<VersionCCCapabilitiesReportOptions>) {\n super(options);\n this.supportsZWaveSoftwareGet = options.supportsZWaveSoftwareGet;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCCapabilitiesReport {\n validatePayload(raw.payload.length >= 1);\n const capabilities = raw.payload[0];\n const supportsZWaveSoftwareGet = !!(capabilities & 0b100);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsZWaveSoftwareGet,\n });\n }\n public supportsZWaveSoftwareGet: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n (this.supportsZWaveSoftwareGet ? 0b100 : 0) | 0b11,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports Z-Wave Software Get command\": this.supportsZWaveSoftwareGet,\n },\n };\n }\n}\n@CCCommand(VersionCommand.CapabilitiesGet)\n@expectedCCResponse(VersionCCCapabilitiesReport)\nexport class VersionCCCapabilitiesGet extends VersionCC {\n}\n// @publicAPI\nexport interface VersionCCZWaveSoftwareReportOptions {\n sdkVersion: string;\n applicationFrameworkAPIVersion: string;\n applicationFrameworkBuildNumber: number;\n hostInterfaceVersion: string;\n hostInterfaceBuildNumber: number;\n zWaveProtocolVersion: string;\n zWaveProtocolBuildNumber: number;\n applicationVersion: string;\n applicationBuildNumber: number;\n}\n@CCCommand(VersionCommand.ZWaveSoftwareReport)\n@ccValueProperty(\"sdkVersion\", VersionCCValues.sdkVersion)\n@ccValueProperty(\"applicationFrameworkAPIVersion\", VersionCCValues.applicationFrameworkAPIVersion)\n@ccValueProperty(\"applicationFrameworkBuildNumber\", VersionCCValues.applicationFrameworkBuildNumber)\n@ccValueProperty(\"hostInterfaceVersion\", VersionCCValues.serialAPIVersion)\n@ccValueProperty(\"hostInterfaceBuildNumber\", VersionCCValues.serialAPIBuildNumber)\n@ccValueProperty(\"zWaveProtocolVersion\", VersionCCValues.zWaveProtocolVersion)\n@ccValueProperty(\"zWaveProtocolBuildNumber\", VersionCCValues.zWaveProtocolBuildNumber)\n@ccValueProperty(\"applicationVersion\", VersionCCValues.applicationVersion)\n@ccValueProperty(\"applicationBuildNumber\", VersionCCValues.applicationBuildNumber)\nexport class VersionCCZWaveSoftwareReport extends VersionCC {\n public constructor(options: WithAddress<VersionCCZWaveSoftwareReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.sdkVersion = options.sdkVersion;\n this.applicationFrameworkAPIVersion =\n options.applicationFrameworkAPIVersion;\n this.applicationFrameworkBuildNumber =\n options.applicationFrameworkBuildNumber;\n this.hostInterfaceVersion = options.hostInterfaceVersion;\n this.hostInterfaceBuildNumber = options.hostInterfaceBuildNumber;\n this.zWaveProtocolVersion = options.zWaveProtocolVersion;\n this.zWaveProtocolBuildNumber = options.zWaveProtocolBuildNumber;\n this.applicationVersion = options.applicationVersion;\n this.applicationBuildNumber = options.applicationBuildNumber;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): VersionCCZWaveSoftwareReport {\n validatePayload(raw.payload.length >= 23);\n const sdkVersion = parseVersion(raw.payload);\n const applicationFrameworkAPIVersion = parseVersion(raw.payload.subarray(3));\n let applicationFrameworkBuildNumber;\n if (applicationFrameworkAPIVersion !== \"unused\") {\n applicationFrameworkBuildNumber = raw.payload.readUInt16BE(6);\n }\n else {\n applicationFrameworkBuildNumber = 0;\n }\n const hostInterfaceVersion = parseVersion(raw.payload.subarray(8));\n let hostInterfaceBuildNumber;\n if (hostInterfaceVersion !== \"unused\") {\n hostInterfaceBuildNumber = raw.payload.readUInt16BE(11);\n }\n else {\n hostInterfaceBuildNumber = 0;\n }\n const zWaveProtocolVersion = parseVersion(raw.payload.subarray(13));\n let zWaveProtocolBuildNumber;\n if (zWaveProtocolVersion !== \"unused\") {\n zWaveProtocolBuildNumber = raw.payload.readUInt16BE(16);\n }\n else {\n zWaveProtocolBuildNumber = 0;\n }\n const applicationVersion = parseVersion(raw.payload.subarray(18));\n let applicationBuildNumber;\n if (applicationVersion !== \"unused\") {\n applicationBuildNumber = raw.payload.readUInt16BE(21);\n }\n else {\n applicationBuildNumber = 0;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n sdkVersion,\n applicationFrameworkAPIVersion,\n applicationFrameworkBuildNumber,\n hostInterfaceVersion,\n hostInterfaceBuildNumber,\n zWaveProtocolVersion,\n zWaveProtocolBuildNumber,\n applicationVersion,\n applicationBuildNumber,\n });\n }\n public readonly sdkVersion: string;\n public readonly applicationFrameworkAPIVersion: string;\n public readonly applicationFrameworkBuildNumber: number;\n public readonly hostInterfaceVersion: string;\n public readonly hostInterfaceBuildNumber: number;\n public readonly zWaveProtocolVersion: string;\n public readonly zWaveProtocolBuildNumber: number;\n public readonly applicationVersion: string;\n public readonly applicationBuildNumber: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"SDK version\": this.sdkVersion,\n };\n message[\"appl. framework API version\"] =\n this.applicationFrameworkAPIVersion;\n if (this.applicationFrameworkAPIVersion !== \"unused\") {\n message[\"appl. framework build number\"] =\n this.applicationFrameworkBuildNumber;\n }\n message[\"host interface version\"] = this.hostInterfaceVersion;\n if (this.hostInterfaceVersion !== \"unused\") {\n message[\"host interface build number\"] =\n this.hostInterfaceBuildNumber;\n }\n message[\"Z-Wave protocol version\"] = this.zWaveProtocolVersion;\n if (this.zWaveProtocolVersion !== \"unused\") {\n message[\"Z-Wave protocol build number\"] =\n this.zWaveProtocolBuildNumber;\n }\n message[\"application version\"] = this.applicationVersion;\n if (this.applicationVersion !== \"unused\") {\n message[\"application build number\"] = this.applicationBuildNumber;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(VersionCommand.ZWaveSoftwareGet)\n@expectedCCResponse(VersionCCZWaveSoftwareReport)\nexport class VersionCCZWaveSoftwareGet extends VersionCC {\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAmU;AACnU,oBAAyE;AACzE,iBAAqC;AACrC,0BAAiE;AACjE,oCAAwI;AAExI,mBAA+B;AAE/B,gCAAgC;AAThC,MAAM,EAAE,sCAAsC,wCAAwC,0CAAyC,IAAK;AAWpI,SAAS,aAAa,QAAiB;AACnC,MAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;AACpD,WAAO;AACX,SAAO,GAAG,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC;AACjD;AAJS;IAOI,gBAAY,MAAA;8BADxB,mCAAI,2BAAe,OAAO,CAAC;;;;oBACM;;;;;oCAAA,YAAa;WAAA;;;;;;;;gCAmC1C,qCAAoC,CAAE;kCAUtC,uCAAsC,CAAE;qCAWxC,0CAAyC,CAAE;AApB5C,qCAAA,MAAA,MAAA,wBAAA,EAAA,MAAA,UAAA,MAAA,cAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,gBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,YAAb,OAAuB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAUvB,qCAAA,MAAA,MAAA,0BAAA,EAAA,MAAA,UAAA,MAAA,gBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,kBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,cAAb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AAI,KAAK;AACtC,UAAI,KAAK,uBAAuB,UAAU;AACtC,gBAAQ,0BAA0B,IAAI,KAAK;MAC/C;AACA,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB;;IAER;;;;IAIS,6BAAyB,MAAA;8BAFrC,yCAAU,4BAAe,gBAAgB,OACzC,kDAAmB,4BAA4B,CAAC;;;;oBACF;iDAAA,YAAS;WAAA;;;;;;;;AAAxD,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;",
6
6
  "names": []
7
7
  }
@@ -310,7 +310,9 @@ ${supported.map((p) => `\xB7 ${(0, import_shared.getEnumMemberName)(import_Types
310
310
  this.setMetadata(ctx, import_CCValues_generated.WindowCoveringCCValues.levelChangeUp(param));
311
311
  this.setMetadata(ctx, import_CCValues_generated.WindowCoveringCCValues.levelChangeDown(param));
312
312
  }
313
- await this.refreshValues(ctx);
313
+ await this.refreshValues(ctx, {
314
+ onProgress: /* @__PURE__ */ __name((completed, total) => node.reportInterviewProgress(completed, total), "onProgress")
315
+ });
314
316
  }
315
317
  this.setInterviewComplete(ctx, true);
316
318
  }
@@ -321,15 +323,15 @@ ${supported.map((p) => `\xB7 ${(0, import_shared.getEnumMemberName)(import_Types
321
323
  priority: options?.priority ?? import_core.MessagePriority.NodeQuery
322
324
  });
323
325
  const parameters = this.getValue(ctx, import_CCValues_generated.WindowCoveringCCValues.supportedParameters) ?? [];
324
- for (const param of parameters) {
325
- if (param % 2 == 0)
326
- continue;
326
+ const queryableParameters = parameters.filter((param) => param % 2 != 0);
327
+ for (const [i, param] of queryableParameters.entries()) {
327
328
  ctx.logNode(node.id, {
328
329
  endpoint: this.endpointIndex,
329
330
  message: `querying position for parameter ${(0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, param)}...`,
330
331
  direction: "outbound"
331
332
  });
332
333
  await api.get(param);
334
+ options?.onProgress?.(i + 1, queryableParameters.length);
333
335
  }
334
336
  }
335
337
  translatePropertyKey(ctx, property, propertyKey) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/WindowCoveringCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./WindowCoveringCC._validateArgs.js\";\nconst { validateArgs_WindowCoveringCCAPI_get, validateArgs_WindowCoveringCCAPI_set, validateArgs_WindowCoveringCCAPI_startLevelChange, validateArgs_WindowCoveringCCAPI_stopLevelChange } = __validateArgs;\nimport { CommandClasses, Duration, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, ValueMetadata, type WithAddress, encodeBitMask, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, isEnumMember, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { windowCoveringParameterToLevelChangeLabel, windowCoveringParameterToMetadataStates, } from \"../lib/CCValueUtils.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type LevelChangeDirection, WindowCoveringCommand, WindowCoveringParameter, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { WindowCoveringCCValues } from \"./_CCValues.generated.js\";\nexport { WindowCoveringCCValues };\n@API(CommandClasses[\"Window Covering\"])\nexport class WindowCoveringCCAPI extends CCAPI {\n public supportsCommand(cmd: WindowCoveringCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case WindowCoveringCommand.Get:\n case WindowCoveringCommand.Set:\n case WindowCoveringCommand.SupportedGet:\n case WindowCoveringCommand.StartLevelChange:\n case WindowCoveringCommand.StopLevelChange:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: WindowCoveringCCAPI, { property, propertyKey }, value, options) {\n const valueId = {\n commandClass: this.ccId,\n property,\n propertyKey,\n };\n if (WindowCoveringCCValues.targetValue.is(valueId)) {\n if (typeof propertyKey !== \"number\"\n // Only odd-numbered parameters have position support and are writable\n || propertyKey % 2 === 0) {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey!);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n const parameter = propertyKey;\n const duration = Duration.from(options?.transitionDuration);\n return this.set([{ parameter, value }], duration);\n }\n else if (WindowCoveringCCValues.levelChangeUp.is(valueId)\n || WindowCoveringCCValues.levelChangeDown.is(valueId)) {\n if (typeof value !== \"boolean\") {\n throwWrongValueType(this.ccId, property, \"boolean\", typeof value);\n }\n const parameter = propertyKey as number;\n const direction = WindowCoveringCCValues.levelChangeUp.is(valueId)\n ? \"up\"\n : \"down\";\n if (value) {\n // Perform the level change\n const duration = Duration.from(options?.transitionDuration);\n return this.startLevelChange(parameter, direction, duration);\n }\n else {\n return this.stopLevelChange(parameter);\n }\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property, propertyKey }, value, options) => {\n const valueId = {\n commandClass: this.ccId,\n property,\n propertyKey,\n };\n if (WindowCoveringCCValues.targetValue.is(valueId)) {\n if (typeof propertyKey !== \"number\")\n return;\n const parameter = propertyKey;\n const duration = Duration.from(options?.transitionDuration);\n const currentValueValueId = WindowCoveringCCValues.currentValue(parameter).endpoint(this.endpoint.index);\n return {\n // This is the target value for a split target/current state pair.\n isSplitStateTargetValue: true,\n // Window Covering commands may take some time to be executed.\n // Therefore we try to supervise the command execution and delay the\n // optimistic update until the final result is received.\n supervisionDelayedUpdates: true,\n supervisionOnSuccess: async () => {\n // Only update currentValue for valid target values\n if (typeof value === \"number\"\n && value >= 0\n && value <= 99) {\n this.tryGetValueDB()?.setValue(currentValueValueId, value);\n }\n else if (value === 255) {\n // We don't know the status now, so refresh the current value\n try {\n await this.get(parameter);\n }\n catch {\n // ignore\n }\n }\n },\n supervisionOnFailure: async () => {\n // The transition failed, so now we don't know the status - refresh the current value\n try {\n await this.get(parameter);\n }\n catch {\n // ignore\n }\n },\n optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {\n // Only update currentValue for valid target values\n if (typeof value === \"number\"\n && value >= 0\n && value <= 99) {\n if (this.isSinglecast()) {\n this.tryGetValueDB()?.setValue(currentValueValueId, value);\n }\n else if (this.isMulticast()) {\n // Figure out which nodes were affected by this command\n const affectedNodes = this.endpoint.node\n .physicalNodes.filter((node) => node\n .getEndpoint(this.endpoint.index)\n ?.supportsCC(this.ccId));\n // and optimistically update the currentValue\n for (const node of affectedNodes) {\n this.host\n .tryGetValueDB(node.id)\n ?.setValue(currentValueValueId, value);\n }\n }\n }\n },\n verifyChanges: () => {\n if (this.isSinglecast()) {\n // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll\n this.schedulePoll(currentValueValueId, value, {\n duration,\n });\n }\n else {\n // For multicasts, do not schedule a refresh - this could cause a LOT of traffic\n }\n },\n };\n }\n };\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: WindowCoveringCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"currentValue\":\n case \"targetValue\":\n case \"duration\":\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return (await this.get(propertyKey))?.[property];\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n public async getSupported(): Promise<MaybeNotKnown<readonly WindowCoveringParameter[]>> {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.SupportedGet);\n const cc = new WindowCoveringCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<WindowCoveringCCSupportedReport>(cc, this.commandOptions);\n return response?.supportedParameters;\n }\n @validateArgs_WindowCoveringCCAPI_get()\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get(parameter: WindowCoveringParameter) {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.Get);\n const cc = new WindowCoveringCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<WindowCoveringCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"currentValue\", \"targetValue\", \"duration\"]);\n }\n }\n @validateArgs_WindowCoveringCCAPI_set()\n public async set(targetValues: {\n parameter: WindowCoveringParameter;\n value: number;\n }[], duration?: Duration | string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);\n const cc = new WindowCoveringCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n targetValues,\n duration,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_WindowCoveringCCAPI_startLevelChange()\n public async startLevelChange(parameter: WindowCoveringParameter, direction: keyof typeof LevelChangeDirection, duration?: Duration | string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);\n const cc = new WindowCoveringCCStartLevelChange({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n direction,\n duration,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_WindowCoveringCCAPI_stopLevelChange()\n public async stopLevelChange(parameter: WindowCoveringParameter): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StopLevelChange);\n const cc = new WindowCoveringCCStopLevelChange({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses[\"Window Covering\"])\n@implementedVersion(1)\n@ccValues(WindowCoveringCCValues)\nexport class WindowCoveringCC extends CommandClass {\n declare ccCommand: WindowCoveringCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Window Covering\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying supported window covering parameters...\",\n direction: \"outbound\",\n });\n const supported = await api.getSupported();\n if (supported?.length) {\n const logMessage = `supported window covering parameters:\n${supported\n .map((p) => `\u00B7 ${getEnumMemberName(WindowCoveringParameter, p)}`)\n .join(\"\\n\")}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n // Create metadata for all supported parameters\n for (const param of supported) {\n // Default values\n this.setMetadata(ctx, WindowCoveringCCValues.currentValue(param));\n this.setMetadata(ctx, WindowCoveringCCValues.targetValue(param));\n this.setMetadata(ctx, WindowCoveringCCValues.duration(param));\n // Level change values\n this.setMetadata(ctx, WindowCoveringCCValues.levelChangeUp(param));\n this.setMetadata(ctx, WindowCoveringCCValues.levelChangeDown(param));\n }\n // Query current values for all supported parameters\n await this.refreshValues(ctx);\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Window Covering\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n });\n const parameters: number[] = this.getValue(ctx, WindowCoveringCCValues.supportedParameters) ?? [];\n for (const param of parameters) {\n // Only query odd parameters (with position support)\n if (param % 2 == 0)\n continue;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying position for parameter ${getEnumMemberName(WindowCoveringParameter, param)}...`,\n direction: \"outbound\",\n });\n await api.get(param);\n }\n }\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey: string | number): string | undefined {\n if (typeof propertyKey === \"number\") {\n return getEnumMemberName(WindowCoveringParameter, propertyKey);\n }\n return super.translatePropertyKey(ctx, property, propertyKey);\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCSupportedReportOptions {\n supportedParameters: readonly WindowCoveringParameter[];\n}\n@CCCommand(WindowCoveringCommand.SupportedReport)\n@ccValueProperty(\"supportedParameters\", WindowCoveringCCValues.supportedParameters)\nexport class WindowCoveringCCSupportedReport extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCSupportedReportOptions>) {\n super(options);\n this.supportedParameters = options.supportedParameters;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const numBitmaskBytes = raw.payload[0] & 0b1111;\n validatePayload(raw.payload.length >= 1 + numBitmaskBytes);\n const bitmask = raw.payload.subarray(1, 1 + numBitmaskBytes);\n const supportedParameters: WindowCoveringParameter[] = parseBitMask(bitmask, WindowCoveringParameter[\"Outbound Left (no position)\"]);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedParameters,\n });\n }\n public readonly supportedParameters: readonly WindowCoveringParameter[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const bitmask = encodeBitMask(this.supportedParameters, undefined, WindowCoveringParameter[\"Outbound Left (no position)\"]).subarray(0, 15);\n const numBitmaskBytes = bitmask.length & 0b1111;\n this.payload = Bytes.concat([\n [numBitmaskBytes],\n bitmask.subarray(0, numBitmaskBytes),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported parameters\": this.supportedParameters\n .map((p) => `\\n\u00B7 ${getEnumMemberName(WindowCoveringParameter, p)}`)\n .join(\"\"),\n },\n };\n }\n}\n@CCCommand(WindowCoveringCommand.SupportedGet)\n@expectedCCResponse(WindowCoveringCCSupportedReport)\nexport class WindowCoveringCCSupportedGet extends WindowCoveringCC {\n}\n// @publicAPI\nexport interface WindowCoveringCCReportOptions {\n parameter: WindowCoveringParameter;\n currentValue: number;\n targetValue: number;\n duration: Duration;\n}\n@CCCommand(WindowCoveringCommand.Report)\n@ccValueProperty(\"currentValue\", WindowCoveringCCValues.currentValue, (self) => [self.parameter])\n@ccValueProperty(\"targetValue\", WindowCoveringCCValues.targetValue, (self) => [self.parameter])\n@ccValueProperty(\"duration\", WindowCoveringCCValues.duration, (self) => [self.parameter])\nexport class WindowCoveringCCReport extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.parameter = options.parameter;\n this.currentValue = options.currentValue;\n this.targetValue = options.targetValue;\n this.duration = options.duration;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCReport {\n validatePayload(raw.payload.length >= 4);\n const parameter: WindowCoveringParameter = raw.payload[0];\n validatePayload(isEnumMember(WindowCoveringParameter, parameter));\n validatePayload(raw.payload[1] <= 99, raw.payload[2] <= 99);\n const currentValue = raw.payload[1];\n const targetValue = raw.payload[2];\n const duration = Duration.parseReport(raw.payload[3])\n ?? Duration.unknown();\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n currentValue,\n targetValue,\n duration,\n });\n }\n public readonly parameter: WindowCoveringParameter;\n public readonly currentValue: number;\n public readonly targetValue: number;\n public readonly duration: Duration;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.parameter,\n this.currentValue,\n this.targetValue,\n this.duration.serializeReport(),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),\n \"current value\": this.currentValue,\n \"target value\": this.targetValue,\n duration: this.duration.toString(),\n },\n };\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCGetOptions {\n parameter: WindowCoveringParameter;\n}\nfunction testResponseForWindowCoveringGet(sent: WindowCoveringCCGet, received: WindowCoveringCCReport) {\n return received.parameter === sent.parameter;\n}\n@CCCommand(WindowCoveringCommand.Get)\n@expectedCCResponse(WindowCoveringCCReport, testResponseForWindowCoveringGet)\nexport class WindowCoveringCCGet extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCGet {\n validatePayload(raw.payload.length >= 1);\n const parameter: WindowCoveringParameter = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: WindowCoveringParameter;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.parameter]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),\n },\n };\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCSetOptions {\n targetValues: {\n parameter: WindowCoveringParameter;\n value: number;\n }[];\n duration?: Duration | string;\n}\n@CCCommand(WindowCoveringCommand.Set)\n@useSupervision()\nexport class WindowCoveringCCSet extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCSetOptions>) {\n super(options);\n this.targetValues = options.targetValues;\n this.duration = Duration.from(options.duration);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCSet {\n validatePayload(raw.payload.length >= 1);\n const numEntries = raw.payload[0] & 0b11111;\n validatePayload(raw.payload.length >= 1 + numEntries * 2);\n const targetValues: WindowCoveringCCSetOptions[\"targetValues\"] = [];\n for (let i = 0; i < numEntries; i++) {\n const offset = 1 + i * 2;\n targetValues.push({\n parameter: raw.payload[offset],\n value: raw.payload[offset + 1],\n });\n }\n let duration: Duration | undefined;\n if (raw.payload.length >= 2 + numEntries * 2) {\n duration = Duration.parseSet(raw.payload[1 + numEntries * 2]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n targetValues,\n duration,\n });\n }\n public targetValues: {\n parameter: WindowCoveringParameter;\n value: number;\n }[];\n public duration: Duration | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const numEntries = this.targetValues.length & 0b11111;\n this.payload = new Bytes(2 + numEntries * 2);\n this.payload[0] = numEntries;\n for (let i = 0; i < numEntries; i++) {\n const offset = 1 + i * 2;\n this.payload[offset] = this.targetValues[i].parameter;\n this.payload[offset + 1] = this.targetValues[i].value;\n }\n this.payload[this.payload.length - 1] = (this.duration ?? Duration.default()).serializeSet();\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n for (const { parameter, value } of this.targetValues) {\n message[getEnumMemberName(WindowCoveringParameter, parameter)] =\n value;\n }\n if (this.duration) {\n message.duration = this.duration.toString();\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCStartLevelChangeOptions {\n parameter: WindowCoveringParameter;\n direction: keyof typeof LevelChangeDirection;\n duration?: Duration | string;\n}\n@CCCommand(WindowCoveringCommand.StartLevelChange)\n@useSupervision()\nexport class WindowCoveringCCStartLevelChange extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCStartLevelChangeOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.direction = options.direction;\n this.duration = Duration.from(options.duration);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCStartLevelChange {\n validatePayload(raw.payload.length >= 2);\n const direction = !!(raw.payload[0] & 64)\n ? \"down\"\n : \"up\";\n const parameter: WindowCoveringParameter = raw.payload[1];\n let duration: Duration | undefined;\n if (raw.payload.length >= 3) {\n duration = Duration.parseSet(raw.payload[2]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n direction,\n parameter,\n duration,\n });\n }\n public parameter: WindowCoveringParameter;\n public direction: keyof typeof LevelChangeDirection;\n public duration: Duration | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.direction === \"down\" ? 64 : 0,\n this.parameter,\n (this.duration ?? Duration.default()).serializeSet(),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),\n direction: this.direction,\n };\n if (this.duration) {\n message.duration = this.duration.toString();\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCStopLevelChangeOptions {\n parameter: WindowCoveringParameter;\n}\n@CCCommand(WindowCoveringCommand.StopLevelChange)\n@useSupervision()\nexport class WindowCoveringCCStopLevelChange extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCStopLevelChangeOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCStopLevelChange {\n validatePayload(raw.payload.length >= 1);\n const parameter: WindowCoveringParameter = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: WindowCoveringParameter;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.parameter]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),\n },\n };\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAqP;AACrP,oBAA6D;AAC7D,iBAAwQ;AAExQ,0BAAuH;AACvH,oCAAiI;AAEjI,mBAA2F;AAE3F,gCAAuC;AAVvC,MAAM,EAAE,sCAAsC,sCAAsC,mDAAmD,iDAAgD,IAAK;IAa/K,uBAAmB,MAAA;8BAD/B,mCAAI,2BAAe,iBAAiB,CAAC,CAAC;;;;oBACE;;;;;;2CAAA,YAAK;WAAA;;;;;;;;yBAoKzC,qCAAoC,CAAE;yBActC,qCAAoC,CAAE;sCActC,kDAAiD,CAAE;qCAYnD,iDAAgD,CAAE;AAtCnD,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAahB,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAchB,qCAAA,MAAA,MAAA,8BAAA,EAAA,MAAA,UAAA,MAAA,oBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,sBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,kBAAb,OAA6B,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAY7B,qCAAA,M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;AAC1C,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,eAAW,iCAAkB,sCAAyB,KAAK,SAAS;;;IAGhF;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./WindowCoveringCC._validateArgs.js\";\nconst { validateArgs_WindowCoveringCCAPI_get, validateArgs_WindowCoveringCCAPI_set, validateArgs_WindowCoveringCCAPI_startLevelChange, validateArgs_WindowCoveringCCAPI_stopLevelChange } = __validateArgs;\nimport { CommandClasses, Duration, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, ValueMetadata, type WithAddress, encodeBitMask, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, isEnumMember, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { windowCoveringParameterToLevelChangeLabel, windowCoveringParameterToMetadataStates, } from \"../lib/CCValueUtils.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type LevelChangeDirection, WindowCoveringCommand, WindowCoveringParameter, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { WindowCoveringCCValues } from \"./_CCValues.generated.js\";\nexport { WindowCoveringCCValues };\n@API(CommandClasses[\"Window Covering\"])\nexport class WindowCoveringCCAPI extends CCAPI {\n public supportsCommand(cmd: WindowCoveringCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case WindowCoveringCommand.Get:\n case WindowCoveringCommand.Set:\n case WindowCoveringCommand.SupportedGet:\n case WindowCoveringCommand.StartLevelChange:\n case WindowCoveringCommand.StopLevelChange:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: WindowCoveringCCAPI, { property, propertyKey }, value, options) {\n const valueId = {\n commandClass: this.ccId,\n property,\n propertyKey,\n };\n if (WindowCoveringCCValues.targetValue.is(valueId)) {\n if (typeof propertyKey !== \"number\"\n // Only odd-numbered parameters have position support and are writable\n || propertyKey % 2 === 0) {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey!);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n const parameter = propertyKey;\n const duration = Duration.from(options?.transitionDuration);\n return this.set([{ parameter, value }], duration);\n }\n else if (WindowCoveringCCValues.levelChangeUp.is(valueId)\n || WindowCoveringCCValues.levelChangeDown.is(valueId)) {\n if (typeof value !== \"boolean\") {\n throwWrongValueType(this.ccId, property, \"boolean\", typeof value);\n }\n const parameter = propertyKey as number;\n const direction = WindowCoveringCCValues.levelChangeUp.is(valueId)\n ? \"up\"\n : \"down\";\n if (value) {\n // Perform the level change\n const duration = Duration.from(options?.transitionDuration);\n return this.startLevelChange(parameter, direction, duration);\n }\n else {\n return this.stopLevelChange(parameter);\n }\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property, propertyKey }, value, options) => {\n const valueId = {\n commandClass: this.ccId,\n property,\n propertyKey,\n };\n if (WindowCoveringCCValues.targetValue.is(valueId)) {\n if (typeof propertyKey !== \"number\")\n return;\n const parameter = propertyKey;\n const duration = Duration.from(options?.transitionDuration);\n const currentValueValueId = WindowCoveringCCValues.currentValue(parameter).endpoint(this.endpoint.index);\n return {\n // This is the target value for a split target/current state pair.\n isSplitStateTargetValue: true,\n // Window Covering commands may take some time to be executed.\n // Therefore we try to supervise the command execution and delay the\n // optimistic update until the final result is received.\n supervisionDelayedUpdates: true,\n supervisionOnSuccess: async () => {\n // Only update currentValue for valid target values\n if (typeof value === \"number\"\n && value >= 0\n && value <= 99) {\n this.tryGetValueDB()?.setValue(currentValueValueId, value);\n }\n else if (value === 255) {\n // We don't know the status now, so refresh the current value\n try {\n await this.get(parameter);\n }\n catch {\n // ignore\n }\n }\n },\n supervisionOnFailure: async () => {\n // The transition failed, so now we don't know the status - refresh the current value\n try {\n await this.get(parameter);\n }\n catch {\n // ignore\n }\n },\n optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {\n // Only update currentValue for valid target values\n if (typeof value === \"number\"\n && value >= 0\n && value <= 99) {\n if (this.isSinglecast()) {\n this.tryGetValueDB()?.setValue(currentValueValueId, value);\n }\n else if (this.isMulticast()) {\n // Figure out which nodes were affected by this command\n const affectedNodes = this.endpoint.node\n .physicalNodes.filter((node) => node\n .getEndpoint(this.endpoint.index)\n ?.supportsCC(this.ccId));\n // and optimistically update the currentValue\n for (const node of affectedNodes) {\n this.host\n .tryGetValueDB(node.id)\n ?.setValue(currentValueValueId, value);\n }\n }\n }\n },\n verifyChanges: () => {\n if (this.isSinglecast()) {\n // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll\n this.schedulePoll(currentValueValueId, value, {\n duration,\n });\n }\n else {\n // For multicasts, do not schedule a refresh - this could cause a LOT of traffic\n }\n },\n };\n }\n };\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: WindowCoveringCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"currentValue\":\n case \"targetValue\":\n case \"duration\":\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return (await this.get(propertyKey))?.[property];\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n public async getSupported(): Promise<MaybeNotKnown<readonly WindowCoveringParameter[]>> {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.SupportedGet);\n const cc = new WindowCoveringCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<WindowCoveringCCSupportedReport>(cc, this.commandOptions);\n return response?.supportedParameters;\n }\n @validateArgs_WindowCoveringCCAPI_get()\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get(parameter: WindowCoveringParameter) {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.Get);\n const cc = new WindowCoveringCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<WindowCoveringCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"currentValue\", \"targetValue\", \"duration\"]);\n }\n }\n @validateArgs_WindowCoveringCCAPI_set()\n public async set(targetValues: {\n parameter: WindowCoveringParameter;\n value: number;\n }[], duration?: Duration | string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);\n const cc = new WindowCoveringCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n targetValues,\n duration,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_WindowCoveringCCAPI_startLevelChange()\n public async startLevelChange(parameter: WindowCoveringParameter, direction: keyof typeof LevelChangeDirection, duration?: Duration | string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);\n const cc = new WindowCoveringCCStartLevelChange({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n direction,\n duration,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_WindowCoveringCCAPI_stopLevelChange()\n public async stopLevelChange(parameter: WindowCoveringParameter): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StopLevelChange);\n const cc = new WindowCoveringCCStopLevelChange({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses[\"Window Covering\"])\n@implementedVersion(1)\n@ccValues(WindowCoveringCCValues)\nexport class WindowCoveringCC extends CommandClass {\n declare ccCommand: WindowCoveringCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Window Covering\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying supported window covering parameters...\",\n direction: \"outbound\",\n });\n const supported = await api.getSupported();\n if (supported?.length) {\n const logMessage = `supported window covering parameters:\n${supported\n .map((p) => `\u00B7 ${getEnumMemberName(WindowCoveringParameter, p)}`)\n .join(\"\\n\")}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n // Create metadata for all supported parameters\n for (const param of supported) {\n // Default values\n this.setMetadata(ctx, WindowCoveringCCValues.currentValue(param));\n this.setMetadata(ctx, WindowCoveringCCValues.targetValue(param));\n this.setMetadata(ctx, WindowCoveringCCValues.duration(param));\n // Level change values\n this.setMetadata(ctx, WindowCoveringCCValues.levelChangeUp(param));\n this.setMetadata(ctx, WindowCoveringCCValues.levelChangeDown(param));\n }\n // Query current values for all supported parameters\n await this.refreshValues(ctx, {\n onProgress: (completed, total) => node.reportInterviewProgress(completed, total),\n });\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Window Covering\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n });\n const parameters: number[] = this.getValue(ctx, WindowCoveringCCValues.supportedParameters) ?? [];\n // Only odd parameters have position support and need to be queried\n const queryableParameters = parameters.filter((param) => param % 2 != 0);\n for (const [i, param] of queryableParameters.entries()) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying position for parameter ${getEnumMemberName(WindowCoveringParameter, param)}...`,\n direction: \"outbound\",\n });\n await api.get(param);\n options?.onProgress?.(i + 1, queryableParameters.length);\n }\n }\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey: string | number): string | undefined {\n if (typeof propertyKey === \"number\") {\n return getEnumMemberName(WindowCoveringParameter, propertyKey);\n }\n return super.translatePropertyKey(ctx, property, propertyKey);\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCSupportedReportOptions {\n supportedParameters: readonly WindowCoveringParameter[];\n}\n@CCCommand(WindowCoveringCommand.SupportedReport)\n@ccValueProperty(\"supportedParameters\", WindowCoveringCCValues.supportedParameters)\nexport class WindowCoveringCCSupportedReport extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCSupportedReportOptions>) {\n super(options);\n this.supportedParameters = options.supportedParameters;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const numBitmaskBytes = raw.payload[0] & 0b1111;\n validatePayload(raw.payload.length >= 1 + numBitmaskBytes);\n const bitmask = raw.payload.subarray(1, 1 + numBitmaskBytes);\n const supportedParameters: WindowCoveringParameter[] = parseBitMask(bitmask, WindowCoveringParameter[\"Outbound Left (no position)\"]);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedParameters,\n });\n }\n public readonly supportedParameters: readonly WindowCoveringParameter[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const bitmask = encodeBitMask(this.supportedParameters, undefined, WindowCoveringParameter[\"Outbound Left (no position)\"]).subarray(0, 15);\n const numBitmaskBytes = bitmask.length & 0b1111;\n this.payload = Bytes.concat([\n [numBitmaskBytes],\n bitmask.subarray(0, numBitmaskBytes),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported parameters\": this.supportedParameters\n .map((p) => `\\n\u00B7 ${getEnumMemberName(WindowCoveringParameter, p)}`)\n .join(\"\"),\n },\n };\n }\n}\n@CCCommand(WindowCoveringCommand.SupportedGet)\n@expectedCCResponse(WindowCoveringCCSupportedReport)\nexport class WindowCoveringCCSupportedGet extends WindowCoveringCC {\n}\n// @publicAPI\nexport interface WindowCoveringCCReportOptions {\n parameter: WindowCoveringParameter;\n currentValue: number;\n targetValue: number;\n duration: Duration;\n}\n@CCCommand(WindowCoveringCommand.Report)\n@ccValueProperty(\"currentValue\", WindowCoveringCCValues.currentValue, (self) => [self.parameter])\n@ccValueProperty(\"targetValue\", WindowCoveringCCValues.targetValue, (self) => [self.parameter])\n@ccValueProperty(\"duration\", WindowCoveringCCValues.duration, (self) => [self.parameter])\nexport class WindowCoveringCCReport extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.parameter = options.parameter;\n this.currentValue = options.currentValue;\n this.targetValue = options.targetValue;\n this.duration = options.duration;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCReport {\n validatePayload(raw.payload.length >= 4);\n const parameter: WindowCoveringParameter = raw.payload[0];\n validatePayload(isEnumMember(WindowCoveringParameter, parameter));\n validatePayload(raw.payload[1] <= 99, raw.payload[2] <= 99);\n const currentValue = raw.payload[1];\n const targetValue = raw.payload[2];\n const duration = Duration.parseReport(raw.payload[3])\n ?? Duration.unknown();\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n currentValue,\n targetValue,\n duration,\n });\n }\n public readonly parameter: WindowCoveringParameter;\n public readonly currentValue: number;\n public readonly targetValue: number;\n public readonly duration: Duration;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.parameter,\n this.currentValue,\n this.targetValue,\n this.duration.serializeReport(),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),\n \"current value\": this.currentValue,\n \"target value\": this.targetValue,\n duration: this.duration.toString(),\n },\n };\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCGetOptions {\n parameter: WindowCoveringParameter;\n}\nfunction testResponseForWindowCoveringGet(sent: WindowCoveringCCGet, received: WindowCoveringCCReport) {\n return received.parameter === sent.parameter;\n}\n@CCCommand(WindowCoveringCommand.Get)\n@expectedCCResponse(WindowCoveringCCReport, testResponseForWindowCoveringGet)\nexport class WindowCoveringCCGet extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCGet {\n validatePayload(raw.payload.length >= 1);\n const parameter: WindowCoveringParameter = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: WindowCoveringParameter;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.parameter]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),\n },\n };\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCSetOptions {\n targetValues: {\n parameter: WindowCoveringParameter;\n value: number;\n }[];\n duration?: Duration | string;\n}\n@CCCommand(WindowCoveringCommand.Set)\n@useSupervision()\nexport class WindowCoveringCCSet extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCSetOptions>) {\n super(options);\n this.targetValues = options.targetValues;\n this.duration = Duration.from(options.duration);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCSet {\n validatePayload(raw.payload.length >= 1);\n const numEntries = raw.payload[0] & 0b11111;\n validatePayload(raw.payload.length >= 1 + numEntries * 2);\n const targetValues: WindowCoveringCCSetOptions[\"targetValues\"] = [];\n for (let i = 0; i < numEntries; i++) {\n const offset = 1 + i * 2;\n targetValues.push({\n parameter: raw.payload[offset],\n value: raw.payload[offset + 1],\n });\n }\n let duration: Duration | undefined;\n if (raw.payload.length >= 2 + numEntries * 2) {\n duration = Duration.parseSet(raw.payload[1 + numEntries * 2]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n targetValues,\n duration,\n });\n }\n public targetValues: {\n parameter: WindowCoveringParameter;\n value: number;\n }[];\n public duration: Duration | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const numEntries = this.targetValues.length & 0b11111;\n this.payload = new Bytes(2 + numEntries * 2);\n this.payload[0] = numEntries;\n for (let i = 0; i < numEntries; i++) {\n const offset = 1 + i * 2;\n this.payload[offset] = this.targetValues[i].parameter;\n this.payload[offset + 1] = this.targetValues[i].value;\n }\n this.payload[this.payload.length - 1] = (this.duration ?? Duration.default()).serializeSet();\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n for (const { parameter, value } of this.targetValues) {\n message[getEnumMemberName(WindowCoveringParameter, parameter)] =\n value;\n }\n if (this.duration) {\n message.duration = this.duration.toString();\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCStartLevelChangeOptions {\n parameter: WindowCoveringParameter;\n direction: keyof typeof LevelChangeDirection;\n duration?: Duration | string;\n}\n@CCCommand(WindowCoveringCommand.StartLevelChange)\n@useSupervision()\nexport class WindowCoveringCCStartLevelChange extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCStartLevelChangeOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.direction = options.direction;\n this.duration = Duration.from(options.duration);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCStartLevelChange {\n validatePayload(raw.payload.length >= 2);\n const direction = !!(raw.payload[0] & 64)\n ? \"down\"\n : \"up\";\n const parameter: WindowCoveringParameter = raw.payload[1];\n let duration: Duration | undefined;\n if (raw.payload.length >= 3) {\n duration = Duration.parseSet(raw.payload[2]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n direction,\n parameter,\n duration,\n });\n }\n public parameter: WindowCoveringParameter;\n public direction: keyof typeof LevelChangeDirection;\n public duration: Duration | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.direction === \"down\" ? 64 : 0,\n this.parameter,\n (this.duration ?? Duration.default()).serializeSet(),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),\n direction: this.direction,\n };\n if (this.duration) {\n message.duration = this.duration.toString();\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface WindowCoveringCCStopLevelChangeOptions {\n parameter: WindowCoveringParameter;\n}\n@CCCommand(WindowCoveringCommand.StopLevelChange)\n@useSupervision()\nexport class WindowCoveringCCStopLevelChange extends WindowCoveringCC {\n public constructor(options: WithAddress<WindowCoveringCCStopLevelChangeOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCStopLevelChange {\n validatePayload(raw.payload.length >= 1);\n const parameter: WindowCoveringParameter = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: WindowCoveringParameter;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.parameter]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),\n },\n };\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAqP;AACrP,oBAA6D;AAC7D,iBAAwQ;AAExQ,0BAAuH;AACvH,oCAAiI;AAEjI,mBAA2F;AAE3F,gCAAuC;AAVvC,MAAM,EAAE,sCAAsC,sCAAsC,mDAAmD,iDAAgD,IAAK;IAa/K,uBAAmB,MAAA;8BAD/B,mCAAI,2BAAe,iBAAiB,CAAC,CAAC;;;;oBACE;;;;;;2CAAA,YAAK;WAAA;;;;;;;;yBAoKzC,qCAAoC,CAAE;yBActC,qCAAoC,CAAE;sCActC,kDAAiD,CAAE;qCAYnD,iDAAgD,CAAE;AAtCnD,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAahB,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAchB,qCAAA,MAAA,MAAA,8BAAA,EAAA,MAAA,UAAA,MAAA,oBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,sBAAA,KAAA,QAAA,KAAA,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AY,QAAQ;IAC7B;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,YAAqC,IAAI,QAAQ,CAAC;AACxD,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ;OACH;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,SAAS,CAAC;AAC1C,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,eAAW,iCAAkB,sCAAyB,KAAK,SAAS;;;IAGhF;;;;",
6
6
  "names": []
7
7
  }
@@ -5,7 +5,7 @@ import type { CCAPIHost, CCAPINode, ValueIDProperties } from "./API.js";
5
5
  import { type EncapsulatingCommandClass } from "./EncapsulatingCommandClass.js";
6
6
  import { type CCValue, type DynamicCCValue, type StaticCCValue } from "./Values.js";
7
7
  import type { CCEncodingContext, CCParsingContext } from "./traits.js";
8
- import type { GetInterviewOptions } from "./traits.js";
8
+ import type { GetInterviewOptions, ReportInterviewProgress } from "./traits.js";
9
9
  export interface CommandClassOptions extends CCAddress {
10
10
  ccId?: number;
11
11
  ccCommand?: number;
@@ -13,11 +13,15 @@ export interface CommandClassOptions extends CCAddress {
13
13
  }
14
14
  export type CCEndpoint = EndpointId & SupportsCC & ControlsCC & GetCCs & ModifyCCs;
15
15
  export type CCNode = NodeId & SupportsCC & ControlsCC & GetCCs & GetEndpoint<CCEndpoint> & GetAllEndpoints<CCEndpoint> & QuerySecurityClasses & SetSecurityClass & ListenBehavior & QueryNodeStatus;
16
- export type InterviewContext = CCAPIHost<CCAPINode & GetCCs & SupportsCC & ControlsCC & QuerySecurityClasses & SetSecurityClass & GetEndpoint<EndpointId & GetCCs & SupportsCC & ControlsCC & ModifyCCs> & GetAllEndpoints<EndpointId & SupportsCC & ControlsCC>> & GetInterviewOptions & LookupManufacturer;
16
+ export type InterviewContext = CCAPIHost<CCAPINode & GetCCs & SupportsCC & ControlsCC & QuerySecurityClasses & SetSecurityClass & ReportInterviewProgress & GetEndpoint<EndpointId & GetCCs & SupportsCC & ControlsCC & ModifyCCs> & GetAllEndpoints<EndpointId & SupportsCC & ControlsCC>> & GetInterviewOptions & LookupManufacturer;
17
17
  export type RefreshValuesContext = CCAPIHost<CCAPINode & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>;
18
18
  export interface RefreshValuesOptions {
19
19
  /** The priority to use for the refresh value queries */
20
20
  priority?: MessagePriority;
21
+ /**
22
+ * An optional callback to report fine-grained progress while refreshing values.
23
+ */
24
+ onProgress?: (completed: number, total: number) => void;
21
25
  }
22
26
  export type PersistValuesContext = HostIDs & GetValueDB & GetSupportedCCVersion & GetDeviceConfig & GetNode<NodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>> & LogNode;
23
27
  export declare function getEffectiveCCVersion(ctx: GetSupportedCCVersion, cc: CCId, defaultVersion?: number): number;
@@ -179,11 +183,16 @@ export declare class CommandClass implements CCId {
179
183
  */
180
184
  getPartialCCSessionId(): Record<string, any> | undefined;
181
185
  /**
182
- * When a CC supports to be split into multiple partial CCs, this indicates that the last report hasn't been received yet.
183
- * @param _session The previously received set of messages received in this partial CC session
186
+ * When a CC supports to be split into multiple partial CCs, this returns how many
187
+ * more segments are expected after this one (e.g. the value of a "reports to follow" field).
188
+ * The counter doubles as the segment's position within the session, which is used
189
+ * to detect missing, duplicated and reordered segments.
190
+ */
191
+ getRemainingSegments(): number | undefined;
192
+ /**
193
+ * Include previously received partial responses into a final CC.
194
+ * The partials are deduplicated and ordered like they were transmitted by the node.
184
195
  */
185
- expectMoreMessages(_session: CommandClass[]): boolean;
186
- /** Include previously received partial responses into a final CC */
187
196
  mergePartialCCs(_partials: CommandClass[], _ctx: CCParsingContext): Promise<void>;
188
197
  /** Tests whether this CC expects at least one command in return */
189
198
  expectsCCResponse(ctx: GetNode<NodeId & SupportsCC>): boolean;
@@ -550,13 +550,18 @@ class CommandClass {
550
550
  return void 0;
551
551
  }
552
552
  /**
553
- * When a CC supports to be split into multiple partial CCs, this indicates that the last report hasn't been received yet.
554
- * @param _session The previously received set of messages received in this partial CC session
553
+ * When a CC supports to be split into multiple partial CCs, this returns how many
554
+ * more segments are expected after this one (e.g. the value of a "reports to follow" field).
555
+ * The counter doubles as the segment's position within the session, which is used
556
+ * to detect missing, duplicated and reordered segments.
555
557
  */
556
- expectMoreMessages(_session) {
557
- return false;
558
+ getRemainingSegments() {
559
+ return void 0;
558
560
  }
559
- /** Include previously received partial responses into a final CC */
561
+ /**
562
+ * Include previously received partial responses into a final CC.
563
+ * The partials are deduplicated and ordered like they were transmitted by the node.
564
+ */
560
565
  async mergePartialCCs(_partials, _ctx) {
561
566
  }
562
567
  /** Tests whether this CC expects at least one command in return */