@zwave-js/cc 15.16.0 → 15.17.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 (246) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +1 -1
  2. package/build/cjs/cc/AlarmSensorCC.js.map +1 -1
  3. package/build/cjs/cc/ApplicationStatusCC.d.ts +33 -0
  4. package/build/cjs/cc/ApplicationStatusCC.js +229 -0
  5. package/build/cjs/cc/ApplicationStatusCC.js.map +7 -0
  6. package/build/cjs/cc/AssociationCC.js.map +1 -1
  7. package/build/cjs/cc/AssociationGroupInfoCC.js +4 -4
  8. package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
  9. package/build/cjs/cc/BarrierOperatorCC.js +9 -2
  10. package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
  11. package/build/cjs/cc/BasicCC.js +1 -1
  12. package/build/cjs/cc/BasicCC.js.map +1 -1
  13. package/build/cjs/cc/BatteryCC.js +2 -2
  14. package/build/cjs/cc/BatteryCC.js.map +1 -1
  15. package/build/cjs/cc/BinarySwitchCC.js +1 -1
  16. package/build/cjs/cc/BinarySwitchCC.js.map +1 -1
  17. package/build/cjs/cc/CRC16CC.js +2 -2
  18. package/build/cjs/cc/CRC16CC.js.map +2 -2
  19. package/build/cjs/cc/CentralSceneCC.js +2 -2
  20. package/build/cjs/cc/CentralSceneCC.js.map +1 -1
  21. package/build/cjs/cc/ClimateControlScheduleCC.js +5 -5
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
  23. package/build/cjs/cc/ClockCC.js +1 -1
  24. package/build/cjs/cc/ClockCC.js.map +1 -1
  25. package/build/cjs/cc/ColorSwitchCC.js.map +1 -1
  26. package/build/cjs/cc/ConfigurationCC.js +3 -3
  27. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  28. package/build/cjs/cc/DoorLockCC.js +3 -3
  29. package/build/cjs/cc/DoorLockCC.js.map +1 -1
  30. package/build/cjs/cc/EntryControlCC.js +3 -3
  31. package/build/cjs/cc/EntryControlCC.js.map +1 -1
  32. package/build/cjs/cc/IndicatorCC.js +5 -5
  33. package/build/cjs/cc/IndicatorCC.js.map +2 -2
  34. package/build/cjs/cc/IrrigationCC.js +3 -3
  35. package/build/cjs/cc/IrrigationCC.js.map +1 -1
  36. package/build/cjs/cc/LanguageCC.js +1 -1
  37. package/build/cjs/cc/LanguageCC.js.map +1 -1
  38. package/build/cjs/cc/ManufacturerProprietaryCC.js +1 -1
  39. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  40. package/build/cjs/cc/ManufacturerSpecificCC.js +1 -1
  41. package/build/cjs/cc/ManufacturerSpecificCC.js.map +1 -1
  42. package/build/cjs/cc/MeterCC.js +3 -3
  43. package/build/cjs/cc/MeterCC.js.map +2 -2
  44. package/build/cjs/cc/MultiChannelAssociationCC.js.map +1 -1
  45. package/build/cjs/cc/MultiChannelCC.js +8 -8
  46. package/build/cjs/cc/MultiChannelCC.js.map +2 -2
  47. package/build/cjs/cc/MultilevelSensorCC.js.map +1 -1
  48. package/build/cjs/cc/MultilevelSwitchCC.js +1 -1
  49. package/build/cjs/cc/MultilevelSwitchCC.js.map +1 -1
  50. package/build/cjs/cc/NotificationCC.js +29 -23
  51. package/build/cjs/cc/NotificationCC.js.map +2 -2
  52. package/build/cjs/cc/ProtectionCC.js +10 -3
  53. package/build/cjs/cc/ProtectionCC.js.map +2 -2
  54. package/build/cjs/cc/SceneActuatorConfigurationCC.js +0 -1
  55. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
  56. package/build/cjs/cc/SceneControllerConfigurationCC.js +0 -1
  57. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
  58. package/build/cjs/cc/ScheduleEntryLockCC.js +1 -1
  59. package/build/cjs/cc/ScheduleEntryLockCC.js.map +1 -1
  60. package/build/cjs/cc/Security2CC.js +6 -5
  61. package/build/cjs/cc/Security2CC.js.map +2 -2
  62. package/build/cjs/cc/SecurityCC.js +3 -3
  63. package/build/cjs/cc/SecurityCC.js.map +2 -2
  64. package/build/cjs/cc/SoundSwitchCC.js +2 -2
  65. package/build/cjs/cc/SoundSwitchCC.js.map +1 -1
  66. package/build/cjs/cc/SupervisionCC.js +1 -1
  67. package/build/cjs/cc/SupervisionCC.js.map +2 -2
  68. package/build/cjs/cc/ThermostatFanModeCC.js +1 -1
  69. package/build/cjs/cc/ThermostatFanModeCC.js.map +1 -1
  70. package/build/cjs/cc/ThermostatFanStateCC.js +1 -1
  71. package/build/cjs/cc/ThermostatFanStateCC.js.map +1 -1
  72. package/build/cjs/cc/ThermostatModeCC.js +2 -2
  73. package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
  74. package/build/cjs/cc/ThermostatSetbackCC.js +1 -1
  75. package/build/cjs/cc/ThermostatSetbackCC.js.map +1 -1
  76. package/build/cjs/cc/ThermostatSetpointCC.js.map +1 -1
  77. package/build/cjs/cc/TimeCC.js +2 -2
  78. package/build/cjs/cc/TimeCC.js.map +1 -1
  79. package/build/cjs/cc/TransportServiceCC.js +1 -1
  80. package/build/cjs/cc/TransportServiceCC.js.map +2 -2
  81. package/build/cjs/cc/UserCodeCC.d.ts +8 -0
  82. package/build/cjs/cc/UserCodeCC.js +16 -4
  83. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  84. package/build/cjs/cc/VersionCC.js +3 -3
  85. package/build/cjs/cc/VersionCC.js.map +1 -1
  86. package/build/cjs/cc/WakeUpCC.js +2 -2
  87. package/build/cjs/cc/WakeUpCC.js.map +1 -1
  88. package/build/cjs/cc/WindowCoveringCC.d.ts +3 -1
  89. package/build/cjs/cc/WindowCoveringCC.js +28 -8
  90. package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
  91. package/build/cjs/cc/ZWavePlusCC.js +1 -1
  92. package/build/cjs/cc/ZWavePlusCC.js.map +1 -1
  93. package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
  94. package/build/cjs/cc/_CCValues.generated.js.map +1 -1
  95. package/build/cjs/cc/index.d.ts +3 -0
  96. package/build/cjs/cc/index.js +8 -0
  97. package/build/cjs/cc/index.js.map +2 -2
  98. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +1 -1
  99. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  100. package/build/cjs/lib/API.d.ts +2 -0
  101. package/build/cjs/lib/API.js +2 -2
  102. package/build/cjs/lib/API.js.map +2 -2
  103. package/build/cjs/lib/CommandClass.d.ts +3 -3
  104. package/build/cjs/lib/CommandClass.js +6 -6
  105. package/build/cjs/lib/CommandClass.js.map +2 -2
  106. package/build/cjs/lib/_Types.d.ts +9 -0
  107. package/build/cjs/lib/_Types.js +15 -0
  108. package/build/cjs/lib/_Types.js.map +3 -3
  109. package/build/cjs/lib/utils.js +1 -1
  110. package/build/cjs/lib/utils.js.map +2 -2
  111. package/build/esm/cc/AlarmSensorCC.js +1 -1
  112. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  113. package/build/esm/cc/ApplicationStatusCC.d.ts +33 -0
  114. package/build/esm/cc/ApplicationStatusCC.d.ts.map +1 -0
  115. package/build/esm/cc/ApplicationStatusCC.js +175 -0
  116. package/build/esm/cc/ApplicationStatusCC.js.map +1 -0
  117. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  118. package/build/esm/cc/AssociationGroupInfoCC.js +4 -4
  119. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  120. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  121. package/build/esm/cc/BarrierOperatorCC.js +13 -2
  122. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  123. package/build/esm/cc/BasicCC.js +1 -1
  124. package/build/esm/cc/BasicCC.js.map +1 -1
  125. package/build/esm/cc/BatteryCC.js +2 -2
  126. package/build/esm/cc/BatteryCC.js.map +1 -1
  127. package/build/esm/cc/BinarySwitchCC.js +1 -1
  128. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  129. package/build/esm/cc/CRC16CC.d.ts.map +1 -1
  130. package/build/esm/cc/CRC16CC.js +2 -2
  131. package/build/esm/cc/CRC16CC.js.map +1 -1
  132. package/build/esm/cc/CentralSceneCC.js +2 -2
  133. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  134. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  135. package/build/esm/cc/ClimateControlScheduleCC.js +5 -5
  136. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  137. package/build/esm/cc/ClockCC.js +1 -1
  138. package/build/esm/cc/ClockCC.js.map +1 -1
  139. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  140. package/build/esm/cc/ConfigurationCC.js +3 -4
  141. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  142. package/build/esm/cc/DoorLockCC.js +3 -3
  143. package/build/esm/cc/DoorLockCC.js.map +1 -1
  144. package/build/esm/cc/EntryControlCC.js +3 -3
  145. package/build/esm/cc/EntryControlCC.js.map +1 -1
  146. package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
  147. package/build/esm/cc/IndicatorCC.js +6 -6
  148. package/build/esm/cc/IndicatorCC.js.map +1 -1
  149. package/build/esm/cc/IrrigationCC.js +3 -3
  150. package/build/esm/cc/IrrigationCC.js.map +1 -1
  151. package/build/esm/cc/LanguageCC.js +1 -1
  152. package/build/esm/cc/LanguageCC.js.map +1 -1
  153. package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
  154. package/build/esm/cc/ManufacturerProprietaryCC.js +1 -1
  155. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  156. package/build/esm/cc/ManufacturerSpecificCC.js +1 -1
  157. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  158. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  159. package/build/esm/cc/MeterCC.js +3 -3
  160. package/build/esm/cc/MeterCC.js.map +1 -1
  161. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  162. package/build/esm/cc/MultiChannelCC.js +8 -8
  163. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  164. package/build/esm/cc/MultilevelSwitchCC.js +1 -1
  165. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  166. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  167. package/build/esm/cc/NotificationCC.js +43 -31
  168. package/build/esm/cc/NotificationCC.js.map +1 -1
  169. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  170. package/build/esm/cc/ProtectionCC.js +16 -3
  171. package/build/esm/cc/ProtectionCC.js.map +1 -1
  172. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  173. package/build/esm/cc/SceneActuatorConfigurationCC.js +0 -1
  174. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  175. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  176. package/build/esm/cc/SceneControllerConfigurationCC.js +0 -1
  177. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  178. package/build/esm/cc/ScheduleEntryLockCC.js +1 -1
  179. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  180. package/build/esm/cc/Security2CC.d.ts.map +1 -1
  181. package/build/esm/cc/Security2CC.js +6 -5
  182. package/build/esm/cc/Security2CC.js.map +1 -1
  183. package/build/esm/cc/SecurityCC.d.ts.map +1 -1
  184. package/build/esm/cc/SecurityCC.js +3 -3
  185. package/build/esm/cc/SecurityCC.js.map +1 -1
  186. package/build/esm/cc/SoundSwitchCC.js +2 -2
  187. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  188. package/build/esm/cc/SupervisionCC.js +1 -1
  189. package/build/esm/cc/SupervisionCC.js.map +1 -1
  190. package/build/esm/cc/ThermostatFanModeCC.js +1 -1
  191. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  192. package/build/esm/cc/ThermostatFanStateCC.js +1 -1
  193. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  194. package/build/esm/cc/ThermostatModeCC.js +2 -2
  195. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  196. package/build/esm/cc/ThermostatSetbackCC.js +1 -1
  197. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  198. package/build/esm/cc/TimeCC.js +2 -2
  199. package/build/esm/cc/TimeCC.js.map +1 -1
  200. package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
  201. package/build/esm/cc/TransportServiceCC.js +2 -1
  202. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  203. package/build/esm/cc/UserCodeCC.d.ts +8 -0
  204. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  205. package/build/esm/cc/UserCodeCC.js +20 -4
  206. package/build/esm/cc/UserCodeCC.js.map +1 -1
  207. package/build/esm/cc/VersionCC.js +3 -3
  208. package/build/esm/cc/VersionCC.js.map +1 -1
  209. package/build/esm/cc/WakeUpCC.js +2 -2
  210. package/build/esm/cc/WakeUpCC.js.map +1 -1
  211. package/build/esm/cc/WindowCoveringCC.d.ts +3 -1
  212. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  213. package/build/esm/cc/WindowCoveringCC.js +30 -9
  214. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  215. package/build/esm/cc/ZWavePlusCC.js +1 -1
  216. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  217. package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
  218. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  219. package/build/esm/cc/index.d.ts +3 -0
  220. package/build/esm/cc/index.d.ts.map +1 -1
  221. package/build/esm/cc/index.js +5 -0
  222. package/build/esm/cc/index.js.map +1 -1
  223. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +1 -1
  224. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  225. package/build/esm/lib/API.d.ts +2 -0
  226. package/build/esm/lib/API.d.ts.map +1 -1
  227. package/build/esm/lib/API.js +2 -2
  228. package/build/esm/lib/API.js.map +1 -1
  229. package/build/esm/lib/CommandClass.d.ts +3 -3
  230. package/build/esm/lib/CommandClass.d.ts.map +1 -1
  231. package/build/esm/lib/CommandClass.js +6 -6
  232. package/build/esm/lib/CommandClass.js.map +1 -1
  233. package/build/esm/lib/_Types.d.ts +9 -0
  234. package/build/esm/lib/_Types.d.ts.map +1 -1
  235. package/build/esm/lib/_Types.js +11 -0
  236. package/build/esm/lib/_Types.js.map +1 -1
  237. package/build/esm/lib/utils.js +1 -1
  238. package/build/esm/lib/utils.js.map +1 -1
  239. package/package.json +9 -10
  240. package/build/cjs/lib/ICommandClassContainer.d.ts +0 -2
  241. package/build/cjs/lib/ICommandClassContainer.js +0 -17
  242. package/build/cjs/lib/ICommandClassContainer.js.map +0 -7
  243. package/build/esm/lib/ICommandClassContainer.d.ts +0 -2
  244. package/build/esm/lib/ICommandClassContainer.d.ts.map +0 -1
  245. package/build/esm/lib/ICommandClassContainer.js +0 -2
  246. package/build/esm/lib/ICommandClassContainer.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cc/ProtectionCC.ts"],
