@zwave-js/cc 15.25.2 → 15.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +10 -14
  2. package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
  3. package/build/cjs/cc/AssociationCC.d.ts +1 -1
  4. package/build/cjs/cc/AssociationCC.js.map +1 -1
  5. package/build/cjs/cc/AssociationGroupInfoCC.js +16 -16
  6. package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
  7. package/build/cjs/cc/BarrierOperatorCC.js +4 -4
  8. package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
  9. package/build/cjs/cc/BinarySensorCC.js +3 -3
  10. package/build/cjs/cc/BinarySensorCC.js.map +2 -2
  11. package/build/cjs/cc/CentralSceneCC.js +7 -6
  12. package/build/cjs/cc/CentralSceneCC.js.map +2 -2
  13. package/build/cjs/cc/ColorSwitchCC.js +4 -4
  14. package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
  15. package/build/cjs/cc/ConfigurationCC.js +22 -25
  16. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  17. package/build/cjs/cc/DoorLockCC.js +44 -60
  18. package/build/cjs/cc/DoorLockCC.js.map +2 -2
  19. package/build/cjs/cc/HumidityControlModeCC.js +4 -5
  20. package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
  21. package/build/cjs/cc/HumidityControlSetpointCC.js +14 -14
  22. package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
  23. package/build/cjs/cc/IrrigationCC.js +21 -25
  24. package/build/cjs/cc/IrrigationCC.js.map +2 -2
  25. package/build/cjs/cc/MeterCC.js +9 -10
  26. package/build/cjs/cc/MeterCC.js.map +2 -2
  27. package/build/cjs/cc/MultiChannelCC.d.ts +1 -1
  28. package/build/cjs/cc/MultiChannelCC.js +17 -21
  29. package/build/cjs/cc/MultiChannelCC.js.map +2 -2
  30. package/build/cjs/cc/MultilevelSensorCC.js +8 -6
  31. package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
  32. package/build/cjs/cc/NotificationCC.js +4 -8
  33. package/build/cjs/cc/NotificationCC.js.map +2 -2
  34. package/build/cjs/cc/ProtectionCC.js +11 -12
  35. package/build/cjs/cc/ProtectionCC.js.map +2 -2
  36. package/build/cjs/cc/Security2CC.js +12 -22
  37. package/build/cjs/cc/Security2CC.js.map +2 -2
  38. package/build/cjs/cc/SecurityCC.js +8 -16
  39. package/build/cjs/cc/SecurityCC.js.map +2 -2
  40. package/build/cjs/cc/ThermostatFanModeCC.js +4 -4
  41. package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
  42. package/build/cjs/cc/ThermostatModeCC.js +4 -4
  43. package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
  44. package/build/cjs/cc/ThermostatOperatingStateCC.js +1 -2
  45. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
  46. package/build/cjs/cc/ThermostatSetpointCC.js +4 -3
  47. package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
  48. package/build/cjs/cc/UserCodeCC.js +2 -4
  49. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  50. package/build/cjs/cc/UserCredentialCC.js +29 -1
  51. package/build/cjs/cc/UserCredentialCC.js.map +2 -2
  52. package/build/cjs/cc/WindowCoveringCC.js +5 -5
  53. package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
  54. package/build/cjs/cc/_CCValues.generated.d.ts +4 -4
  55. package/build/cjs/cc/_CCValues.generated.js +2 -2
  56. package/build/cjs/cc/_CCValues.generated.js.map +1 -1
  57. package/build/cjs/cc/index.d.ts +3 -3
  58. package/build/cjs/cc/index.js.map +2 -2
  59. package/build/cjs/lib/CommandClass.d.ts +3 -1
  60. package/build/cjs/lib/CommandClass.js +25 -3
  61. package/build/cjs/lib/CommandClass.js.map +2 -2
  62. package/build/cjs/lib/Security2/Extension.d.ts +6 -4
  63. package/build/cjs/lib/Security2/Extension.js +22 -20
  64. package/build/cjs/lib/Security2/Extension.js.map +2 -2
  65. package/build/cjs/lib/_Types.js.map +1 -1
  66. package/build/cjs/lib/utils.js +14 -8
  67. package/build/cjs/lib/utils.js.map +2 -2
  68. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  69. package/build/esm/cc/AlarmSensorCC.js +11 -17
  70. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  71. package/build/esm/cc/AssociationCC.d.ts +1 -1
  72. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  73. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  74. package/build/esm/cc/AssociationGroupInfoCC.js +18 -21
  75. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  76. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  77. package/build/esm/cc/BarrierOperatorCC.js +5 -7
  78. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  79. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  80. package/build/esm/cc/BinarySensorCC.js +4 -6
  81. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  82. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  83. package/build/esm/cc/CentralSceneCC.js +8 -8
  84. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  85. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  86. package/build/esm/cc/ColorSwitchCC.js +5 -7
  87. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  88. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  89. package/build/esm/cc/ConfigurationCC.js +29 -29
  90. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  91. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  92. package/build/esm/cc/DoorLockCC.js +70 -73
  93. package/build/esm/cc/DoorLockCC.js.map +1 -1
  94. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  95. package/build/esm/cc/HumidityControlModeCC.js +5 -8
  96. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  97. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  98. package/build/esm/cc/HumidityControlSetpointCC.js +15 -22
  99. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  100. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  101. package/build/esm/cc/IrrigationCC.js +26 -24
  102. package/build/esm/cc/IrrigationCC.js.map +1 -1
  103. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  104. package/build/esm/cc/MeterCC.js +12 -18
  105. package/build/esm/cc/MeterCC.js.map +1 -1
  106. package/build/esm/cc/MultiChannelCC.d.ts +1 -1
  107. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  108. package/build/esm/cc/MultiChannelCC.js +18 -23
  109. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  110. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  111. package/build/esm/cc/MultilevelSensorCC.js +11 -19
  112. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  113. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  114. package/build/esm/cc/NotificationCC.js +6 -13
  115. package/build/esm/cc/NotificationCC.js.map +1 -1
  116. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  117. package/build/esm/cc/ProtectionCC.js +12 -21
  118. package/build/esm/cc/ProtectionCC.js.map +1 -1
  119. package/build/esm/cc/Security2CC.d.ts.map +1 -1
  120. package/build/esm/cc/Security2CC.js +13 -31
  121. package/build/esm/cc/Security2CC.js.map +1 -1
  122. package/build/esm/cc/SecurityCC.d.ts.map +1 -1
  123. package/build/esm/cc/SecurityCC.js +9 -21
  124. package/build/esm/cc/SecurityCC.js.map +1 -1
  125. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  126. package/build/esm/cc/ThermostatFanModeCC.js +5 -7
  127. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  128. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  129. package/build/esm/cc/ThermostatModeCC.js +5 -7
  130. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  131. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  132. package/build/esm/cc/ThermostatOperatingStateCC.js +2 -4
  133. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  134. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  135. package/build/esm/cc/ThermostatSetpointCC.js +5 -9
  136. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  137. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  138. package/build/esm/cc/UserCodeCC.js +3 -7
  139. package/build/esm/cc/UserCodeCC.js.map +1 -1
  140. package/build/esm/cc/UserCredentialCC.d.ts.map +1 -1
  141. package/build/esm/cc/UserCredentialCC.js +44 -1
  142. package/build/esm/cc/UserCredentialCC.js.map +1 -1
  143. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  144. package/build/esm/cc/WindowCoveringCC.js +6 -9
  145. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  146. package/build/esm/cc/_CCValues.generated.d.ts +4 -4
  147. package/build/esm/cc/_CCValues.generated.js +2 -2
  148. package/build/esm/cc/_CCValues.generated.js.map +1 -1
  149. package/build/esm/cc/index.d.ts +3 -3
  150. package/build/esm/cc/index.d.ts.map +1 -1
  151. package/build/esm/cc/index.js.map +1 -1
  152. package/build/esm/lib/CommandClass.d.ts +3 -1
  153. package/build/esm/lib/CommandClass.d.ts.map +1 -1
  154. package/build/esm/lib/CommandClass.js +30 -4
  155. package/build/esm/lib/CommandClass.js.map +1 -1
  156. package/build/esm/lib/Security2/Extension.d.ts +6 -4
  157. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  158. package/build/esm/lib/Security2/Extension.js +23 -21
  159. package/build/esm/lib/Security2/Extension.js.map +1 -1
  160. package/build/esm/lib/_Types.js +1 -1
  161. package/build/esm/lib/utils.d.ts.map +1 -1
  162. package/build/esm/lib/utils.js +15 -9
  163. package/build/esm/lib/utils.js.map +1 -1
  164. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/ProtectionCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./ProtectionCC._validateArgs.js\";\nconst { validateArgs_ProtectionCCAPI_set, validateArgs_ProtectionCCAPI_setExclusiveControl, validateArgs_ProtectionCCAPI_setTimeout } = __validateArgs;\nimport { CommandClasses, type GetValueDB, MAX_NODES, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, Timeout, type ValueID, ValueMetadata, type WithAddress, encodeBitMask, enumValuesToMetadataStates, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { LocalProtectionState, ProtectionCommand, RFProtectionState, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { ProtectionCCValues } from \"./_CCValues.generated.js\";\nexport { ProtectionCCValues };\n@API(CommandClasses.Protection)\nexport class ProtectionCCAPI extends CCAPI {\n public supportsCommand(cmd: ProtectionCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ProtectionCommand.Get:\n return this.isSinglecast();\n case ProtectionCommand.Set:\n return true; // This is mandatory\n case ProtectionCommand.SupportedGet:\n return this.version >= 2 && this.isSinglecast();\n case ProtectionCommand.TimeoutGet:\n case ProtectionCommand.TimeoutSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));\n }\n case ProtectionCommand.ExclusiveControlGet:\n case ProtectionCommand.ExclusiveControlSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));\n }\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ProtectionCCAPI, { property }, value) {\n const valueDB = this.tryGetValueDB();\n if (property === \"local\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const rf = valueDB?.getValue<RFProtectionState>(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));\n return this.set(value, rf);\n }\n else if (property === \"rf\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const local = valueDB?.getValue<LocalProtectionState>(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));\n return this.set(local ?? LocalProtectionState.Unprotected, value);\n }\n else if (property === \"exclusiveControlNodeId\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n return this.setExclusiveControl(value);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ProtectionCCAPI, { property }) {\n switch (property) {\n case \"local\":\n case \"rf\":\n return (await this.get())?.[property];\n case \"exclusiveControlNodeId\":\n return this.getExclusiveControl();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property }, value) => {\n if ((property === \"local\"\n && typeof value === \"number\")\n || (property === \"rf\" && typeof value === \"number\")) {\n return {\n forceVerifyChanges: () => true,\n verifyChanges: () => {\n if (this.isSinglecast()) {\n this.schedulePoll({ property }, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n };\n public override isSetValueOptimistic(_valueId: ValueID): boolean {\n // Protection changes may be rejected depending on the node's current\n // exclusive/RF protection state, so we always read the state back.\n return false;\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);\n const cc = new ProtectionCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"local\", \"rf\"]);\n }\n }\n @validateArgs_ProtectionCCAPI_set()\n public async set(local: LocalProtectionState, rf?: RFProtectionState): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);\n const cc = new ProtectionCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n local,\n rf,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getSupported() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);\n const cc = new ProtectionCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsExclusiveControl\",\n \"supportsTimeout\",\n \"supportedLocalStates\",\n \"supportedRFStates\",\n ]);\n }\n }\n public async getExclusiveControl(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);\n const cc = new ProtectionCCExclusiveControlGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCExclusiveControlReport>(cc, this.commandOptions);\n return response?.exclusiveControlNodeId;\n }\n @validateArgs_ProtectionCCAPI_setExclusiveControl()\n public async setExclusiveControl(nodeId: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);\n const cc = new ProtectionCCExclusiveControlSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n exclusiveControlNodeId: nodeId,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getTimeout(): Promise<MaybeNotKnown<Timeout>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);\n const cc = new ProtectionCCTimeoutGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCTimeoutReport>(cc, this.commandOptions);\n return response?.timeout;\n }\n @validateArgs_ProtectionCCAPI_setTimeout()\n public async setTimeout(timeout: Timeout): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);\n const cc = new ProtectionCCTimeoutSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n timeout,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses.Protection)\n@implementedVersion(2)\n@ccValues(ProtectionCCValues)\nexport class ProtectionCC extends CommandClass {\n declare ccCommand: ProtectionCommand;\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.Protection, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // We need to do some queries after a potential timeout\n // In this case, do now mark this CC as interviewed completely\n let hadCriticalTimeout = false;\n // First find out what the device supports\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n message: \"querying protection capabilities...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupported();\n if (resp) {\n const logMessage = `received protection capabilities:\nexclusive control: ${resp.supportsExclusiveControl}\ntimeout: ${resp.supportsTimeout}\nlocal protection states: ${resp.supportedLocalStates\n .map((local) => getEnumMemberName(LocalProtectionState, local))\n .map((str) => `\\n\u00B7 ${str}`)\n .join(\"\")}\nRF protection states: ${resp.supportedRFStates\n .map((local) => getEnumMemberName(RFProtectionState, local))\n .map((str) => `\\n\u00B7 ${str}`)\n .join(\"\")}`;\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n else {\n hadCriticalTimeout = true;\n }\n }\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n if (!hadCriticalTimeout)\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.Protection, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);\n const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);\n // Query the current state\n ctx.logNode(node.id, {\n message: \"querying protection status...\",\n direction: \"outbound\",\n });\n const protectionResp = await api.get();\n if (protectionResp) {\n let logMessage = `received protection status:\nlocal: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;\n if (protectionResp.rf != undefined) {\n logMessage += `\nrf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;\n }\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n if (supportsTimeout) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying protection timeout...\",\n direction: \"outbound\",\n });\n const timeout = await api.getTimeout();\n if (timeout) {\n ctx.logNode(node.id, {\n message: `received timeout: ${timeout.toString()}`,\n direction: \"inbound\",\n });\n }\n }\n if (supportsExclusiveControl) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying exclusive control node...\",\n direction: \"outbound\",\n });\n const nodeId = await api.getExclusiveControl();\n if (nodeId != undefined) {\n ctx.logNode(node.id, {\n message: (nodeId !== 0\n ? `Node ${nodeId.toString().padStart(3, \"0\")}`\n : `no node`) + ` has exclusive control`,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface ProtectionCCSetOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Set)\n@useSupervision()\nexport class ProtectionCCSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSetOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSet {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public local: LocalProtectionState;\n public rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.local & 0b1111,\n (this.rf ?? RFProtectionState.Unprotected) & 0b1111,\n ]);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId as number)?.compat?.encodeCCsUsingTargetVersion) {\n // When forcing CC version 1, only include the local state\n this.payload = this.payload.subarray(0, 1);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCReportOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Report)\n@ccValueProperty(\"local\", ProtectionCCValues.localProtectionState)\n@ccValueProperty(\"rf\", ProtectionCCValues.rfProtectionState)\nexport class ProtectionCCReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCReportOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCReport {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public readonly local: LocalProtectionState;\n public readonly rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = this.rf !== undefined\n ? Bytes.from([this.local & 0b1111, this.rf & 0b1111])\n : Bytes.from([this.local & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ProtectionCommand.Get)\n@expectedCCResponse(ProtectionCCReport)\nexport class ProtectionCCGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCSupportedReportOptions {\n supportsTimeout: boolean;\n supportsExclusiveControl: boolean;\n supportedLocalStates: LocalProtectionState[];\n supportedRFStates: RFProtectionState[];\n}\n@CCCommand(ProtectionCommand.SupportedReport)\n@ccValueProperty(\"supportsExclusiveControl\", ProtectionCCValues.supportsExclusiveControl)\n@ccValueProperty(\"supportsTimeout\", ProtectionCCValues.supportsTimeout)\n@ccValueProperty(\"supportedLocalStates\", ProtectionCCValues.supportedLocalStates)\n@ccValueProperty(\"supportedRFStates\", ProtectionCCValues.supportedRFStates)\nexport class ProtectionCCSupportedReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSupportedReportOptions>) {\n super(options);\n this.supportsTimeout = options.supportsTimeout;\n this.supportsExclusiveControl = options.supportsExclusiveControl;\n this.supportedLocalStates = options.supportedLocalStates;\n this.supportedRFStates = options.supportedRFStates;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSupportedReport {\n validatePayload(raw.payload.length >= 5);\n const supportsTimeout = !!(raw.payload[0] & 0b1);\n const supportsExclusiveControl = !!(raw.payload[0] & 0b10);\n const supportedLocalStates: LocalProtectionState[] = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);\n const supportedRFStates: RFProtectionState[] = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsTimeout,\n supportsExclusiveControl,\n supportedLocalStates,\n supportedRFStates,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // update metadata (partially) for the local and rf values\n const localStateValue = ProtectionCCValues.localProtectionState;\n this.setMetadata(ctx, localStateValue, {\n ...localStateValue.meta,\n states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),\n });\n const rfStateValue = ProtectionCCValues.rfProtectionState;\n this.setMetadata(ctx, rfStateValue, {\n ...rfStateValue.meta,\n states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),\n });\n return true;\n }\n public readonly supportsExclusiveControl: boolean;\n public readonly supportsTimeout: boolean;\n public readonly supportedLocalStates: LocalProtectionState[];\n public readonly supportedRFStates: RFProtectionState[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const flags = (this.supportsTimeout ? 0b1 : 0)\n | (this.supportsExclusiveControl ? 0b10 : 0);\n this.payload = Bytes.concat([\n [flags],\n encodeBitMask(this.supportedLocalStates, 15, LocalProtectionState.Unprotected),\n encodeBitMask(this.supportedRFStates, 15, RFProtectionState.Unprotected),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports exclusive control\": this.supportsExclusiveControl,\n \"supports timeout\": this.supportsTimeout,\n \"local protection states\": this.supportedLocalStates\n .map((local) => getEnumMemberName(LocalProtectionState, local))\n .map((str) => `\\n\u00B7 ${str}`)\n .join(\"\"),\n \"RF protection states\": this.supportedRFStates\n .map((rf) => getEnumMemberName(RFProtectionState, rf))\n .map((str) => `\\n\u00B7 ${str}`)\n .join(\"\"),\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.SupportedGet)\n@expectedCCResponse(ProtectionCCSupportedReport)\nexport class ProtectionCCSupportedGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlReportOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlReport)\n@ccValueProperty(\"exclusiveControlNodeId\", ProtectionCCValues.exclusiveControlNodeId)\nexport class ProtectionCCExclusiveControlReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlReportOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlReport {\n validatePayload(raw.payload.length >= 1);\n const exclusiveControlNodeId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId,\n });\n }\n public readonly exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.ExclusiveControlGet)\n@expectedCCResponse(ProtectionCCExclusiveControlReport)\nexport class ProtectionCCExclusiveControlGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlSetOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCExclusiveControlSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlSetOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId: raw.payload[0],\n });\n }\n public exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutReportOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutReport)\n@ccValueProperty(\"timeout\", ProtectionCCValues.timeout)\nexport class ProtectionCCTimeoutReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutReportOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutReport {\n validatePayload(raw.payload.length >= 1);\n const timeout: Timeout = Timeout.parse(raw.payload[0]);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout,\n });\n }\n public readonly timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n@CCCommand(ProtectionCommand.TimeoutGet)\n@expectedCCResponse(ProtectionCCTimeoutReport)\nexport class ProtectionCCTimeoutGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutSetOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCTimeoutSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutSetOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout: Timeout.parse(raw.payload[0]),\n });\n }\n public timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAyS;AACzS,oBAA+C;AAC/C,iBAAkN;AAClN,0BAAyK;AACzK,oCAAiI;AAEjI,mBAA4E;AAE5E,gCAAmC;AATnC,MAAM,EAAE,kCAAkC,kDAAkD,wCAAuC,IAAK;IAY3H,mBAAe,MAAA;8BAD3B,mCAAI,2BAAe,UAAU,CAAC;;;;oBACM;;;;;uCAAA,YAAK;WAAA;;;;;;;;yBAkGrC,iCAAgC,CAAE;yCAqClC,iDAAgD,CAAE;gCAmBlD,wCAAuC,CAAE;AAvD1C,qCAA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;;;oBAC2B;8CAAA,YAAY;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;;IACT,YAAmB,SAAmD;AAClE,YAAM,OAAO;AACb,WAAK,UAAU,QAAQ;IAC3B;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ,SAAS,oBAAQ,MAAM,IAAI,QAAQ,CAAC,CAAC;OACxC;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,QAAQ,UAAS,CAAE,CAAC;AACpD,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,SAAS,KAAK,QAAQ,SAAQ,EAAE;;IAEnD;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./ProtectionCC._validateArgs.js\";\nconst { validateArgs_ProtectionCCAPI_set, validateArgs_ProtectionCCAPI_setExclusiveControl, validateArgs_ProtectionCCAPI_setTimeout } = __validateArgs;\nimport { CommandClasses, type GetValueDB, MAX_NODES, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, Timeout, type ValueID, ValueMetadata, type WithAddress, encodeBitMask, enumValuesToMetadataStates, getNodeTag, logDict, logList, logText, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { LocalProtectionState, ProtectionCommand, RFProtectionState, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { ProtectionCCValues } from \"./_CCValues.generated.js\";\nexport { ProtectionCCValues };\n@API(CommandClasses.Protection)\nexport class ProtectionCCAPI extends CCAPI {\n public supportsCommand(cmd: ProtectionCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ProtectionCommand.Get:\n return this.isSinglecast();\n case ProtectionCommand.Set:\n return true; // This is mandatory\n case ProtectionCommand.SupportedGet:\n return this.version >= 2 && this.isSinglecast();\n case ProtectionCommand.TimeoutGet:\n case ProtectionCommand.TimeoutSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));\n }\n case ProtectionCommand.ExclusiveControlGet:\n case ProtectionCommand.ExclusiveControlSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));\n }\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ProtectionCCAPI, { property }, value) {\n const valueDB = this.tryGetValueDB();\n if (property === \"local\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const rf = valueDB?.getValue<RFProtectionState>(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));\n return this.set(value, rf);\n }\n else if (property === \"rf\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const local = valueDB?.getValue<LocalProtectionState>(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));\n return this.set(local ?? LocalProtectionState.Unprotected, value);\n }\n else if (property === \"exclusiveControlNodeId\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n return this.setExclusiveControl(value);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ProtectionCCAPI, { property }) {\n switch (property) {\n case \"local\":\n case \"rf\":\n return (await this.get())?.[property];\n case \"exclusiveControlNodeId\":\n return this.getExclusiveControl();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property }, value) => {\n if ((property === \"local\"\n && typeof value === \"number\")\n || (property === \"rf\" && typeof value === \"number\")) {\n return {\n forceVerifyChanges: () => true,\n verifyChanges: () => {\n if (this.isSinglecast()) {\n this.schedulePoll({ property }, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n };\n public override isSetValueOptimistic(_valueId: ValueID): boolean {\n // Protection changes may be rejected depending on the node's current\n // exclusive/RF protection state, so we always read the state back.\n return false;\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);\n const cc = new ProtectionCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"local\", \"rf\"]);\n }\n }\n @validateArgs_ProtectionCCAPI_set()\n public async set(local: LocalProtectionState, rf?: RFProtectionState): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);\n const cc = new ProtectionCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n local,\n rf,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getSupported() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);\n const cc = new ProtectionCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsExclusiveControl\",\n \"supportsTimeout\",\n \"supportedLocalStates\",\n \"supportedRFStates\",\n ]);\n }\n }\n public async getExclusiveControl(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);\n const cc = new ProtectionCCExclusiveControlGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCExclusiveControlReport>(cc, this.commandOptions);\n return response?.exclusiveControlNodeId;\n }\n @validateArgs_ProtectionCCAPI_setExclusiveControl()\n public async setExclusiveControl(nodeId: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);\n const cc = new ProtectionCCExclusiveControlSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n exclusiveControlNodeId: nodeId,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getTimeout(): Promise<MaybeNotKnown<Timeout>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);\n const cc = new ProtectionCCTimeoutGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCTimeoutReport>(cc, this.commandOptions);\n return response?.timeout;\n }\n @validateArgs_ProtectionCCAPI_setTimeout()\n public async setTimeout(timeout: Timeout): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);\n const cc = new ProtectionCCTimeoutSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n timeout,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses.Protection)\n@implementedVersion(2)\n@ccValues(ProtectionCCValues)\nexport class ProtectionCC extends CommandClass {\n declare ccCommand: ProtectionCommand;\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.Protection, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // We need to do some queries after a potential timeout\n // In this case, do now mark this CC as interviewed completely\n let hadCriticalTimeout = false;\n // First find out what the device supports\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n message: \"querying protection capabilities...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupported();\n if (resp) {\n const logMessage = logText(\"received protection capabilities:\", {\n nested: logDict({\n \"exclusive control\": resp.supportsExclusiveControl,\n timeout: resp.supportsTimeout,\n \"local protection states\": logList(resp.supportedLocalStates.map((local) => getEnumMemberName(LocalProtectionState, local))),\n \"RF protection states\": logList(resp.supportedRFStates.map((local) => getEnumMemberName(RFProtectionState, local))),\n }),\n });\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n else {\n hadCriticalTimeout = true;\n }\n }\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n if (!hadCriticalTimeout)\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.Protection, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);\n const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);\n // Query the current state\n ctx.logNode(node.id, {\n message: \"querying protection status...\",\n direction: \"outbound\",\n });\n const protectionResp = await api.get();\n if (protectionResp) {\n let logMessage = `received protection status:\nlocal: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;\n if (protectionResp.rf != undefined) {\n logMessage += `\nrf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;\n }\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n if (supportsTimeout) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying protection timeout...\",\n direction: \"outbound\",\n });\n const timeout = await api.getTimeout();\n if (timeout) {\n ctx.logNode(node.id, {\n message: `received timeout: ${timeout.toString()}`,\n direction: \"inbound\",\n });\n }\n }\n if (supportsExclusiveControl) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying exclusive control node...\",\n direction: \"outbound\",\n });\n const nodeId = await api.getExclusiveControl();\n if (nodeId != undefined) {\n ctx.logNode(node.id, {\n message: (nodeId !== 0\n ? getNodeTag(nodeId)\n : `no node`) + ` has exclusive control`,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface ProtectionCCSetOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Set)\n@useSupervision()\nexport class ProtectionCCSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSetOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSet {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public local: LocalProtectionState;\n public rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.local & 0b1111,\n (this.rf ?? RFProtectionState.Unprotected) & 0b1111,\n ]);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId as number)?.compat?.encodeCCsUsingTargetVersion) {\n // When forcing CC version 1, only include the local state\n this.payload = this.payload.subarray(0, 1);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCReportOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Report)\n@ccValueProperty(\"local\", ProtectionCCValues.localProtectionState)\n@ccValueProperty(\"rf\", ProtectionCCValues.rfProtectionState)\nexport class ProtectionCCReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCReportOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCReport {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public readonly local: LocalProtectionState;\n public readonly rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = this.rf !== undefined\n ? Bytes.from([this.local & 0b1111, this.rf & 0b1111])\n : Bytes.from([this.local & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ProtectionCommand.Get)\n@expectedCCResponse(ProtectionCCReport)\nexport class ProtectionCCGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCSupportedReportOptions {\n supportsTimeout: boolean;\n supportsExclusiveControl: boolean;\n supportedLocalStates: LocalProtectionState[];\n supportedRFStates: RFProtectionState[];\n}\n@CCCommand(ProtectionCommand.SupportedReport)\n@ccValueProperty(\"supportsExclusiveControl\", ProtectionCCValues.supportsExclusiveControl)\n@ccValueProperty(\"supportsTimeout\", ProtectionCCValues.supportsTimeout)\n@ccValueProperty(\"supportedLocalStates\", ProtectionCCValues.supportedLocalStates)\n@ccValueProperty(\"supportedRFStates\", ProtectionCCValues.supportedRFStates)\nexport class ProtectionCCSupportedReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSupportedReportOptions>) {\n super(options);\n this.supportsTimeout = options.supportsTimeout;\n this.supportsExclusiveControl = options.supportsExclusiveControl;\n this.supportedLocalStates = options.supportedLocalStates;\n this.supportedRFStates = options.supportedRFStates;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSupportedReport {\n validatePayload(raw.payload.length >= 5);\n const supportsTimeout = !!(raw.payload[0] & 0b1);\n const supportsExclusiveControl = !!(raw.payload[0] & 0b10);\n const supportedLocalStates: LocalProtectionState[] = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);\n const supportedRFStates: RFProtectionState[] = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsTimeout,\n supportsExclusiveControl,\n supportedLocalStates,\n supportedRFStates,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // update metadata (partially) for the local and rf values\n const localStateValue = ProtectionCCValues.localProtectionState;\n this.setMetadata(ctx, localStateValue, {\n ...localStateValue.meta,\n states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),\n });\n const rfStateValue = ProtectionCCValues.rfProtectionState;\n this.setMetadata(ctx, rfStateValue, {\n ...rfStateValue.meta,\n states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),\n });\n return true;\n }\n public readonly supportsExclusiveControl: boolean;\n public readonly supportsTimeout: boolean;\n public readonly supportedLocalStates: LocalProtectionState[];\n public readonly supportedRFStates: RFProtectionState[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const flags = (this.supportsTimeout ? 0b1 : 0)\n | (this.supportsExclusiveControl ? 0b10 : 0);\n this.payload = Bytes.concat([\n [flags],\n encodeBitMask(this.supportedLocalStates, 15, LocalProtectionState.Unprotected),\n encodeBitMask(this.supportedRFStates, 15, RFProtectionState.Unprotected),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports exclusive control\": this.supportsExclusiveControl,\n \"supports timeout\": this.supportsTimeout,\n \"local protection states\": logList(this.supportedLocalStates.map((local) => getEnumMemberName(LocalProtectionState, local))),\n \"RF protection states\": logList(this.supportedRFStates.map((rf) => getEnumMemberName(RFProtectionState, rf))),\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.SupportedGet)\n@expectedCCResponse(ProtectionCCSupportedReport)\nexport class ProtectionCCSupportedGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlReportOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlReport)\n@ccValueProperty(\"exclusiveControlNodeId\", ProtectionCCValues.exclusiveControlNodeId)\nexport class ProtectionCCExclusiveControlReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlReportOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlReport {\n validatePayload(raw.payload.length >= 1);\n const exclusiveControlNodeId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId,\n });\n }\n public readonly exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.ExclusiveControlGet)\n@expectedCCResponse(ProtectionCCExclusiveControlReport)\nexport class ProtectionCCExclusiveControlGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlSetOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCExclusiveControlSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlSetOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId: raw.payload[0],\n });\n }\n public exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutReportOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutReport)\n@ccValueProperty(\"timeout\", ProtectionCCValues.timeout)\nexport class ProtectionCCTimeoutReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutReportOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutReport {\n validatePayload(raw.payload.length >= 1);\n const timeout: Timeout = Timeout.parse(raw.payload[0]);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout,\n });\n }\n public readonly timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n@CCCommand(ProtectionCommand.TimeoutGet)\n@expectedCCResponse(ProtectionCCTimeoutReport)\nexport class ProtectionCCTimeoutGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutSetOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCTimeoutSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutSetOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout: Timeout.parse(raw.payload[0]),\n });\n }\n public timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n"],