4
- "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\tMAX_NODES,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\tTimeout,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tenumValuesToMetadataStates,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n\tgetEffectiveCCVersion,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tLocalProtectionState,\n\tProtectionCommand,\n\tRFProtectionState,\n} from \"../lib/_Types.js\";\n\nexport const ProtectionCCValues = V.defineCCValues(CommandClasses.Protection, {\n\t...V.staticProperty(\n\t\t\"exclusiveControlNodeId\",\n\t\t{\n\t\t\t...ValueMetadata.UInt8,\n\t\t\tmin: 1,\n\t\t\tmax: MAX_NODES,\n\t\t\tlabel: \"Node ID with exclusive control\",\n\t\t} as const,\n\t\t{ minVersion: 2 } as const,\n\t),\n\t...V.staticPropertyWithName(\n\t\t\"localProtectionState\",\n\t\t\"local\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"Local protection state\",\n\t\t\tstates: enumValuesToMetadataStates(LocalProtectionState),\n\t\t} as const,\n\t),\n\t...V.staticPropertyWithName(\n\t\t\"rfProtectionState\",\n\t\t\"rf\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"RF protection state\",\n\t\t\tstates: enumValuesToMetadataStates(RFProtectionState),\n\t\t} as const,\n\t\t{ minVersion: 2 } as const,\n\t),\n\t...V.staticProperty(\n\t\t\"timeout\",\n\t\t{\n\t\t\t...ValueMetadata.Timeout,\n\t\t\tlabel: \"RF protection timeout\",\n\t\t} as const,\n\t\t{ minVersion: 2 } as const,\n\t),\n\t...V.staticProperty(\"supportsExclusiveControl\", undefined, {\n\t\tinternal: true,\n\t}),\n\t...V.staticProperty(\"supportsTimeout\", undefined, {\n\t\tinternal: true,\n\t}),\n\t...V.staticProperty(\"supportedLocalStates\", undefined, {\n\t\tinternal: true,\n\t}),\n\t...V.staticProperty(\"supportedRFStates\", undefined, {\n\t\tinternal: true,\n\t}),\n});\n\n@API(CommandClasses.Protection)\nexport class ProtectionCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: ProtectionCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ProtectionCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase ProtectionCommand.Set:\n\t\t\t\treturn true; // This is mandatory\n\t\t\tcase ProtectionCommand.SupportedGet:\n\t\t\t\treturn this.version >= 2 && this.isSinglecast();\n\t\t\tcase ProtectionCommand.TimeoutGet:\n\t\t\tcase ProtectionCommand.TimeoutSet: {\n\t\t\t\treturn (\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t&& this.tryGetValueDB()?.getValue<boolean>(\n\t\t\t\t\t\tProtectionCCValues.supportsTimeout.endpoint(\n\t\t\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase ProtectionCommand.ExclusiveControlGet:\n\t\t\tcase ProtectionCommand.ExclusiveControlSet: {\n\t\t\t\treturn (\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t&& this.tryGetValueDB()?.getValue<boolean>(\n\t\t\t\t\t\tProtectionCCValues.supportsExclusiveControl.endpoint(\n\t\t\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(this: ProtectionCCAPI, { property }, value) {\n\t\t\tconst valueDB = this.tryGetValueDB();\n\t\t\tif (property === \"local\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// We need to set both values together, so retrieve the other one from the value DB\n\t\t\t\tconst rf = valueDB?.getValue<RFProtectionState>(\n\t\t\t\t\tProtectionCCValues.rfProtectionState.endpoint(\n\t\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn this.set(value, rf);\n\t\t\t} else if (property === \"rf\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// We need to set both values together, so retrieve the other one from the value DB\n\t\t\t\tconst local = valueDB?.getValue<LocalProtectionState>(\n\t\t\t\t\tProtectionCCValues.localProtectionState.endpoint(\n\t\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn this.set(\n\t\t\t\t\tlocal ?? LocalProtectionState.Unprotected,\n\t\t\t\t\tvalue,\n\t\t\t\t);\n\t\t\t} else if (property === \"exclusiveControlNodeId\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn this.setExclusiveControl(value);\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: ProtectionCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"local\":\n\t\t\t\tcase \"rf\":\n\t\t\t\t\treturn (await this.get())?.[property];\n\t\t\t\tcase \"exclusiveControlNodeId\":\n\t\t\t\t\treturn this.getExclusiveControl();\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get() {\n\t\tthis.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);\n\n\t\tconst cc = new ProtectionCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<ProtectionCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"local\", \"rf\"]);\n\t\t}\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async set(\n\t\tlocal: LocalProtectionState,\n\t\trf?: RFProtectionState,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);\n\n\t\tconst cc = new ProtectionCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tlocal,\n\t\t\trf,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupported() {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tProtectionCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"supportsExclusiveControl\",\n\t\t\t\t\"supportsTimeout\",\n\t\t\t\t\"supportedLocalStates\",\n\t\t\t\t\"supportedRFStates\",\n\t\t\t]);\n\t\t}\n\t}\n\n\tpublic async getExclusiveControl(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.ExclusiveControlGet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCExclusiveControlGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tProtectionCCExclusiveControlReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.exclusiveControlNodeId;\n\t}\n\n\t@validateArgs()\n\tpublic async setExclusiveControl(\n\t\tnodeId: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.ExclusiveControlSet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCExclusiveControlSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\texclusiveControlNodeId: nodeId,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getTimeout(): Promise<MaybeNotKnown<Timeout>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.TimeoutGet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCTimeoutGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tProtectionCCTimeoutReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.timeout;\n\t}\n\n\t@validateArgs()\n\tpublic async setTimeout(\n\t\ttimeout: Timeout,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.TimeoutSet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCTimeoutSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttimeout,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Protection)\n@implementedVersion(2)\n@ccValues(ProtectionCCValues)\nexport class ProtectionCC extends CommandClass {\n\tdeclare ccCommand: ProtectionCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Protection,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// We need to do some queries after a potential timeout\n\t\t// In this case, do now mark this CC as interviewed completely\n\t\tlet hadCriticalTimeout = false;\n\n\t\t// First find out what the device supports\n\t\tif (api.version >= 2) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: \"querying protection capabilities...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst resp = await api.getSupported();\n\t\t\tif (resp) {\n\t\t\t\tconst logMessage = `received protection capabilities:\nexclusive control: ${resp.supportsExclusiveControl}\ntimeout: ${resp.supportsTimeout}\nlocal protection states: ${\n\t\t\t\t\tresp.supportedLocalStates\n\t\t\t\t\t\t.map((local) =>\n\t\t\t\t\t\t\tgetEnumMemberName(LocalProtectionState, local)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.map((str) => `\\n\u00B7 ${str}`)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}\nRF protection states: ${\n\t\t\t\t\tresp.supportedRFStates\n\t\t\t\t\t\t.map((local) =>\n\t\t\t\t\t\t\tgetEnumMemberName(RFProtectionState, local)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.map((str) => `\\n\u00B7 ${str}`)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\thadCriticalTimeout = true;\n\t\t\t}\n\t\t}\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tif (!hadCriticalTimeout) this.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Protection,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst supportsExclusiveControl = !!this.getValue(\n\t\t\tctx,\n\t\t\tProtectionCCValues.supportsExclusiveControl,\n\t\t);\n\t\tconst supportsTimeout = !!this.getValue(\n\t\t\tctx,\n\t\t\tProtectionCCValues.supportsTimeout,\n\t\t);\n\n\t\t// Query the current state\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"querying protection status...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst protectionResp = await api.get();\n\t\tif (protectionResp) {\n\t\t\tlet logMessage = `received protection status:\nlocal: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;\n\t\t\tif (protectionResp.rf != undefined) {\n\t\t\t\tlogMessage += `\nrf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;\n\t\t\t}\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\tif (supportsTimeout) {\n\t\t\t// Query the current timeout\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: \"querying protection timeout...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst timeout = await api.getTimeout();\n\t\t\tif (timeout) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tmessage: `received timeout: ${timeout.toString()}`,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (supportsExclusiveControl) {\n\t\t\t// Query the current timeout\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: \"querying exclusive control node...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst nodeId = await api.getExclusiveControl();\n\t\t\tif (nodeId != undefined) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tmessage: (nodeId !== 0\n\t\t\t\t\t\t? `Node ${nodeId.toString().padStart(3, \"0\")}`\n\t\t\t\t\t\t: `no node`) + ` has exclusive control`,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface ProtectionCCSetOptions {\n\tlocal: LocalProtectionState;\n\trf?: RFProtectionState;\n}\n\n@CCCommand(ProtectionCommand.Set)\n@useSupervision()\nexport class ProtectionCCSet extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.local = options.local;\n\t\tthis.rf = options.rf;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): ProtectionCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ProtectionCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic local: LocalProtectionState;\n\tpublic rf?: RFProtectionState;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.local & 0b1111,\n\t\t\t(this.rf ?? RFProtectionState.Unprotected) & 0b1111,\n\t\t]);\n\n\t\tconst ccVersion = getEffectiveCCVersion(ctx, this);\n\t\tif (\n\t\t\tccVersion < 2 && ctx.getDeviceConfig?.(\n\t\t\t\tthis.nodeId as number,\n\t\t\t)?.compat?.encodeCCsUsingTargetVersion\n\t\t) {\n\t\t\t// When forcing CC version 1, only include the local state\n\t\t\tthis.payload = this.payload.subarray(0, 1);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tlocal: getEnumMemberName(LocalProtectionState, this.local),\n\t\t};\n\t\tif (this.rf != undefined) {\n\t\t\tmessage.rf = getEnumMemberName(RFProtectionState, this.rf);\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ProtectionCCReportOptions {\n\tlocal: LocalProtectionState;\n\trf?: RFProtectionState;\n}\n\n@CCCommand(ProtectionCommand.Report)\n@ccValueProperty(\"local\", ProtectionCCValues.localProtectionState)\n@ccValueProperty(\"rf\", ProtectionCCValues.rfProtectionState)\nexport class ProtectionCCReport extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.local = options.local;\n\t\tthis.rf = options.rf;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst local: LocalProtectionState = raw.payload[0] & 0b1111;\n\t\tlet rf: RFProtectionState | undefined;\n\t\tif (raw.payload.length >= 2) {\n\t\t\trf = raw.payload[1] & 0b1111;\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tlocal,\n\t\t\trf,\n\t\t});\n\t}\n\n\tpublic readonly local: LocalProtectionState;\n\n\tpublic readonly rf?: RFProtectionState;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tlocal: getEnumMemberName(LocalProtectionState, this.local),\n\t\t};\n\t\tif (this.rf != undefined) {\n\t\t\tmessage.rf = getEnumMemberName(RFProtectionState, this.rf);\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@CCCommand(ProtectionCommand.Get)\n@expectedCCResponse(ProtectionCCReport)\nexport class ProtectionCCGet extends ProtectionCC {}\n\n// @publicAPI\nexport interface ProtectionCCSupportedReportOptions {\n\tsupportsTimeout: boolean;\n\tsupportsExclusiveControl: boolean;\n\tsupportedLocalStates: LocalProtectionState[];\n\tsupportedRFStates: RFProtectionState[];\n}\n\n@CCCommand(ProtectionCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportsExclusiveControl\",\n\tProtectionCCValues.supportsExclusiveControl,\n)\n@ccValueProperty(\"supportsTimeout\", ProtectionCCValues.supportsTimeout)\n@ccValueProperty(\n\t\"supportedLocalStates\",\n\tProtectionCCValues.supportedLocalStates,\n)\n@ccValueProperty(\"supportedRFStates\", ProtectionCCValues.supportedRFStates)\nexport class ProtectionCCSupportedReport extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportsTimeout = options.supportsTimeout;\n\t\tthis.supportsExclusiveControl = options.supportsExclusiveControl;\n\t\tthis.supportedLocalStates = options.supportedLocalStates;\n\t\tthis.supportedRFStates = options.supportedRFStates;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ProtectionCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 5);\n\t\tconst supportsTimeout = !!(raw.payload[0] & 0b1);\n\t\tconst supportsExclusiveControl = !!(raw.payload[0] & 0b10);\n\t\tconst supportedLocalStates: LocalProtectionState[] = parseBitMask(\n\t\t\traw.payload.subarray(1, 3),\n\t\t\tLocalProtectionState.Unprotected,\n\t\t);\n\t\tconst supportedRFStates: RFProtectionState[] = parseBitMask(\n\t\t\traw.payload.subarray(3, 5),\n\t\t\tRFProtectionState.Unprotected,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportsTimeout,\n\t\t\tsupportsExclusiveControl,\n\t\t\tsupportedLocalStates,\n\t\t\tsupportedRFStates,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// update metadata (partially) for the local and rf values\n\t\tconst localStateValue = ProtectionCCValues.localProtectionState;\n\t\tthis.setMetadata(ctx, localStateValue, {\n\t\t\t...localStateValue.meta,\n\t\t\tstates: enumValuesToMetadataStates(\n\t\t\t\tLocalProtectionState,\n\t\t\t\tthis.supportedLocalStates,\n\t\t\t),\n\t\t});\n\n\t\tconst rfStateValue = ProtectionCCValues.rfProtectionState;\n\t\tthis.setMetadata(ctx, rfStateValue, {\n\t\t\t...rfStateValue.meta,\n\t\t\tstates: enumValuesToMetadataStates(\n\t\t\t\tRFProtectionState,\n\t\t\t\tthis.supportedRFStates,\n\t\t\t),\n\t\t});\n\n\t\treturn true;\n\t}\n\n\tpublic readonly supportsExclusiveControl: boolean;\n\n\tpublic readonly supportsTimeout: boolean;\n\n\tpublic readonly supportedLocalStates: LocalProtectionState[];\n\n\tpublic readonly supportedRFStates: RFProtectionState[];\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supports exclusive control\": this.supportsExclusiveControl,\n\t\t\t\t\"supports timeout\": this.supportsTimeout,\n\t\t\t\t\"local protection states\": this.supportedLocalStates\n\t\t\t\t\t.map((local) =>\n\t\t\t\t\t\tgetEnumMemberName(LocalProtectionState, local)\n\t\t\t\t\t)\n\t\t\t\t\t.map((str) => `\\n\u00B7 ${str}`)\n\t\t\t\t\t.join(\"\"),\n\t\t\t\t\"RF protection states\": this.supportedRFStates\n\t\t\t\t\t.map((rf) => getEnumMemberName(RFProtectionState, rf))\n\t\t\t\t\t.map((str) => `\\n\u00B7 ${str}`)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ProtectionCommand.SupportedGet)\n@expectedCCResponse(ProtectionCCSupportedReport)\nexport class ProtectionCCSupportedGet extends ProtectionCC {}\n\n// @publicAPI\nexport interface ProtectionCCExclusiveControlReportOptions {\n\texclusiveControlNodeId: number;\n}\n\n@CCCommand(ProtectionCommand.ExclusiveControlReport)\n@ccValueProperty(\n\t\"exclusiveControlNodeId\",\n\tProtectionCCValues.exclusiveControlNodeId,\n)\nexport class ProtectionCCExclusiveControlReport extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCExclusiveControlReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.exclusiveControlNodeId = options.exclusiveControlNodeId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ProtectionCCExclusiveControlReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst exclusiveControlNodeId = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\texclusiveControlNodeId,\n\t\t});\n\t}\n\n\tpublic readonly exclusiveControlNodeId: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"exclusive control node id\": this.exclusiveControlNodeId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ProtectionCommand.ExclusiveControlGet)\n@expectedCCResponse(ProtectionCCExclusiveControlReport)\nexport class ProtectionCCExclusiveControlGet extends ProtectionCC {}\n\n// @publicAPI\nexport interface ProtectionCCExclusiveControlSetOptions {\n\texclusiveControlNodeId: number;\n}\n\n@CCCommand(ProtectionCommand.ExclusiveControlSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCExclusiveControlSet extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCExclusiveControlSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.exclusiveControlNodeId = options.exclusiveControlNodeId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ProtectionCCExclusiveControlSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ProtectionCCExclusiveControlSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic exclusiveControlNodeId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.exclusiveControlNodeId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"exclusive control node id\": this.exclusiveControlNodeId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ProtectionCCTimeoutReportOptions {\n\ttimeout: Timeout;\n}\n\n@CCCommand(ProtectionCommand.TimeoutReport)\n@ccValueProperty(\"timeout\", ProtectionCCValues.timeout)\nexport class ProtectionCCTimeoutReport extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCTimeoutReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.timeout = options.timeout;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ProtectionCCTimeoutReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst timeout: Timeout = Timeout.parse(raw.payload[0]);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttimeout,\n\t\t});\n\t}\n\n\tpublic readonly timeout: Timeout;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { timeout: this.timeout.toString() },\n\t\t};\n\t}\n}\n\n@CCCommand(ProtectionCommand.TimeoutGet)\n@expectedCCResponse(ProtectionCCTimeoutReport)\nexport class ProtectionCCTimeoutGet extends ProtectionCC {}\n\n// @publicAPI\nexport interface ProtectionCCTimeoutSetOptions {\n\ttimeout: Timeout;\n}\n\n@CCCommand(ProtectionCommand.TimeoutSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCTimeoutSet extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCTimeoutSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.timeout = options.timeout;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ProtectionCCTimeoutSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ProtectionCCTimeoutSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic timeout: Timeout;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.timeout.serialize()]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { timeout: this.timeout.toString() },\n\t\t};\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAiBO;AACP,oBAA+C;AAE/C,iBAQO;AACP,0BAOO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAIO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuDM,mBAAe,MAAA;8BAD3B,mCAAI,2BAAe,UAAU,CAAC;;;;oBACM;;;;;uCAAA,YAAK;WAAA;;;;;;;;yBAwHxC,iCAAa,EAAE,aAAa,KAAI,CAAE,CAAC;yCA8DnC,iDAAA,CAAc;gCAoCd,wCAAA,CAAc;AAjGf,mBAAA,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;AA8DhB,mBAAA,MAAA,MAAA,iCAAA,EAAA,MAAA,UAAA,MAAA,uBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,yBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,qBAAb,OAAgC,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAoChC,mBAAA,MAAA,MAAA,wBAAA,EAAA,MAAA,UAAA,MAAA,cAAA,QAAA,OAAA,SAA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} from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetNode,\n\ttype GetValueDB,\n\tMAX_NODES,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype NodeId,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\tTimeout,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tenumValuesToMetadataStates,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n\tgetEffectiveCCVersion,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tLocalProtectionState,\n\tProtectionCommand,\n\tRFProtectionState,\n} from \"../lib/_Types.js\";\nimport { ApplicationStatusCCRejectedRequest } from \"./ApplicationStatusCC.js\";\n\nexport const ProtectionCCValues = V.defineCCValues(CommandClasses.Protection, {\n\t...V.staticProperty(\n\t\t\"exclusiveControlNodeId\",\n\t\t{\n\t\t\t...ValueMetadata.UInt8,\n\t\t\tmin: 1,\n\t\t\tmax: MAX_NODES,\n\t\t\tlabel: \"Node ID with exclusive control\",\n\t\t} as const,\n\t\t{ minVersion: 2 } as const,\n\t),\n\t...V.staticPropertyWithName(\n\t\t\"localProtectionState\",\n\t\t\"local\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"Local protection state\",\n\t\t\tstates: enumValuesToMetadataStates(LocalProtectionState),\n\t\t} as const,\n\t),\n\t...V.staticPropertyWithName(\n\t\t\"rfProtectionState\",\n\t\t\"rf\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"RF protection state\",\n\t\t\tstates: enumValuesToMetadataStates(RFProtectionState),\n\t\t} as const,\n\t\t{ minVersion: 2 } as const,\n\t),\n\t...V.staticProperty(\n\t\t\"timeout\",\n\t\t{\n\t\t\t...ValueMetadata.Timeout,\n\t\t\tlabel: \"RF protection timeout\",\n\t\t} as const,\n\t\t{ minVersion: 2 } as const,\n\t),\n\t...V.staticProperty(\"supportsExclusiveControl\", undefined, {\n\t\tinternal: true,\n\t}),\n\t...V.staticProperty(\"supportsTimeout\", undefined, {\n\t\tinternal: true,\n\t}),\n\t...V.staticProperty(\"supportedLocalStates\", undefined, {\n\t\tinternal: true,\n\t}),\n\t...V.staticProperty(\"supportedRFStates\", undefined, {\n\t\tinternal: true,\n\t}),\n});\n\n@API(CommandClasses.Protection)\nexport class ProtectionCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: ProtectionCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ProtectionCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase ProtectionCommand.Set:\n\t\t\t\treturn true; // This is mandatory\n\t\t\tcase ProtectionCommand.SupportedGet:\n\t\t\t\treturn this.version >= 2 && this.isSinglecast();\n\t\t\tcase ProtectionCommand.TimeoutGet:\n\t\t\tcase ProtectionCommand.TimeoutSet: {\n\t\t\t\treturn (\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t&& this.tryGetValueDB()?.getValue<boolean>(\n\t\t\t\t\t\tProtectionCCValues.supportsTimeout.endpoint(\n\t\t\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase ProtectionCommand.ExclusiveControlGet:\n\t\t\tcase ProtectionCommand.ExclusiveControlSet: {\n\t\t\t\treturn (\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t&& this.tryGetValueDB()?.getValue<boolean>(\n\t\t\t\t\t\tProtectionCCValues.supportsExclusiveControl.endpoint(\n\t\t\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(this: ProtectionCCAPI, { property }, value) {\n\t\t\tconst valueDB = this.tryGetValueDB();\n\t\t\tif (property === \"local\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// We need to set both values together, so retrieve the other one from the value DB\n\t\t\t\tconst rf = valueDB?.getValue<RFProtectionState>(\n\t\t\t\t\tProtectionCCValues.rfProtectionState.endpoint(\n\t\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn this.set(value, rf);\n\t\t\t} else if (property === \"rf\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// We need to set both values together, so retrieve the other one from the value DB\n\t\t\t\tconst local = valueDB?.getValue<LocalProtectionState>(\n\t\t\t\t\tProtectionCCValues.localProtectionState.endpoint(\n\t\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn this.set(\n\t\t\t\t\tlocal ?? LocalProtectionState.Unprotected,\n\t\t\t\t\tvalue,\n\t\t\t\t);\n\t\t\t} else if (property === \"exclusiveControlNodeId\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn this.setExclusiveControl(value);\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: ProtectionCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"local\":\n\t\t\t\tcase \"rf\":\n\t\t\t\t\treturn (await this.get())?.[property];\n\t\t\t\tcase \"exclusiveControlNodeId\":\n\t\t\t\t\treturn this.getExclusiveControl();\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async get() {\n\t\tthis.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);\n\n\t\tconst cc = new ProtectionCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<ProtectionCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"local\", \"rf\"]);\n\t\t}\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async set(\n\t\tlocal: LocalProtectionState,\n\t\trf?: RFProtectionState,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);\n\n\t\tconst cc = new ProtectionCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tlocal,\n\t\t\trf,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getSupported() {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tProtectionCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"supportsExclusiveControl\",\n\t\t\t\t\"supportsTimeout\",\n\t\t\t\t\"supportedLocalStates\",\n\t\t\t\t\"supportedRFStates\",\n\t\t\t]);\n\t\t}\n\t}\n\n\tpublic async getExclusiveControl(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.ExclusiveControlGet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCExclusiveControlGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tProtectionCCExclusiveControlReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.exclusiveControlNodeId;\n\t}\n\n\t@validateArgs()\n\tpublic async setExclusiveControl(\n\t\tnodeId: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.ExclusiveControlSet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCExclusiveControlSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\texclusiveControlNodeId: nodeId,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getTimeout(): Promise<MaybeNotKnown<Timeout>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.TimeoutGet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCTimeoutGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tProtectionCCTimeoutReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.timeout;\n\t}\n\n\t@validateArgs()\n\tpublic async setTimeout(\n\t\ttimeout: Timeout,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tProtectionCommand,\n\t\t\tProtectionCommand.TimeoutSet,\n\t\t);\n\n\t\tconst cc = new ProtectionCCTimeoutSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttimeout,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Protection)\n@implementedVersion(2)\n@ccValues(ProtectionCCValues)\nexport class ProtectionCC extends CommandClass {\n\tdeclare ccCommand: ProtectionCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Protection,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// We need to do some queries after a potential timeout\n\t\t// In this case, do now mark this CC as interviewed completely\n\t\tlet hadCriticalTimeout = false;\n\n\t\t// First find out what the device supports\n\t\tif (api.version >= 2) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: \"querying protection capabilities...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst resp = await api.getSupported();\n\t\t\tif (resp) {\n\t\t\t\tconst logMessage = `received protection capabilities:\nexclusive control: ${resp.supportsExclusiveControl}\ntimeout: ${resp.supportsTimeout}\nlocal protection states: ${\n\t\t\t\t\tresp.supportedLocalStates\n\t\t\t\t\t\t.map((local) =>\n\t\t\t\t\t\t\tgetEnumMemberName(LocalProtectionState, local)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.map((str) => `\\n\u00B7 ${str}`)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}\nRF protection states: ${\n\t\t\t\t\tresp.supportedRFStates\n\t\t\t\t\t\t.map((local) =>\n\t\t\t\t\t\t\tgetEnumMemberName(RFProtectionState, local)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.map((str) => `\\n\u00B7 ${str}`)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\thadCriticalTimeout = true;\n\t\t\t}\n\t\t}\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tif (!hadCriticalTimeout) this.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Protection,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst supportsExclusiveControl = !!this.getValue(\n\t\t\tctx,\n\t\t\tProtectionCCValues.supportsExclusiveControl,\n\t\t);\n\t\tconst supportsTimeout = !!this.getValue(\n\t\t\tctx,\n\t\t\tProtectionCCValues.supportsTimeout,\n\t\t);\n\n\t\t// Query the current state\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"querying protection status...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst protectionResp = await api.get();\n\t\tif (protectionResp) {\n\t\t\tlet logMessage = `received protection status:\nlocal: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;\n\t\t\tif (protectionResp.rf != undefined) {\n\t\t\t\tlogMessage += `\nrf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;\n\t\t\t}\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\tif (supportsTimeout) {\n\t\t\t// Query the current timeout\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: \"querying protection timeout...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst timeout = await api.getTimeout();\n\t\t\tif (timeout) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tmessage: `received timeout: ${timeout.toString()}`,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (supportsExclusiveControl) {\n\t\t\t// Query the current timeout\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: \"querying exclusive control node...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst nodeId = await api.getExclusiveControl();\n\t\t\tif (nodeId != undefined) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tmessage: (nodeId !== 0\n\t\t\t\t\t\t? `Node ${nodeId.toString().padStart(3, \"0\")}`\n\t\t\t\t\t\t: `no node`) + ` has exclusive control`,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface ProtectionCCSetOptions {\n\tlocal: LocalProtectionState;\n\trf?: RFProtectionState;\n}\n\nfunction getCCResponseForProtectionCCSet(\n\tctx: GetNode<NodeId & SupportsCC>,\n\tsent: ProtectionCCSet,\n) {\n\t// The NodeID that has exclusive control can override the RF protection\n\t// state of the device and can control it regardless of the protection\n\t// state. Commands from any other nodes in the network may be restricted\n\t// by the RF protection state. In that case, the Application Rejected\n\t// Request Command MUST be returned.\n\tif (\n\t\tsent.isSinglecast()\n\t\t&& !sent.isEncapsulatedWith(CommandClasses.Supervision)\n\t\t&& ctx.getNode(sent.nodeId)?.supportsCC(\n\t\t\tCommandClasses[\"Application Status\"],\n\t\t)\n\t) {\n\t\treturn ApplicationStatusCCRejectedRequest;\n\t}\n}\n\n@CCCommand(ProtectionCommand.Set)\n@expectedCCResponse(getCCResponseForProtectionCCSet)\n@useSupervision()\nexport class ProtectionCCSet extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.local = options.local;\n\t\tthis.rf = options.rf;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): ProtectionCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ProtectionCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic local: LocalProtectionState;\n\tpublic rf?: RFProtectionState;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.local & 0b1111,\n\t\t\t(this.rf ?? RFProtectionState.Unprotected) & 0b1111,\n\t\t]);\n\n\t\tconst ccVersion = getEffectiveCCVersion(ctx, this);\n\t\tif (\n\t\t\tccVersion < 2 && ctx.getDeviceConfig?.(\n\t\t\t\tthis.nodeId as number,\n\t\t\t)?.compat?.encodeCCsUsingTargetVersion\n\t\t) {\n\t\t\t// When forcing CC version 1, only include the local state\n\t\t\tthis.payload = this.payload.subarray(0, 1);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tlocal: getEnumMemberName(LocalProtectionState, this.local),\n\t\t};\n\t\tif (this.rf != undefined) {\n\t\t\tmessage.rf = getEnumMemberName(RFProtectionState, this.rf);\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ProtectionCCReportOptions {\n\tlocal: LocalProtectionState;\n\trf?: RFProtectionState;\n}\n\n@CCCommand(ProtectionCommand.Report)\n@ccValueProperty(\"local\", ProtectionCCValues.localProtectionState)\n@ccValueProperty(\"rf\", ProtectionCCValues.rfProtectionState)\nexport class ProtectionCCReport extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.local = options.local;\n\t\tthis.rf = options.rf;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst local: LocalProtectionState = raw.payload[0] & 0b1111;\n\t\tlet rf: RFProtectionState | undefined;\n\t\tif (raw.payload.length >= 2) {\n\t\t\trf = raw.payload[1] & 0b1111;\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tlocal,\n\t\t\trf,\n\t\t});\n\t}\n\n\tpublic readonly local: LocalProtectionState;\n\n\tpublic readonly rf?: RFProtectionState;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tlocal: getEnumMemberName(LocalProtectionState, this.local),\n\t\t};\n\t\tif (this.rf != undefined) {\n\t\t\tmessage.rf = getEnumMemberName(RFProtectionState, this.rf);\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@CCCommand(ProtectionCommand.Get)\n@expectedCCResponse(ProtectionCCReport)\nexport class ProtectionCCGet extends ProtectionCC {}\n\n// @publicAPI\nexport interface ProtectionCCSupportedReportOptions {\n\tsupportsTimeout: boolean;\n\tsupportsExclusiveControl: boolean;\n\tsupportedLocalStates: LocalProtectionState[];\n\tsupportedRFStates: RFProtectionState[];\n}\n\n@CCCommand(ProtectionCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportsExclusiveControl\",\n\tProtectionCCValues.supportsExclusiveControl,\n)\n@ccValueProperty(\"supportsTimeout\", ProtectionCCValues.supportsTimeout)\n@ccValueProperty(\n\t\"supportedLocalStates\",\n\tProtectionCCValues.supportedLocalStates,\n)\n@ccValueProperty(\"supportedRFStates\", ProtectionCCValues.supportedRFStates)\nexport class ProtectionCCSupportedReport extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportsTimeout = options.supportsTimeout;\n\t\tthis.supportsExclusiveControl = options.supportsExclusiveControl;\n\t\tthis.supportedLocalStates = options.supportedLocalStates;\n\t\tthis.supportedRFStates = options.supportedRFStates;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ProtectionCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 5);\n\t\tconst supportsTimeout = !!(raw.payload[0] & 0b1);\n\t\tconst supportsExclusiveControl = !!(raw.payload[0] & 0b10);\n\t\tconst supportedLocalStates: LocalProtectionState[] = parseBitMask(\n\t\t\traw.payload.subarray(1, 3),\n\t\t\tLocalProtectionState.Unprotected,\n\t\t);\n\t\tconst supportedRFStates: RFProtectionState[] = parseBitMask(\n\t\t\traw.payload.subarray(3, 5),\n\t\t\tRFProtectionState.Unprotected,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportsTimeout,\n\t\t\tsupportsExclusiveControl,\n\t\t\tsupportedLocalStates,\n\t\t\tsupportedRFStates,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// update metadata (partially) for the local and rf values\n\t\tconst localStateValue = ProtectionCCValues.localProtectionState;\n\t\tthis.setMetadata(ctx, localStateValue, {\n\t\t\t...localStateValue.meta,\n\t\t\tstates: enumValuesToMetadataStates(\n\t\t\t\tLocalProtectionState,\n\t\t\t\tthis.supportedLocalStates,\n\t\t\t),\n\t\t});\n\n\t\tconst rfStateValue = ProtectionCCValues.rfProtectionState;\n\t\tthis.setMetadata(ctx, rfStateValue, {\n\t\t\t...rfStateValue.meta,\n\t\t\tstates: enumValuesToMetadataStates(\n\t\t\t\tRFProtectionState,\n\t\t\t\tthis.supportedRFStates,\n\t\t\t),\n\t\t});\n\n\t\treturn true;\n\t}\n\n\tpublic readonly supportsExclusiveControl: boolean;\n\n\tpublic readonly supportsTimeout: boolean;\n\n\tpublic readonly supportedLocalStates: LocalProtectionState[];\n\n\tpublic readonly supportedRFStates: RFProtectionState[];\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supports exclusive control\": this.supportsExclusiveControl,\n\t\t\t\t\"supports timeout\": this.supportsTimeout,\n\t\t\t\t\"local protection states\": this.supportedLocalStates\n\t\t\t\t\t.map((local) =>\n\t\t\t\t\t\tgetEnumMemberName(LocalProtectionState, local)\n\t\t\t\t\t)\n\t\t\t\t\t.map((str) => `\\n\u00B7 ${str}`)\n\t\t\t\t\t.join(\"\"),\n\t\t\t\t\"RF protection states\": this.supportedRFStates\n\t\t\t\t\t.map((rf) => getEnumMemberName(RFProtectionState, rf))\n\t\t\t\t\t.map((str) => `\\n\u00B7 ${str}`)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ProtectionCommand.SupportedGet)\n@expectedCCResponse(ProtectionCCSupportedReport)\nexport class ProtectionCCSupportedGet extends ProtectionCC {}\n\n// @publicAPI\nexport interface ProtectionCCExclusiveControlReportOptions {\n\texclusiveControlNodeId: number;\n}\n\n@CCCommand(ProtectionCommand.ExclusiveControlReport)\n@ccValueProperty(\n\t\"exclusiveControlNodeId\",\n\tProtectionCCValues.exclusiveControlNodeId,\n)\nexport class ProtectionCCExclusiveControlReport extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCExclusiveControlReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.exclusiveControlNodeId = options.exclusiveControlNodeId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ProtectionCCExclusiveControlReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst exclusiveControlNodeId = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\texclusiveControlNodeId,\n\t\t});\n\t}\n\n\tpublic readonly exclusiveControlNodeId: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"exclusive control node id\": this.exclusiveControlNodeId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ProtectionCommand.ExclusiveControlGet)\n@expectedCCResponse(ProtectionCCExclusiveControlReport)\nexport class ProtectionCCExclusiveControlGet extends ProtectionCC {}\n\n// @publicAPI\nexport interface ProtectionCCExclusiveControlSetOptions {\n\texclusiveControlNodeId: number;\n}\n\n@CCCommand(ProtectionCommand.ExclusiveControlSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCExclusiveControlSet extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCExclusiveControlSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.exclusiveControlNodeId = options.exclusiveControlNodeId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ProtectionCCExclusiveControlSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ProtectionCCExclusiveControlSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic exclusiveControlNodeId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.exclusiveControlNodeId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"exclusive control node id\": this.exclusiveControlNodeId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ProtectionCCTimeoutReportOptions {\n\ttimeout: Timeout;\n}\n\n@CCCommand(ProtectionCommand.TimeoutReport)\n@ccValueProperty(\"timeout\", ProtectionCCValues.timeout)\nexport class ProtectionCCTimeoutReport extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCTimeoutReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.timeout = options.timeout;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ProtectionCCTimeoutReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst timeout: Timeout = Timeout.parse(raw.payload[0]);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttimeout,\n\t\t});\n\t}\n\n\tpublic readonly timeout: Timeout;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { timeout: this.timeout.toString() },\n\t\t};\n\t}\n}\n\n@CCCommand(ProtectionCommand.TimeoutGet)\n@expectedCCResponse(ProtectionCCTimeoutReport)\nexport class ProtectionCCTimeoutGet extends ProtectionCC {}\n\n// @publicAPI\nexport interface ProtectionCCTimeoutSetOptions {\n\ttimeout: Timeout;\n}\n\n@CCCommand(ProtectionCommand.TimeoutSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCTimeoutSet extends ProtectionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ProtectionCCTimeoutSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.timeout = options.timeout;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ProtectionCCTimeoutSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ProtectionCCTimeoutSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic timeout: Timeout;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.timeout.serialize()]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(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,6 @@ let SceneActuatorConfigurationCC = (() => {
233
233
  if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
234
234
  __runInitializers(_classThis, _classExtraInitializers);
235
235
  }