5
+ "mappings": ";;;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,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;IASA,0BAAsB,MAAA;8BAHlC,yCAAU,+BAAkB,UAAU,OACtC,kDAAmB,kBAAkB,OACrC,8CAAc,CAAE;;;;oBAC2B;8CAAA,YAAY;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;;IACT,YAAmB,SAAmD;AAClE,YAAM,OAAO;AACb,WAAK,UAAU,QAAQ;IAC3B;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ,SAAS,oBAAQ,MAAM,IAAI,QAAQ,CAAC,CAAC;OACxC;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,QAAQ,UAAS,CAAE,CAAC;AACpD,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,SAAS,KAAK,QAAQ,SAAQ,EAAE;;IAEnD;;;;",
6
6
  "names": []
7
7
  }
@@ -704,16 +704,14 @@ let Security2CC = (() => {
704
704
  }
705
705
  if (!hasReceivedSecureCommands && supportedCCs.length > 0) {
706
706
  hasReceivedSecureCommands = true;
707
- const logLines = [
708
- `received secure commands (${(0, import_shared.getEnumMemberName)(import_core.SecurityClass, secClass2)})`,
709
- "supported CCs:"
710
- ];
711
- for (const cc of supportedCCs) {
712
- logLines.push(`\xB7 ${(0, import_core.getCCName)(cc)}`);
713
- }
714
707
  ctx.logNode(node.id, {
715
708
  endpoint: endpoint.index,
716
- message: logLines.join("\n"),
709
+ message: (0, import_core.logText)([
710
+ `received secure commands (${(0, import_shared.getEnumMemberName)(import_core.SecurityClass, secClass2)})`,
711
+ "supported CCs:"
712
+ ], {
713
+ nested: (0, import_core.logList)(supportedCCs.map((cc) => (0, import_core.getCCName)(cc)))
714
+ }),
717
715
  direction: "inbound"
718
716
  });
719
717
  for (const cc of supportedCCs) {
@@ -1129,9 +1127,6 @@ let Security2CCMessageEncapsulation = (() => {
1129
1127
  const message = {
1130
1128
  "sequence number": this.sequenceNumber ?? "(not set)"
1131
1129
  };
1132
- if (this.extensions.length > 0) {
1133
- message.extensions = this.extensions.map((e) => e.toLogEntry()).join("");
1134
- }
1135
1130
  if (process.env.NODE_ENV === "test" || process.env.NODE_ENV === "development") {
1136
1131
  if (this.key) {
1137
1132
  message.key = (0, import_shared.buffer2hex)(this.key);
@@ -1156,7 +1151,7 @@ let Security2CCMessageEncapsulation = (() => {
1156
1151
  }
1157
1152
  return {
1158
1153
  ...super.toLogEntry(ctx),
1159
- message
1154
+ message: (0, import_core.logDict)(message, this.extensions.map((e) => e.toLogEntry()))
1160
1155
  };
1161
1156
  }
1162
1157
  };
@@ -1386,13 +1381,10 @@ let Security2CCKEXReport = (() => {
1386
1381
  ...super.toLogEntry(ctx),
1387
1382
  message: {
1388
1383
  echo: this.echo,
1389
- "supported schemes": this.supportedKEXSchemes.map((s) => `
1390
- \xB7 ${(0, import_shared.getEnumMemberName)(import_shared2.KEXSchemes, s)}`).join(""),
1391
- "supported ECDH profiles": this.supportedECDHProfiles.map((s) => `
1392
- \xB7 ${(0, import_shared.getEnumMemberName)(import_shared2.ECDHProfiles, s)}`).join(""),
1384
+ "supported schemes": (0, import_core.logList)(this.supportedKEXSchemes.map((s) => (0, import_shared.getEnumMemberName)(import_shared2.KEXSchemes, s))),
1385
+ "supported ECDH profiles": (0, import_core.logList)(this.supportedECDHProfiles.map((s) => (0, import_shared.getEnumMemberName)(import_shared2.ECDHProfiles, s))),
1393
1386
  "CSA requested": this.requestCSA,
1394
- "requested security classes": this.requestedKeys.map((s) => `
1395
- \xB7 ${(0, import_shared.getEnumMemberName)(import_core.SecurityClass, s)}`).join("")
1387
+ "requested security classes": (0, import_core.logList)(this.requestedKeys.map((s) => (0, import_shared.getEnumMemberName)(import_core.SecurityClass, s)))
1396
1388
  }
1397
1389
  };
1398
1390
  }
@@ -1518,8 +1510,7 @@ let Security2CCKEXSet = (() => {
1518
1510
  "selected scheme": (0, import_shared.getEnumMemberName)(import_shared2.KEXSchemes, this.selectedKEXScheme),
1519
1511
  "selected ECDH profile": (0, import_shared.getEnumMemberName)(import_shared2.ECDHProfiles, this.selectedECDHProfile),
1520
1512
  "CSA permitted": this.permitCSA,
1521
- "granted security classes": this.grantedKeys.map((s) => `
1522
- \xB7 ${(0, import_shared.getEnumMemberName)(import_core.SecurityClass, s)}`).join("")
1513
+ "granted security classes": (0, import_core.logList)(this.grantedKeys.map((s) => (0, import_shared.getEnumMemberName)(import_core.SecurityClass, s)))
1523
1514
  }
1524
1515
  };
1525
1516
  }
@@ -1852,8 +1843,7 @@ let Security2CCCommandsSupportedReport = (() => {
1852
1843
  return {
1853
1844
  ...super.toLogEntry(ctx),
1854
1845
  message: {
1855
- "supported CCs": this.supportedCCs.map((cc) => (0, import_core.getCCName)(cc)).map((cc) => `
1856
- \xB7 ${cc}`).join("")
1846
+ "supported CCs": (0, import_core.logList)(this.supportedCCs.map((cc) => (0, import_core.getCCName)(cc)))
1857
1847
  }
1858
1848
  };
1859
1849
  }