236
- // eslint-disable-next-line @typescript-eslint/require-await
237
236
  async interview(ctx) {
238
237
  const node = this.getNode(ctx);
239
238
  ctx.logNode(node.id, {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cc/SceneActuatorConfigurationCC.ts"],
4
- "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\tDuration,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SceneActuatorConfigurationCommand } from \"../lib/_Types.js\";\n\nexport const SceneActuatorConfigurationCCValues = V.defineCCValues(\n\tCommandClasses[\"Scene Actuator Configuration\"],\n\t{\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"level\",\n\t\t\t\"level\",\n\t\t\t(sceneId: number) => sceneId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"level\" && typeof propertyKey === \"number\",\n\t\t\t(sceneId: number) => ({\n\t\t\t\t...ValueMetadata.UInt8,\n\t\t\t\tlabel: `Level (${sceneId})`,\n\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"dimmingDuration\",\n\t\t\t\"dimmingDuration\",\n\t\t\t(sceneId: number) => sceneId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"dimmingDuration\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\t(sceneId: number) => ({\n\t\t\t\t...ValueMetadata.Duration,\n\t\t\t\tlabel: `Dimming duration (${sceneId})`,\n\t\t\t} as const),\n\t\t),\n\t},\n);\n\n@API(CommandClasses[\"Scene Actuator Configuration\"])\nexport class SceneActuatorConfigurationCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: SceneActuatorConfigurationCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase SceneActuatorConfigurationCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase SceneActuatorConfigurationCommand.Set:\n\t\t\t\treturn true;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: SceneActuatorConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t\toptions,\n\t\t) {\n\t\t\tif (propertyKey == undefined) {\n\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\tthrowUnsupportedPropertyKey(this.ccId, property, propertyKey);\n\t\t\t}\n\t\t\tif (property === \"level\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// We need to set the dimming duration along with the level.\n\t\t\t\t// Dimming duration is chosen with the following precedence:\n\t\t\t\t// 1. options.transitionDuration\n\t\t\t\t// 2. current stored value\n\t\t\t\t// 3. default\n\t\t\t\tconst dimmingDuration =\n\t\t\t\t\tDuration.from(options?.transitionDuration)\n\t\t\t\t\t\t?? this.tryGetValueDB()?.getValue<Duration>(\n\t\t\t\t\t\t\tSceneActuatorConfigurationCCValues.dimmingDuration(\n\t\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t\t\t);\n\t\t\t\treturn this.set(propertyKey, dimmingDuration, value);\n\t\t\t} else if (property === \"dimmingDuration\") {\n\t\t\t\tif (typeof value !== \"string\" && !Duration.isDuration(value)) {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"duration\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst dimmingDuration = Duration.from(value);\n\t\t\t\tif (dimmingDuration == undefined) {\n\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t`${\n\t\t\t\t\t\t\tgetCCName(\n\t\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}: \"${property}\" could not be set. ${\n\t\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} is not a valid duration.`,\n\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Must set the level along with the dimmingDuration,\n\t\t\t\t// Use saved value, if it's defined. Otherwise the default\n\t\t\t\t// will be used.\n\t\t\t\tconst level = this.tryGetValueDB()?.getValue<number>(\n\t\t\t\t\tSceneActuatorConfigurationCCValues.level(\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t);\n\n\t\t\t\treturn this.set(propertyKey, dimmingDuration, level);\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: SceneActuatorConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"level\":\n\t\t\t\tcase \"dimmingDuration\": {\n\t\t\t\t\tif (propertyKey == undefined) {\n\t\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn (await this.get(propertyKey))?.[property];\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tsceneId: number,\n\t\tdimmingDuration?: Duration | string,\n\t\tlevel?: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneActuatorConfigurationCommand,\n\t\t\tSceneActuatorConfigurationCommand.Set,\n\t\t);\n\n\t\t// Undefined `dimmingDuration` defaults to 0 seconds to simplify the call\n\t\t// for actuators that don't support non-instant `dimmingDuration`\n\t\t// Undefined `level` uses the actuator's current value (override = 0).\n\t\tconst cc = new SceneActuatorConfigurationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsceneId,\n\t\t\tdimmingDuration: Duration.from(dimmingDuration)\n\t\t\t\t?? new Duration(0, \"seconds\"),\n\t\t\tlevel,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getActive(): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tSceneActuatorConfigurationCCReport,\n\t\t\t\t\"sceneId\" | \"level\" | \"dimmingDuration\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneActuatorConfigurationCommand,\n\t\t\tSceneActuatorConfigurationCommand.Get,\n\t\t);\n\n\t\tconst cc = new SceneActuatorConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsceneId: 0,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tSceneActuatorConfigurationCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (response) {\n\t\t\treturn pick(response, [\"sceneId\", \"level\", \"dimmingDuration\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async get(\n\t\tsceneId: number,\n\t): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tSceneActuatorConfigurationCCReport,\n\t\t\t\t\"level\" | \"dimmingDuration\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneActuatorConfigurationCommand,\n\t\t\tSceneActuatorConfigurationCommand.Get,\n\t\t);\n\n\t\tif (sceneId === 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Invalid scene ID 0. To get the currently active scene, use getActive() instead.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new SceneActuatorConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsceneId: sceneId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tSceneActuatorConfigurationCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (response) {\n\t\t\treturn pick(response, [\"level\", \"dimmingDuration\"]);\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses[\"Scene Actuator Configuration\"])\n@implementedVersion(1)\n@ccValues(SceneActuatorConfigurationCCValues)\nexport class SceneActuatorConfigurationCC extends CommandClass {\n\tdeclare ccCommand: SceneActuatorConfigurationCommand;\n\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: `${this.constructor.name}: setting metadata`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Create Metadata for all scenes\n\t\tfor (let sceneId = 1; sceneId <= 255; sceneId++) {\n\t\t\tconst levelValue = SceneActuatorConfigurationCCValues.level(\n\t\t\t\tsceneId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, levelValue);\n\n\t\t\tconst dimmingDurationValue = SceneActuatorConfigurationCCValues\n\t\t\t\t.dimmingDuration(sceneId);\n\t\t\tthis.ensureMetadata(ctx, dimmingDurationValue);\n\t\t}\n\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\t// `refreshValues()` would create 255 `Get` commands to be issued to the node\n\t// Therefore, I think we should not implement it. Here is how it would be implemented\n\t//\n\t// public async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n\t// \tconst node = this.getNode(ctx)!;\n\t// \tconst endpoint = this.getEndpoint(ctx)!;\n\t// \tconst api = endpoint.commandClasses[\n\t// \t\t\"Scene Actuator Configuration\"\n\t// \t].withOptions({\n\t// \t\tpriority: MessagePriority.NodeQuery,\n\t// \t});\n\t// \tctx.logNode(node.id, {\n\t// \t\tmessage: \"querying all scene actuator configs...\",\n\t// \t\tdirection: \"outbound\",\n\t// \t});\n\t// \tfor (let sceneId = 1; sceneId <= 255; sceneId++) {\n\t// \t\tawait api.get(sceneId);\n\t// \t}\n\t// }\n}\n\n// @publicAPI\nexport interface SceneActuatorConfigurationCCSetOptions {\n\tsceneId: number;\n\tdimmingDuration: Duration;\n\tlevel?: number;\n}\n\n@CCCommand(SceneActuatorConfigurationCommand.Set)\n@useSupervision()\nexport class SceneActuatorConfigurationCCSet\n\textends SceneActuatorConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneActuatorConfigurationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.sceneId < 1 || options.sceneId > 255) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`The scene id ${options.sceneId} must be between 1 and 255!`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.sceneId = options.sceneId;\n\t\tthis.dimmingDuration = options.dimmingDuration;\n\t\tthis.level = options.level;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): SceneActuatorConfigurationCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new SceneActuatorConfigurationCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sceneId: number;\n\tpublic dimmingDuration: Duration;\n\tpublic level?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.sceneId,\n\t\t\tthis.dimmingDuration.serializeSet(),\n\t\t\tthis.level != undefined ? 0b1000_0000 : 0,\n\t\t\tthis.level ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tsceneId: this.sceneId,\n\t\t\tdimmingDuration: this.dimmingDuration.toString(),\n\t\t};\n\t\tif (this.level != undefined) {\n\t\t\tmessage.level = this.level;\n\t\t}\n\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface SceneActuatorConfigurationCCReportOptions {\n\tsceneId: number;\n\tlevel?: number;\n\tdimmingDuration?: Duration;\n}\n\n@CCCommand(SceneActuatorConfigurationCommand.Report)\nexport class SceneActuatorConfigurationCCReport\n\textends SceneActuatorConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneActuatorConfigurationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sceneId = options.sceneId;\n\t\tthis.level = options.level;\n\t\tthis.dimmingDuration = options.dimmingDuration;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): SceneActuatorConfigurationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst sceneId = raw.payload[0];\n\n\t\tlet level: number | undefined;\n\t\tlet dimmingDuration: Duration | undefined;\n\t\tif (sceneId !== 0) {\n\t\t\tlevel = raw.payload[1];\n\t\t\tdimmingDuration = Duration.parseReport(raw.payload[2])\n\t\t\t\t?? Duration.unknown();\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsceneId,\n\t\t\tlevel,\n\t\t\tdimmingDuration,\n\t\t});\n\t}\n\n\tpublic readonly sceneId: number;\n\tpublic readonly level?: number;\n\tpublic readonly dimmingDuration?: Duration;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Do not persist values for an inactive scene\n\t\tif (\n\t\t\tthis.sceneId === 0\n\t\t\t|| this.level == undefined\n\t\t\t|| this.dimmingDuration == undefined\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst levelValue = SceneActuatorConfigurationCCValues.level(\n\t\t\tthis.sceneId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, levelValue);\n\n\t\tconst dimmingDurationValue = SceneActuatorConfigurationCCValues\n\t\t\t.dimmingDuration(this.sceneId);\n\t\tthis.ensureMetadata(ctx, dimmingDurationValue);\n\n\t\tthis.setValue(ctx, levelValue, this.level);\n\t\tthis.setValue(ctx, dimmingDurationValue, this.dimmingDuration);\n\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tsceneId: this.sceneId,\n\t\t};\n\t\tif (this.dimmingDuration != undefined) {\n\t\t\tmessage.dimmingDuration = this.dimmingDuration.toString();\n\t\t}\n\t\tif (this.level != undefined) {\n\t\t\tmessage.level = this.level;\n\t\t}\n\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\nfunction testResponseForSceneActuatorConfigurationGet(\n\tsent: SceneActuatorConfigurationCCGet,\n\treceived: SceneActuatorConfigurationCCReport,\n) {\n\t// We expect a Scene Actuator Configuration Report that matches\n\t// the requested sceneId, unless groupId 0 was requested\n\treturn sent.sceneId === 0 || received.sceneId === sent.sceneId;\n}\n\n// @publicAPI\nexport interface SceneActuatorConfigurationCCGetOptions {\n\tsceneId: number;\n}\n\n@CCCommand(SceneActuatorConfigurationCommand.Get)\n@expectedCCResponse(\n\tSceneActuatorConfigurationCCReport,\n\ttestResponseForSceneActuatorConfigurationGet,\n)\nexport class SceneActuatorConfigurationCCGet\n\textends SceneActuatorConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneActuatorConfigurationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sceneId = options.sceneId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): SceneActuatorConfigurationCCGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new SceneActuatorConfigurationCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sceneId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.sceneId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"scene id\": this.sceneId },\n\t\t};\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAcO;AACP,oBAA4B;AAE5B,iBAUO;AACP,0BAKO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiCrC,mCAA+B,MAAA;8BAD3C,mCAAI,2BAAe,8BAA8B,CAAC,CAAC;;;;oBACC;;;;uDAAA,YAAK;WAAA;;;;;;;;yBAmHxD,iDAAA,CAAc;yBAwDd,iDAAA,CAAc;AAvDf,mBAAA,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;AAwDhB,mBAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QA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;;oBAEQ;uDAAA,YAA4B;WAAA;;;;;;;;AADrC,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IAGZ,YACC,SAA4D;AAE5D,YAAM,OAAO;AACb,WAAK,UAAU,QAAQ;IACxB;IAEO,OAAO,KACb,MACA,MAAsB;AAGtB,YAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;IAMhD;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,OAAO,CAAC;AACxC,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,YAAY,KAAK,QAAO;;IAErC;;;;",
4
+ "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\tDuration,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SceneActuatorConfigurationCommand } from \"../lib/_Types.js\";\n\nexport const SceneActuatorConfigurationCCValues = V.defineCCValues(\n\tCommandClasses[\"Scene Actuator Configuration\"],\n\t{\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"level\",\n\t\t\t\"level\",\n\t\t\t(sceneId: number) => sceneId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"level\" && typeof propertyKey === \"number\",\n\t\t\t(sceneId: number) => ({\n\t\t\t\t...ValueMetadata.UInt8,\n\t\t\t\tlabel: `Level (${sceneId})`,\n\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"dimmingDuration\",\n\t\t\t\"dimmingDuration\",\n\t\t\t(sceneId: number) => sceneId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"dimmingDuration\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\t(sceneId: number) => ({\n\t\t\t\t...ValueMetadata.Duration,\n\t\t\t\tlabel: `Dimming duration (${sceneId})`,\n\t\t\t} as const),\n\t\t),\n\t},\n);\n\n@API(CommandClasses[\"Scene Actuator Configuration\"])\nexport class SceneActuatorConfigurationCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: SceneActuatorConfigurationCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase SceneActuatorConfigurationCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase SceneActuatorConfigurationCommand.Set:\n\t\t\t\treturn true;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: SceneActuatorConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t\toptions,\n\t\t) {\n\t\t\tif (propertyKey == undefined) {\n\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\tthrowUnsupportedPropertyKey(this.ccId, property, propertyKey);\n\t\t\t}\n\t\t\tif (property === \"level\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// We need to set the dimming duration along with the level.\n\t\t\t\t// Dimming duration is chosen with the following precedence:\n\t\t\t\t// 1. options.transitionDuration\n\t\t\t\t// 2. current stored value\n\t\t\t\t// 3. default\n\t\t\t\tconst dimmingDuration =\n\t\t\t\t\tDuration.from(options?.transitionDuration)\n\t\t\t\t\t\t?? this.tryGetValueDB()?.getValue<Duration>(\n\t\t\t\t\t\t\tSceneActuatorConfigurationCCValues.dimmingDuration(\n\t\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t\t\t);\n\t\t\t\treturn this.set(propertyKey, dimmingDuration, value);\n\t\t\t} else if (property === \"dimmingDuration\") {\n\t\t\t\tif (typeof value !== \"string\" && !Duration.isDuration(value)) {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"duration\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst dimmingDuration = Duration.from(value);\n\t\t\t\tif (dimmingDuration == undefined) {\n\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t`${\n\t\t\t\t\t\t\tgetCCName(\n\t\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}: \"${property}\" could not be set. ${\n\t\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} is not a valid duration.`,\n\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Must set the level along with the dimmingDuration,\n\t\t\t\t// Use saved value, if it's defined. Otherwise the default\n\t\t\t\t// will be used.\n\t\t\t\tconst level = this.tryGetValueDB()?.getValue<number>(\n\t\t\t\t\tSceneActuatorConfigurationCCValues.level(\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t);\n\n\t\t\t\treturn this.set(propertyKey, dimmingDuration, level);\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: SceneActuatorConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"level\":\n\t\t\t\tcase \"dimmingDuration\": {\n\t\t\t\t\tif (propertyKey == undefined) {\n\t\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn (await this.get(propertyKey))?.[property];\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tsceneId: number,\n\t\tdimmingDuration?: Duration | string,\n\t\tlevel?: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneActuatorConfigurationCommand,\n\t\t\tSceneActuatorConfigurationCommand.Set,\n\t\t);\n\n\t\t// Undefined `dimmingDuration` defaults to 0 seconds to simplify the call\n\t\t// for actuators that don't support non-instant `dimmingDuration`\n\t\t// Undefined `level` uses the actuator's current value (override = 0).\n\t\tconst cc = new SceneActuatorConfigurationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsceneId,\n\t\t\tdimmingDuration: Duration.from(dimmingDuration)\n\t\t\t\t?? new Duration(0, \"seconds\"),\n\t\t\tlevel,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getActive(): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tSceneActuatorConfigurationCCReport,\n\t\t\t\t\"sceneId\" | \"level\" | \"dimmingDuration\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneActuatorConfigurationCommand,\n\t\t\tSceneActuatorConfigurationCommand.Get,\n\t\t);\n\n\t\tconst cc = new SceneActuatorConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsceneId: 0,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tSceneActuatorConfigurationCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (response) {\n\t\t\treturn pick(response, [\"sceneId\", \"level\", \"dimmingDuration\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async get(\n\t\tsceneId: number,\n\t): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tSceneActuatorConfigurationCCReport,\n\t\t\t\t\"level\" | \"dimmingDuration\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneActuatorConfigurationCommand,\n\t\t\tSceneActuatorConfigurationCommand.Get,\n\t\t);\n\n\t\tif (sceneId === 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Invalid scene ID 0. To get the currently active scene, use getActive() instead.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new SceneActuatorConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsceneId: sceneId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tSceneActuatorConfigurationCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (response) {\n\t\t\treturn pick(response, [\"level\", \"dimmingDuration\"]);\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses[\"Scene Actuator Configuration\"])\n@implementedVersion(1)\n@ccValues(SceneActuatorConfigurationCCValues)\nexport class SceneActuatorConfigurationCC extends CommandClass {\n\tdeclare ccCommand: SceneActuatorConfigurationCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: `${this.constructor.name}: setting metadata`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Create Metadata for all scenes\n\t\tfor (let sceneId = 1; sceneId <= 255; sceneId++) {\n\t\t\tconst levelValue = SceneActuatorConfigurationCCValues.level(\n\t\t\t\tsceneId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, levelValue);\n\n\t\t\tconst dimmingDurationValue = SceneActuatorConfigurationCCValues\n\t\t\t\t.dimmingDuration(sceneId);\n\t\t\tthis.ensureMetadata(ctx, dimmingDurationValue);\n\t\t}\n\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\t// `refreshValues()` would create 255 `Get` commands to be issued to the node\n\t// Therefore, I think we should not implement it. Here is how it would be implemented\n\t//\n\t// public async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n\t// \tconst node = this.getNode(ctx)!;\n\t// \tconst endpoint = this.getEndpoint(ctx)!;\n\t// \tconst api = endpoint.commandClasses[\n\t// \t\t\"Scene Actuator Configuration\"\n\t// \t].withOptions({\n\t// \t\tpriority: MessagePriority.NodeQuery,\n\t// \t});\n\t// \tctx.logNode(node.id, {\n\t// \t\tmessage: \"querying all scene actuator configs...\",\n\t// \t\tdirection: \"outbound\",\n\t// \t});\n\t// \tfor (let sceneId = 1; sceneId <= 255; sceneId++) {\n\t// \t\tawait api.get(sceneId);\n\t// \t}\n\t// }\n}\n\n// @publicAPI\nexport interface SceneActuatorConfigurationCCSetOptions {\n\tsceneId: number;\n\tdimmingDuration: Duration;\n\tlevel?: number;\n}\n\n@CCCommand(SceneActuatorConfigurationCommand.Set)\n@useSupervision()\nexport class SceneActuatorConfigurationCCSet\n\textends SceneActuatorConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneActuatorConfigurationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.sceneId < 1 || options.sceneId > 255) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`The scene id ${options.sceneId} must be between 1 and 255!`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.sceneId = options.sceneId;\n\t\tthis.dimmingDuration = options.dimmingDuration;\n\t\tthis.level = options.level;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): SceneActuatorConfigurationCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new SceneActuatorConfigurationCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sceneId: number;\n\tpublic dimmingDuration: Duration;\n\tpublic level?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.sceneId,\n\t\t\tthis.dimmingDuration.serializeSet(),\n\t\t\tthis.level != undefined ? 0b1000_0000 : 0,\n\t\t\tthis.level ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tsceneId: this.sceneId,\n\t\t\tdimmingDuration: this.dimmingDuration.toString(),\n\t\t};\n\t\tif (this.level != undefined) {\n\t\t\tmessage.level = this.level;\n\t\t}\n\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface SceneActuatorConfigurationCCReportOptions {\n\tsceneId: number;\n\tlevel?: number;\n\tdimmingDuration?: Duration;\n}\n\n@CCCommand(SceneActuatorConfigurationCommand.Report)\nexport class SceneActuatorConfigurationCCReport\n\textends SceneActuatorConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneActuatorConfigurationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sceneId = options.sceneId;\n\t\tthis.level = options.level;\n\t\tthis.dimmingDuration = options.dimmingDuration;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): SceneActuatorConfigurationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst sceneId = raw.payload[0];\n\n\t\tlet level: number | undefined;\n\t\tlet dimmingDuration: Duration | undefined;\n\t\tif (sceneId !== 0) {\n\t\t\tlevel = raw.payload[1];\n\t\t\tdimmingDuration = Duration.parseReport(raw.payload[2])\n\t\t\t\t?? Duration.unknown();\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsceneId,\n\t\t\tlevel,\n\t\t\tdimmingDuration,\n\t\t});\n\t}\n\n\tpublic readonly sceneId: number;\n\tpublic readonly level?: number;\n\tpublic readonly dimmingDuration?: Duration;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Do not persist values for an inactive scene\n\t\tif (\n\t\t\tthis.sceneId === 0\n\t\t\t|| this.level == undefined\n\t\t\t|| this.dimmingDuration == undefined\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst levelValue = SceneActuatorConfigurationCCValues.level(\n\t\t\tthis.sceneId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, levelValue);\n\n\t\tconst dimmingDurationValue = SceneActuatorConfigurationCCValues\n\t\t\t.dimmingDuration(this.sceneId);\n\t\tthis.ensureMetadata(ctx, dimmingDurationValue);\n\n\t\tthis.setValue(ctx, levelValue, this.level);\n\t\tthis.setValue(ctx, dimmingDurationValue, this.dimmingDuration);\n\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tsceneId: this.sceneId,\n\t\t};\n\t\tif (this.dimmingDuration != undefined) {\n\t\t\tmessage.dimmingDuration = this.dimmingDuration.toString();\n\t\t}\n\t\tif (this.level != undefined) {\n\t\t\tmessage.level = this.level;\n\t\t}\n\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\nfunction testResponseForSceneActuatorConfigurationGet(\n\tsent: SceneActuatorConfigurationCCGet,\n\treceived: SceneActuatorConfigurationCCReport,\n) {\n\t// We expect a Scene Actuator Configuration Report that matches\n\t// the requested sceneId, unless groupId 0 was requested\n\treturn sent.sceneId === 0 || received.sceneId === sent.sceneId;\n}\n\n// @publicAPI\nexport interface SceneActuatorConfigurationCCGetOptions {\n\tsceneId: number;\n}\n\n@CCCommand(SceneActuatorConfigurationCommand.Get)\n@expectedCCResponse(\n\tSceneActuatorConfigurationCCReport,\n\ttestResponseForSceneActuatorConfigurationGet,\n)\nexport class SceneActuatorConfigurationCCGet\n\textends SceneActuatorConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneActuatorConfigurationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sceneId = options.sceneId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): SceneActuatorConfigurationCCGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new SceneActuatorConfigurationCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sceneId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.sceneId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"scene id\": this.sceneId },\n\t\t};\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAcO;AACP,oBAA4B;AAE5B,iBAUO;AACP,0BAKO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiCrC,mCAA+B,MAAA;8BAD3C,mCAAI,2BAAe,8BAA8B,CAAC,CAAC;;;;oBACC;;;;uDAAA,YAAK;WAAA;;;;;;;;yBAmHxD,iDAAA,CAAc;yBAwDd,iDAAA,CAAc;AAvDf,mBAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA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AO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB;;IAEF;;;;AAGD,SAAS,6CACR,MACA,UAA4C;AAI5C,SAAO,KAAK,YAAY,KAAK,SAAS,YAAY,KAAK;AACxD;AAPS;IAmBI,mCAA+B,MAAA;8BAL3C,yCAAU,+CAAkC,GAAG,OAC/C,kDACA,oCACA,4CAA4C,CAC5C;;;;oBAEQ;uDAAA,YAA4B;WAAA;;;;;;;;AADrC,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IAGZ,YACC,SAA4D;AAE5D,YAAM,OAAO;AACb,WAAK,UAAU,QAAQ;IACxB;IAEO,OAAO,KACb,MACA,MAAsB;AAGtB,YAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;IAMhD;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,OAAO,CAAC;AACxC,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,YAAY,KAAK,QAAO;;IAErC;;;;",
6
6
  "names": []
7
7
  }
@@ -269,7 +269,6 @@ let SceneControllerConfigurationCC = (() => {
269
269
  import_core.CommandClasses.Association
270
270
  ];
271
271
  }
272
- // eslint-disable-next-line @typescript-eslint/require-await
273
272
  async interview(ctx) {
274
273
  const node = this.getNode(ctx);
275
274
  const endpoint = this.getEndpoint(ctx);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cc/SceneControllerConfigurationCC.ts"],
4
- "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\tDuration,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SceneControllerConfigurationCommand } from \"../lib/_Types.js\";\nimport { AssociationCC } from \"./AssociationCC.js\";\n\nexport const SceneControllerConfigurationCCValues = V.defineCCValues(\n\tCommandClasses[\"Scene Controller Configuration\"],\n\t{\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"sceneId\",\n\t\t\t\"sceneId\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"sceneId\" && typeof propertyKey === \"number\",\n\t\t\t(groupId: number) => ({\n\t\t\t\t...ValueMetadata.UInt8,\n\t\t\t\tlabel: `Associated Scene ID (${groupId})`,\n\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"dimmingDuration\",\n\t\t\t\"dimmingDuration\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"dimmingDuration\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\t(groupId: number) => ({\n\t\t\t\t...ValueMetadata.Duration,\n\t\t\t\tlabel: `Dimming duration (${groupId})`,\n\t\t\t} as const),\n\t\t),\n\t},\n);\n\n@API(CommandClasses[\"Scene Controller Configuration\"])\nexport class SceneControllerConfigurationCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: SceneControllerConfigurationCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase SceneControllerConfigurationCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase SceneControllerConfigurationCommand.Set:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: SceneControllerConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t\toptions,\n\t\t) {\n\t\t\tif (propertyKey == undefined) {\n\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\tthrowUnsupportedPropertyKey(this.ccId, property, propertyKey);\n\t\t\t}\n\t\t\tif (property === \"sceneId\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\t// Disable Group ID / Scene ID\n\t\t\t\t\treturn this.disable(propertyKey);\n\t\t\t\t} else {\n\t\t\t\t\t// We need to set the dimming duration along with the scene ID\n\t\t\t\t\t// Dimming duration is chosen with the following precedence:\n\t\t\t\t\t// 1. options.transitionDuration\n\t\t\t\t\t// 2. current stored value\n\t\t\t\t\t// 3. default value\n\t\t\t\t\tconst dimmingDuration =\n\t\t\t\t\t\tDuration.from(options?.transitionDuration)\n\t\t\t\t\t\t\t?? this.tryGetValueDB()?.getValue<Duration>(\n\t\t\t\t\t\t\t\tSceneControllerConfigurationCCValues\n\t\t\t\t\t\t\t\t\t.dimmingDuration(\n\t\t\t\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t?? Duration.default();\n\t\t\t\t\treturn this.set(propertyKey, value, dimmingDuration);\n\t\t\t\t}\n\t\t\t} else if (property === \"dimmingDuration\") {\n\t\t\t\tif (typeof value !== \"string\" && !Duration.isDuration(value)) {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"duration\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst dimmingDuration = Duration.from(value);\n\t\t\t\tif (dimmingDuration == undefined) {\n\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t`${\n\t\t\t\t\t\t\tgetCCName(\n\t\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}: \"${property}\" could not be set. ${\n\t\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} is not a valid duration.`,\n\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst valueDB = this.tryGetValueDB();\n\t\t\t\tconst sceneId = valueDB?.getValue<number>(\n\t\t\t\t\tSceneControllerConfigurationCCValues.sceneId(\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t);\n\t\t\t\tif (sceneId == undefined || sceneId === 0) {\n\t\t\t\t\tif (valueDB) {\n\t\t\t\t\t\t// Can't actually send dimmingDuration without valid sceneId\n\t\t\t\t\t\t// So we save it in the valueDB without sending it to the node\n\t\t\t\t\t\tconst dimmingDurationValueId =\n\t\t\t\t\t\t\tSceneControllerConfigurationCCValues\n\t\t\t\t\t\t\t\t.dimmingDuration(\n\t\t\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t\t\t).endpoint(this.endpoint.index);\n\t\t\t\t\t\tvalueDB.setValue(\n\t\t\t\t\t\t\tdimmingDurationValueId,\n\t\t\t\t\t\t\tdimmingDuration,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn this.set(propertyKey, sceneId, dimmingDuration);\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: SceneControllerConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"sceneId\":\n\t\t\t\tcase \"dimmingDuration\": {\n\t\t\t\t\tif (propertyKey == undefined) {\n\t\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn (await this.get(propertyKey))?.[property];\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t@validateArgs()\n\tpublic async disable(\n\t\tgroupId: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneControllerConfigurationCommand,\n\t\t\tSceneControllerConfigurationCommand.Set,\n\t\t);\n\n\t\treturn this.set(groupId, 0, new Duration(0, \"seconds\"));\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tgroupId: number,\n\t\tsceneId: number,\n\t\tdimmingDuration?: Duration | string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneControllerConfigurationCommand,\n\t\t\tSceneControllerConfigurationCommand.Set,\n\t\t);\n\n\t\tif (!this.endpoint.virtual) {\n\t\t\tconst groupCount = SceneControllerConfigurationCC\n\t\t\t\t.getGroupCountCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t);\n\n\t\t\t// The client SHOULD NOT specify group 1 (the life-line group).\n\t\t\t// We don't block it here, because the specs don't forbid it,\n\t\t\t// and it may be needed for some devices.\n\t\t\tif (groupId < 1 || groupId > groupCount) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`${this.constructor.name}: The group ID must be between 1 and the number of supported groups ${groupCount}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`The group ID must be greater than 0.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new SceneControllerConfigurationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tsceneId,\n\t\t\tdimmingDuration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getLastActivated(): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tSceneControllerConfigurationCCReport,\n\t\t\t\t\"groupId\" | \"sceneId\" | \"dimmingDuration\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneControllerConfigurationCommand,\n\t\t\tSceneControllerConfigurationCommand.Get,\n\t\t);\n\n\t\tconst cc = new SceneControllerConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId: 0,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tSceneControllerConfigurationCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\t// Return value includes \"groupId\", because\n\t\t// the returned report will include the actual groupId of the\n\t\t// last activated groupId / sceneId\n\t\tif (response) {\n\t\t\treturn pick(response, [\"groupId\", \"sceneId\", \"dimmingDuration\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async get(\n\t\tgroupId: number,\n\t): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tSceneControllerConfigurationCCReport,\n\t\t\t\t\"sceneId\" | \"dimmingDuration\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneControllerConfigurationCommand,\n\t\t\tSceneControllerConfigurationCommand.Get,\n\t\t);\n\n\t\tif (groupId === 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Invalid group ID 0. To get the last activated group / scene, use getLastActivated() instead.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t} else if (groupId < 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`The group ID must be greater than 0.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new SceneControllerConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tSceneControllerConfigurationCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\t// Since groupId is not allowed to be 0, only Reports with\n\t\t// groupId equal to the requested groupId will be accepted,\n\t\t// so we can omit groupId from the return.\n\t\tif (response) {\n\t\t\treturn pick(response, [\"sceneId\", \"dimmingDuration\"]);\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses[\"Scene Controller Configuration\"])\n@implementedVersion(1)\n@ccValues(SceneControllerConfigurationCCValues)\nexport class SceneControllerConfigurationCC extends CommandClass {\n\tdeclare ccCommand: SceneControllerConfigurationCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// AssociationCC is required and MUST be interviewed\n\t\t// before SceneControllerConfigurationCC to supply groupCount\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t];\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst groupCount = SceneControllerConfigurationCC.getGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tif (groupCount === 0) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`skipping Scene Controller Configuration interview because Association group count is unknown`,\n\t\t\t\tdirection: \"none\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Create metadata for each scene, but don't query their actual configuration\n\t\t// since some devices only support setting scenes\n\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\tconst sceneIdValue = SceneControllerConfigurationCCValues.sceneId(\n\t\t\t\tgroupId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, sceneIdValue);\n\n\t\t\tconst dimmingDurationValue = SceneControllerConfigurationCCValues\n\t\t\t\t.dimmingDuration(groupId);\n\t\t\tthis.ensureMetadata(ctx, dimmingDurationValue);\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Scene Controller Configuration\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst groupCount = SceneControllerConfigurationCC.getGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"querying all scene controller configurations...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`querying scene configuration for group #${groupId}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst group = await api.get(groupId);\n\t\t\tif (group != undefined) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`received scene configuration for group #${groupId}:\nscene ID: ${group.sceneId}\ndimming duration: ${group.dimmingDuration.toString()}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns the number of association groups reported by the node.\n\t * This only works AFTER the node has been interviewed by this CC\n\t * or the AssociationCC.\n\t */\n\tpublic static getGroupCountCached(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx.getDeviceConfig?.(endpoint.nodeId)?.compat\n\t\t\t?.forceSceneControllerGroupCount\n\t\t\t?? AssociationCC.getGroupCountCached(ctx, endpoint)\n\t\t\t?? 0;\n\t}\n}\n\n// @publicAPI\nexport interface SceneControllerConfigurationCCSetOptions {\n\tgroupId: number;\n\tsceneId: number;\n\tdimmingDuration?: Duration | string;\n}\n\n@CCCommand(SceneControllerConfigurationCommand.Set)\n@useSupervision()\nexport class SceneControllerConfigurationCCSet\n\textends SceneControllerConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneControllerConfigurationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.groupId = options.groupId;\n\t\tthis.sceneId = options.sceneId;\n\t\t// if dimmingDuration was missing, use default duration.\n\t\tthis.dimmingDuration = Duration.from(options.dimmingDuration)\n\t\t\t?? Duration.default();\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): SceneControllerConfigurationCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new SceneControllerConfigurationCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic groupId: number;\n\tpublic sceneId: number;\n\tpublic dimmingDuration: Duration;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId,\n\t\t\tthis.sceneId,\n\t\t\tthis.dimmingDuration.serializeSet(),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\t\"scene id\": this.sceneId,\n\t\t\t\t\"dimming duration\": this.dimmingDuration.toString(),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface SceneControllerConfigurationCCReportOptions {\n\tgroupId: number;\n\tsceneId: number;\n\tdimmingDuration: Duration;\n}\n\n@CCCommand(SceneControllerConfigurationCommand.Report)\nexport class SceneControllerConfigurationCCReport\n\textends SceneControllerConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneControllerConfigurationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.groupId = options.groupId;\n\t\tthis.sceneId = options.sceneId;\n\t\tthis.dimmingDuration = options.dimmingDuration;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): SceneControllerConfigurationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst groupId = raw.payload[0];\n\t\tconst sceneId = raw.payload[1];\n\t\tconst dimmingDuration: Duration = Duration.parseReport(raw.payload[2])\n\t\t\t?? Duration.unknown();\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tsceneId,\n\t\t\tdimmingDuration,\n\t\t});\n\t}\n\n\tpublic readonly groupId: number;\n\tpublic readonly sceneId: number;\n\tpublic readonly dimmingDuration: Duration;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// If groupId = 0, values are meaningless\n\t\tif (this.groupId === 0) return false;\n\n\t\tconst sceneIdValue = SceneControllerConfigurationCCValues.sceneId(\n\t\t\tthis.groupId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, sceneIdValue);\n\t\tconst dimmingDurationValue = SceneControllerConfigurationCCValues\n\t\t\t.dimmingDuration(this.groupId);\n\t\tthis.ensureMetadata(ctx, dimmingDurationValue);\n\n\t\tthis.setValue(ctx, sceneIdValue, this.sceneId);\n\t\tthis.setValue(ctx, dimmingDurationValue, this.dimmingDuration);\n\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\t\"scene id\": this.sceneId,\n\t\t\t\t\"dimming duration\": this.dimmingDuration.toString(),\n\t\t\t},\n\t\t};\n\t}\n}\n\nfunction testResponseForSceneControllerConfigurationGet(\n\tsent: SceneControllerConfigurationCCGet,\n\treceived: SceneControllerConfigurationCCReport,\n) {\n\t// We expect a Scene Controller Configuration Report that matches\n\t// the requested groupId, unless groupId 0 was requested\n\treturn sent.groupId === 0 || received.groupId === sent.groupId;\n}\n\n// @publicAPI\nexport interface SceneControllerConfigurationCCGetOptions {\n\tgroupId: number;\n}\n\n@CCCommand(SceneControllerConfigurationCommand.Get)\n@expectedCCResponse(\n\tSceneControllerConfigurationCCReport,\n\ttestResponseForSceneControllerConfigurationGet,\n)\nexport class SceneControllerConfigurationCCGet\n\textends SceneControllerConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneControllerConfigurationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): SceneControllerConfigurationCCGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new SceneControllerConfigurationCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic groupId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.groupId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"group id\": this.groupId },\n\t\t};\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAeO;AACP,oBAA4B;AAE5B,iBAUO;AACP,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAoD;AACpD,2BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiCjB,qCAAiC,MAAA;8BAD7C,mCAAI,2BAAe,gCAAgC,CAAC,CAAC;;;;oBACC;;;;;yDAAA,YAAK;WAAA;;;;;;;;6BAwI1D,uDAAA,CAAc;yBAYd,mDAAA,CAAc;yBA8Ed,mDAAA,CAAc;AAzFf,mBAAA,MAAA,MAAA,qBAAA,EAAA,MAAA,UAAA,MAAA,WAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,aAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,SAAb,OAAoB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAYpB,mBAAA,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;AA8EhB,mBAAA,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;AAnOjB,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,k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C,GAAG,OACjD,kDACA,sCACA,8CAA8C,CAC9C;;;;oBAEQ;yDAAA,YAA8B;WAAA;;;;;;;;AADvC,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IAGZ,YACC,SAA8D;AAE9D,YAAM,OAAO;AACb,WAAK,UAAU,QAAQ;IACxB;IAEO,OAAO,KACb,MACA,MAAsB;AAGtB,YAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;IAMhD;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,OAAO,CAAC;AACxC,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,YAAY,KAAK,QAAO;;IAErC;;;;",
4
+ "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\tDuration,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SceneControllerConfigurationCommand } from \"../lib/_Types.js\";\nimport { AssociationCC } from \"./AssociationCC.js\";\n\nexport const SceneControllerConfigurationCCValues = V.defineCCValues(\n\tCommandClasses[\"Scene Controller Configuration\"],\n\t{\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"sceneId\",\n\t\t\t\"sceneId\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"sceneId\" && typeof propertyKey === \"number\",\n\t\t\t(groupId: number) => ({\n\t\t\t\t...ValueMetadata.UInt8,\n\t\t\t\tlabel: `Associated Scene ID (${groupId})`,\n\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"dimmingDuration\",\n\t\t\t\"dimmingDuration\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"dimmingDuration\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\t(groupId: number) => ({\n\t\t\t\t...ValueMetadata.Duration,\n\t\t\t\tlabel: `Dimming duration (${groupId})`,\n\t\t\t} as const),\n\t\t),\n\t},\n);\n\n@API(CommandClasses[\"Scene Controller Configuration\"])\nexport class SceneControllerConfigurationCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: SceneControllerConfigurationCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase SceneControllerConfigurationCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase SceneControllerConfigurationCommand.Set:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: SceneControllerConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t\toptions,\n\t\t) {\n\t\t\tif (propertyKey == undefined) {\n\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\tthrowUnsupportedPropertyKey(this.ccId, property, propertyKey);\n\t\t\t}\n\t\t\tif (property === \"sceneId\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\t// Disable Group ID / Scene ID\n\t\t\t\t\treturn this.disable(propertyKey);\n\t\t\t\t} else {\n\t\t\t\t\t// We need to set the dimming duration along with the scene ID\n\t\t\t\t\t// Dimming duration is chosen with the following precedence:\n\t\t\t\t\t// 1. options.transitionDuration\n\t\t\t\t\t// 2. current stored value\n\t\t\t\t\t// 3. default value\n\t\t\t\t\tconst dimmingDuration =\n\t\t\t\t\t\tDuration.from(options?.transitionDuration)\n\t\t\t\t\t\t\t?? this.tryGetValueDB()?.getValue<Duration>(\n\t\t\t\t\t\t\t\tSceneControllerConfigurationCCValues\n\t\t\t\t\t\t\t\t\t.dimmingDuration(\n\t\t\t\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t?? Duration.default();\n\t\t\t\t\treturn this.set(propertyKey, value, dimmingDuration);\n\t\t\t\t}\n\t\t\t} else if (property === \"dimmingDuration\") {\n\t\t\t\tif (typeof value !== \"string\" && !Duration.isDuration(value)) {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"duration\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst dimmingDuration = Duration.from(value);\n\t\t\t\tif (dimmingDuration == undefined) {\n\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t`${\n\t\t\t\t\t\t\tgetCCName(\n\t\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}: \"${property}\" could not be set. ${\n\t\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} is not a valid duration.`,\n\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst valueDB = this.tryGetValueDB();\n\t\t\t\tconst sceneId = valueDB?.getValue<number>(\n\t\t\t\t\tSceneControllerConfigurationCCValues.sceneId(\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t);\n\t\t\t\tif (sceneId == undefined || sceneId === 0) {\n\t\t\t\t\tif (valueDB) {\n\t\t\t\t\t\t// Can't actually send dimmingDuration without valid sceneId\n\t\t\t\t\t\t// So we save it in the valueDB without sending it to the node\n\t\t\t\t\t\tconst dimmingDurationValueId =\n\t\t\t\t\t\t\tSceneControllerConfigurationCCValues\n\t\t\t\t\t\t\t\t.dimmingDuration(\n\t\t\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t\t\t).endpoint(this.endpoint.index);\n\t\t\t\t\t\tvalueDB.setValue(\n\t\t\t\t\t\t\tdimmingDurationValueId,\n\t\t\t\t\t\t\tdimmingDuration,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn this.set(propertyKey, sceneId, dimmingDuration);\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: SceneControllerConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"sceneId\":\n\t\t\t\tcase \"dimmingDuration\": {\n\t\t\t\t\tif (propertyKey == undefined) {\n\t\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn (await this.get(propertyKey))?.[property];\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t@validateArgs()\n\tpublic async disable(\n\t\tgroupId: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneControllerConfigurationCommand,\n\t\t\tSceneControllerConfigurationCommand.Set,\n\t\t);\n\n\t\treturn this.set(groupId, 0, new Duration(0, \"seconds\"));\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tgroupId: number,\n\t\tsceneId: number,\n\t\tdimmingDuration?: Duration | string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneControllerConfigurationCommand,\n\t\t\tSceneControllerConfigurationCommand.Set,\n\t\t);\n\n\t\tif (!this.endpoint.virtual) {\n\t\t\tconst groupCount = SceneControllerConfigurationCC\n\t\t\t\t.getGroupCountCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t);\n\n\t\t\t// The client SHOULD NOT specify group 1 (the life-line group).\n\t\t\t// We don't block it here, because the specs don't forbid it,\n\t\t\t// and it may be needed for some devices.\n\t\t\tif (groupId < 1 || groupId > groupCount) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`${this.constructor.name}: The group ID must be between 1 and the number of supported groups ${groupCount}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`The group ID must be greater than 0.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new SceneControllerConfigurationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tsceneId,\n\t\t\tdimmingDuration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getLastActivated(): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tSceneControllerConfigurationCCReport,\n\t\t\t\t\"groupId\" | \"sceneId\" | \"dimmingDuration\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneControllerConfigurationCommand,\n\t\t\tSceneControllerConfigurationCommand.Get,\n\t\t);\n\n\t\tconst cc = new SceneControllerConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId: 0,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tSceneControllerConfigurationCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\t// Return value includes \"groupId\", because\n\t\t// the returned report will include the actual groupId of the\n\t\t// last activated groupId / sceneId\n\t\tif (response) {\n\t\t\treturn pick(response, [\"groupId\", \"sceneId\", \"dimmingDuration\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async get(\n\t\tgroupId: number,\n\t): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tSceneControllerConfigurationCCReport,\n\t\t\t\t\"sceneId\" | \"dimmingDuration\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tSceneControllerConfigurationCommand,\n\t\t\tSceneControllerConfigurationCommand.Get,\n\t\t);\n\n\t\tif (groupId === 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Invalid group ID 0. To get the last activated group / scene, use getLastActivated() instead.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t} else if (groupId < 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`The group ID must be greater than 0.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new SceneControllerConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tSceneControllerConfigurationCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\t// Since groupId is not allowed to be 0, only Reports with\n\t\t// groupId equal to the requested groupId will be accepted,\n\t\t// so we can omit groupId from the return.\n\t\tif (response) {\n\t\t\treturn pick(response, [\"sceneId\", \"dimmingDuration\"]);\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses[\"Scene Controller Configuration\"])\n@implementedVersion(1)\n@ccValues(SceneControllerConfigurationCCValues)\nexport class SceneControllerConfigurationCC extends CommandClass {\n\tdeclare ccCommand: SceneControllerConfigurationCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// AssociationCC is required and MUST be interviewed\n\t\t// before SceneControllerConfigurationCC to supply groupCount\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t];\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst groupCount = SceneControllerConfigurationCC.getGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tif (groupCount === 0) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`skipping Scene Controller Configuration interview because Association group count is unknown`,\n\t\t\t\tdirection: \"none\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Create metadata for each scene, but don't query their actual configuration\n\t\t// since some devices only support setting scenes\n\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\tconst sceneIdValue = SceneControllerConfigurationCCValues.sceneId(\n\t\t\t\tgroupId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, sceneIdValue);\n\n\t\t\tconst dimmingDurationValue = SceneControllerConfigurationCCValues\n\t\t\t\t.dimmingDuration(groupId);\n\t\t\tthis.ensureMetadata(ctx, dimmingDurationValue);\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Scene Controller Configuration\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst groupCount = SceneControllerConfigurationCC.getGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"querying all scene controller configurations...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`querying scene configuration for group #${groupId}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst group = await api.get(groupId);\n\t\t\tif (group != undefined) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`received scene configuration for group #${groupId}:\nscene ID: ${group.sceneId}\ndimming duration: ${group.dimmingDuration.toString()}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns the number of association groups reported by the node.\n\t * This only works AFTER the node has been interviewed by this CC\n\t * or the AssociationCC.\n\t */\n\tpublic static getGroupCountCached(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx.getDeviceConfig?.(endpoint.nodeId)?.compat\n\t\t\t?.forceSceneControllerGroupCount\n\t\t\t?? AssociationCC.getGroupCountCached(ctx, endpoint)\n\t\t\t?? 0;\n\t}\n}\n\n// @publicAPI\nexport interface SceneControllerConfigurationCCSetOptions {\n\tgroupId: number;\n\tsceneId: number;\n\tdimmingDuration?: Duration | string;\n}\n\n@CCCommand(SceneControllerConfigurationCommand.Set)\n@useSupervision()\nexport class SceneControllerConfigurationCCSet\n\textends SceneControllerConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneControllerConfigurationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.groupId = options.groupId;\n\t\tthis.sceneId = options.sceneId;\n\t\t// if dimmingDuration was missing, use default duration.\n\t\tthis.dimmingDuration = Duration.from(options.dimmingDuration)\n\t\t\t?? Duration.default();\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): SceneControllerConfigurationCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new SceneControllerConfigurationCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic groupId: number;\n\tpublic sceneId: number;\n\tpublic dimmingDuration: Duration;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId,\n\t\t\tthis.sceneId,\n\t\t\tthis.dimmingDuration.serializeSet(),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\t\"scene id\": this.sceneId,\n\t\t\t\t\"dimming duration\": this.dimmingDuration.toString(),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface SceneControllerConfigurationCCReportOptions {\n\tgroupId: number;\n\tsceneId: number;\n\tdimmingDuration: Duration;\n}\n\n@CCCommand(SceneControllerConfigurationCommand.Report)\nexport class SceneControllerConfigurationCCReport\n\textends SceneControllerConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneControllerConfigurationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.groupId = options.groupId;\n\t\tthis.sceneId = options.sceneId;\n\t\tthis.dimmingDuration = options.dimmingDuration;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): SceneControllerConfigurationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst groupId = raw.payload[0];\n\t\tconst sceneId = raw.payload[1];\n\t\tconst dimmingDuration: Duration = Duration.parseReport(raw.payload[2])\n\t\t\t?? Duration.unknown();\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tsceneId,\n\t\t\tdimmingDuration,\n\t\t});\n\t}\n\n\tpublic readonly groupId: number;\n\tpublic readonly sceneId: number;\n\tpublic readonly dimmingDuration: Duration;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// If groupId = 0, values are meaningless\n\t\tif (this.groupId === 0) return false;\n\n\t\tconst sceneIdValue = SceneControllerConfigurationCCValues.sceneId(\n\t\t\tthis.groupId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, sceneIdValue);\n\t\tconst dimmingDurationValue = SceneControllerConfigurationCCValues\n\t\t\t.dimmingDuration(this.groupId);\n\t\tthis.ensureMetadata(ctx, dimmingDurationValue);\n\n\t\tthis.setValue(ctx, sceneIdValue, this.sceneId);\n\t\tthis.setValue(ctx, dimmingDurationValue, this.dimmingDuration);\n\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\t\"scene id\": this.sceneId,\n\t\t\t\t\"dimming duration\": this.dimmingDuration.toString(),\n\t\t\t},\n\t\t};\n\t}\n}\n\nfunction testResponseForSceneControllerConfigurationGet(\n\tsent: SceneControllerConfigurationCCGet,\n\treceived: SceneControllerConfigurationCCReport,\n) {\n\t// We expect a Scene Controller Configuration Report that matches\n\t// the requested groupId, unless groupId 0 was requested\n\treturn sent.groupId === 0 || received.groupId === sent.groupId;\n}\n\n// @publicAPI\nexport interface SceneControllerConfigurationCCGetOptions {\n\tgroupId: number;\n}\n\n@CCCommand(SceneControllerConfigurationCommand.Get)\n@expectedCCResponse(\n\tSceneControllerConfigurationCCReport,\n\ttestResponseForSceneControllerConfigurationGet,\n)\nexport class SceneControllerConfigurationCCGet\n\textends SceneControllerConfigurationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<SceneControllerConfigurationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): SceneControllerConfigurationCCGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new SceneControllerConfigurationCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic groupId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.groupId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"group id\": this.groupId },\n\t\t};\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAeO;AACP,oBAA4B;AAE5B,iBAUO;AACP,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAoD;AACpD,2BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiCjB,qCAAiC,MAAA;8BAD7C,mCAAI,2BAAe,gCAAgC,CAAC,CAAC;;;;oBACC;;;;;yDAAA,YAAK;WAAA;;;;;;;;6BA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U,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,YAAY,KAAK,QAAO;;IAErC;;;;",
6
6
  "names": ["SceneControllerConfigurationCC"]
7
7
  }
@@ -224,7 +224,7 @@ let ScheduleEntryLockCCAPI = (() => {
224
224
  }
225
225
  return result;
226
226
  }
227
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
227
+ // oxlint-disable-next-line typescript/explicit-module-boundary-types
228
228
  async getNumSlots() {
229
229
  this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.SupportedGet);
230
230
  const cc = new ScheduleEntryLockCCSupportedGet({