@zwave-js/cc 15.15.3 → 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 (297) 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 +6 -2
  14. package/build/cjs/cc/BatteryCC.js.map +2 -2
  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.d.ts +6 -0
  27. package/build/cjs/cc/ConfigurationCC.js +52 -4
  28. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  29. package/build/cjs/cc/DoorLockCC.js +3 -3
  30. package/build/cjs/cc/DoorLockCC.js.map +1 -1
  31. package/build/cjs/cc/EntryControlCC.d.ts +2 -2
  32. package/build/cjs/cc/EntryControlCC.js +3 -3
  33. package/build/cjs/cc/EntryControlCC.js.map +2 -2
  34. package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +4 -4
  35. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
  36. package/build/cjs/cc/IndicatorCC.js +5 -5
  37. package/build/cjs/cc/IndicatorCC.js.map +2 -2
  38. package/build/cjs/cc/IrrigationCC.js +3 -3
  39. package/build/cjs/cc/IrrigationCC.js.map +1 -1
  40. package/build/cjs/cc/LanguageCC.js +1 -1
  41. package/build/cjs/cc/LanguageCC.js.map +1 -1
  42. package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +4 -4
  43. package/build/cjs/cc/ManufacturerProprietaryCC.js +1 -1
  44. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  45. package/build/cjs/cc/ManufacturerSpecificCC.js +1 -1
  46. package/build/cjs/cc/ManufacturerSpecificCC.js.map +1 -1
  47. package/build/cjs/cc/MeterCC.js +3 -3
  48. package/build/cjs/cc/MeterCC.js.map +2 -2
  49. package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
  50. package/build/cjs/cc/MultiChannelCC.js +8 -8
  51. package/build/cjs/cc/MultiChannelCC.js.map +2 -2
  52. package/build/cjs/cc/MultilevelSensorCC.js.map +1 -1
  53. package/build/cjs/cc/MultilevelSwitchCC.js +1 -1
  54. package/build/cjs/cc/MultilevelSwitchCC.js.map +1 -1
  55. package/build/cjs/cc/NodeNamingCC.js.map +2 -2
  56. package/build/cjs/cc/NotificationCC.d.ts +3 -3
  57. package/build/cjs/cc/NotificationCC.js +29 -23
  58. package/build/cjs/cc/NotificationCC.js.map +2 -2
  59. package/build/cjs/cc/ProtectionCC.js +10 -3
  60. package/build/cjs/cc/ProtectionCC.js.map +2 -2
  61. package/build/cjs/cc/SceneActuatorConfigurationCC.js +0 -1
  62. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
  63. package/build/cjs/cc/SceneControllerConfigurationCC.js +0 -1
  64. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
  65. package/build/cjs/cc/ScheduleEntryLockCC.js +1 -1
  66. package/build/cjs/cc/ScheduleEntryLockCC.js.map +1 -1
  67. package/build/cjs/cc/Security2CC.d.ts +14 -14
  68. package/build/cjs/cc/Security2CC.js +6 -5
  69. package/build/cjs/cc/Security2CC.js.map +2 -2
  70. package/build/cjs/cc/SecurityCC.d.ts +10 -10
  71. package/build/cjs/cc/SecurityCC.js +3 -3
  72. package/build/cjs/cc/SecurityCC.js.map +2 -2
  73. package/build/cjs/cc/SoundSwitchCC.js +2 -2
  74. package/build/cjs/cc/SoundSwitchCC.js.map +1 -1
  75. package/build/cjs/cc/SupervisionCC.js +1 -1
  76. package/build/cjs/cc/SupervisionCC.js.map +2 -2
  77. package/build/cjs/cc/ThermostatFanModeCC.js +1 -1
  78. package/build/cjs/cc/ThermostatFanModeCC.js.map +1 -1
  79. package/build/cjs/cc/ThermostatFanStateCC.js +1 -1
  80. package/build/cjs/cc/ThermostatFanStateCC.js.map +1 -1
  81. package/build/cjs/cc/ThermostatModeCC.d.ts +6 -6
  82. package/build/cjs/cc/ThermostatModeCC.js +2 -2
  83. package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
  84. package/build/cjs/cc/ThermostatSetbackCC.js +1 -1
  85. package/build/cjs/cc/ThermostatSetbackCC.js.map +1 -1
  86. package/build/cjs/cc/ThermostatSetpointCC.js.map +1 -1
  87. package/build/cjs/cc/TimeCC.js +2 -2
  88. package/build/cjs/cc/TimeCC.js.map +1 -1
  89. package/build/cjs/cc/TransportServiceCC.d.ts +7 -7
  90. package/build/cjs/cc/TransportServiceCC.js +1 -1
  91. package/build/cjs/cc/TransportServiceCC.js.map +2 -2
  92. package/build/cjs/cc/UserCodeCC.d.ts +14 -6
  93. package/build/cjs/cc/UserCodeCC.js +16 -4
  94. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  95. package/build/cjs/cc/VersionCC.js +3 -3
  96. package/build/cjs/cc/VersionCC.js.map +2 -2
  97. package/build/cjs/cc/WakeUpCC.js +2 -2
  98. package/build/cjs/cc/WakeUpCC.js.map +1 -1
  99. package/build/cjs/cc/WindowCoveringCC.d.ts +3 -1
  100. package/build/cjs/cc/WindowCoveringCC.js +28 -8
  101. package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
  102. package/build/cjs/cc/ZWavePlusCC.js +1 -1
  103. package/build/cjs/cc/ZWavePlusCC.js.map +1 -1
  104. package/build/cjs/cc/ZWaveProtocolCC.d.ts +3 -3
  105. package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
  106. package/build/cjs/cc/_CCValues.generated.js.map +1 -1
  107. package/build/cjs/cc/index.d.ts +3 -0
  108. package/build/cjs/cc/index.js +8 -0
  109. package/build/cjs/cc/index.js.map +2 -2
  110. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +1 -1
  111. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  112. package/build/cjs/lib/API.d.ts +2 -0
  113. package/build/cjs/lib/API.js +2 -2
  114. package/build/cjs/lib/API.js.map +2 -2
  115. package/build/cjs/lib/CommandClass.d.ts +7 -7
  116. package/build/cjs/lib/CommandClass.js +6 -6
  117. package/build/cjs/lib/CommandClass.js.map +2 -2
  118. package/build/cjs/lib/NotificationEventPayload.d.ts +2 -1
  119. package/build/cjs/lib/NotificationEventPayload.js.map +2 -2
  120. package/build/cjs/lib/Security2/Extension.d.ts +12 -12
  121. package/build/cjs/lib/Security2/Extension.js.map +2 -2
  122. package/build/cjs/lib/_Types.d.ts +11 -1
  123. package/build/cjs/lib/_Types.js +15 -0
  124. package/build/cjs/lib/_Types.js.map +3 -3
  125. package/build/cjs/lib/serializers.d.ts +4 -4
  126. package/build/cjs/lib/serializers.js.map +2 -2
  127. package/build/cjs/lib/traits.d.ts +5 -0
  128. package/build/cjs/lib/utils.js +1 -1
  129. package/build/cjs/lib/utils.js.map +2 -2
  130. package/build/esm/cc/AlarmSensorCC.js +1 -1
  131. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  132. package/build/esm/cc/ApplicationStatusCC.d.ts +33 -0
  133. package/build/esm/cc/ApplicationStatusCC.d.ts.map +1 -0
  134. package/build/esm/cc/ApplicationStatusCC.js +175 -0
  135. package/build/esm/cc/ApplicationStatusCC.js.map +1 -0
  136. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  137. package/build/esm/cc/AssociationGroupInfoCC.js +4 -4
  138. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  139. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  140. package/build/esm/cc/BarrierOperatorCC.js +13 -2
  141. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  142. package/build/esm/cc/BasicCC.js +1 -1
  143. package/build/esm/cc/BasicCC.js.map +1 -1
  144. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  145. package/build/esm/cc/BatteryCC.js +5 -2
  146. package/build/esm/cc/BatteryCC.js.map +1 -1
  147. package/build/esm/cc/BinarySwitchCC.js +1 -1
  148. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  149. package/build/esm/cc/CRC16CC.d.ts.map +1 -1
  150. package/build/esm/cc/CRC16CC.js +2 -2
  151. package/build/esm/cc/CRC16CC.js.map +1 -1
  152. package/build/esm/cc/CentralSceneCC.js +2 -2
  153. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  154. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  155. package/build/esm/cc/ClimateControlScheduleCC.js +5 -5
  156. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  157. package/build/esm/cc/ClockCC.js +1 -1
  158. package/build/esm/cc/ClockCC.js.map +1 -1
  159. package/build/esm/cc/ConfigurationCC.d.ts +6 -0
  160. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  161. package/build/esm/cc/ConfigurationCC.js +65 -5
  162. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  163. package/build/esm/cc/DoorLockCC.js +3 -3
  164. package/build/esm/cc/DoorLockCC.js.map +1 -1
  165. package/build/esm/cc/EntryControlCC.d.ts +2 -2
  166. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  167. package/build/esm/cc/EntryControlCC.js +3 -3
  168. package/build/esm/cc/EntryControlCC.js.map +1 -1
  169. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +4 -4
  170. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  171. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  172. package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
  173. package/build/esm/cc/IndicatorCC.js +6 -6
  174. package/build/esm/cc/IndicatorCC.js.map +1 -1
  175. package/build/esm/cc/IrrigationCC.js +3 -3
  176. package/build/esm/cc/IrrigationCC.js.map +1 -1
  177. package/build/esm/cc/LanguageCC.js +1 -1
  178. package/build/esm/cc/LanguageCC.js.map +1 -1
  179. package/build/esm/cc/ManufacturerProprietaryCC.d.ts +4 -4
  180. package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
  181. package/build/esm/cc/ManufacturerProprietaryCC.js +1 -1
  182. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  183. package/build/esm/cc/ManufacturerSpecificCC.js +1 -1
  184. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  185. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  186. package/build/esm/cc/MeterCC.js +3 -3
  187. package/build/esm/cc/MeterCC.js.map +1 -1
  188. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  189. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  190. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  191. package/build/esm/cc/MultiChannelCC.js +8 -8
  192. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  193. package/build/esm/cc/MultilevelSwitchCC.js +1 -1
  194. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  195. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  196. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  197. package/build/esm/cc/NotificationCC.d.ts +3 -3
  198. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  199. package/build/esm/cc/NotificationCC.js +43 -31
  200. package/build/esm/cc/NotificationCC.js.map +1 -1
  201. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  202. package/build/esm/cc/ProtectionCC.js +16 -3
  203. package/build/esm/cc/ProtectionCC.js.map +1 -1
  204. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  205. package/build/esm/cc/SceneActuatorConfigurationCC.js +0 -1
  206. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  207. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  208. package/build/esm/cc/SceneControllerConfigurationCC.js +0 -1
  209. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  210. package/build/esm/cc/ScheduleEntryLockCC.js +1 -1
  211. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  212. package/build/esm/cc/Security2CC.d.ts +14 -14
  213. package/build/esm/cc/Security2CC.d.ts.map +1 -1
  214. package/build/esm/cc/Security2CC.js +7 -6
  215. package/build/esm/cc/Security2CC.js.map +1 -1
  216. package/build/esm/cc/SecurityCC.d.ts +10 -10
  217. package/build/esm/cc/SecurityCC.d.ts.map +1 -1
  218. package/build/esm/cc/SecurityCC.js +4 -4
  219. package/build/esm/cc/SecurityCC.js.map +1 -1
  220. package/build/esm/cc/SoundSwitchCC.js +2 -2
  221. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  222. package/build/esm/cc/SupervisionCC.js +1 -1
  223. package/build/esm/cc/SupervisionCC.js.map +1 -1
  224. package/build/esm/cc/ThermostatFanModeCC.js +1 -1
  225. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  226. package/build/esm/cc/ThermostatFanStateCC.js +1 -1
  227. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  228. package/build/esm/cc/ThermostatModeCC.d.ts +6 -6
  229. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  230. package/build/esm/cc/ThermostatModeCC.js +3 -3
  231. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  232. package/build/esm/cc/ThermostatSetbackCC.js +1 -1
  233. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  234. package/build/esm/cc/TimeCC.js +2 -2
  235. package/build/esm/cc/TimeCC.js.map +1 -1
  236. package/build/esm/cc/TransportServiceCC.d.ts +7 -7
  237. package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
  238. package/build/esm/cc/TransportServiceCC.js +2 -1
  239. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  240. package/build/esm/cc/UserCodeCC.d.ts +14 -6
  241. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  242. package/build/esm/cc/UserCodeCC.js +20 -4
  243. package/build/esm/cc/UserCodeCC.js.map +1 -1
  244. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  245. package/build/esm/cc/VersionCC.js +4 -4
  246. package/build/esm/cc/VersionCC.js.map +1 -1
  247. package/build/esm/cc/WakeUpCC.js +2 -2
  248. package/build/esm/cc/WakeUpCC.js.map +1 -1
  249. package/build/esm/cc/WindowCoveringCC.d.ts +3 -1
  250. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  251. package/build/esm/cc/WindowCoveringCC.js +30 -9
  252. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  253. package/build/esm/cc/ZWavePlusCC.js +1 -1
  254. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  255. package/build/esm/cc/ZWaveProtocolCC.d.ts +3 -3
  256. package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
  257. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  258. package/build/esm/cc/index.d.ts +3 -0
  259. package/build/esm/cc/index.d.ts.map +1 -1
  260. package/build/esm/cc/index.js +5 -0
  261. package/build/esm/cc/index.js.map +1 -1
  262. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +1 -1
  263. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  264. package/build/esm/lib/API.d.ts +2 -0
  265. package/build/esm/lib/API.d.ts.map +1 -1
  266. package/build/esm/lib/API.js +2 -2
  267. package/build/esm/lib/API.js.map +1 -1
  268. package/build/esm/lib/CommandClass.d.ts +7 -7
  269. package/build/esm/lib/CommandClass.d.ts.map +1 -1
  270. package/build/esm/lib/CommandClass.js +6 -6
  271. package/build/esm/lib/CommandClass.js.map +1 -1
  272. package/build/esm/lib/NotificationEventPayload.d.ts +2 -1
  273. package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -1
  274. package/build/esm/lib/NotificationEventPayload.js.map +1 -1
  275. package/build/esm/lib/Security2/Extension.d.ts +12 -12
  276. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  277. package/build/esm/lib/Security2/Extension.js +1 -1
  278. package/build/esm/lib/Security2/Extension.js.map +1 -1
  279. package/build/esm/lib/_Types.d.ts +11 -1
  280. package/build/esm/lib/_Types.d.ts.map +1 -1
  281. package/build/esm/lib/_Types.js +11 -0
  282. package/build/esm/lib/_Types.js.map +1 -1
  283. package/build/esm/lib/serializers.d.ts +4 -4
  284. package/build/esm/lib/serializers.d.ts.map +1 -1
  285. package/build/esm/lib/serializers.js.map +1 -1
  286. package/build/esm/lib/traits.d.ts +5 -0
  287. package/build/esm/lib/traits.d.ts.map +1 -1
  288. package/build/esm/lib/utils.js +1 -1
  289. package/build/esm/lib/utils.js.map +1 -1
  290. package/package.json +12 -13
  291. package/build/cjs/lib/ICommandClassContainer.d.ts +0 -2
  292. package/build/cjs/lib/ICommandClassContainer.js +0 -17
  293. package/build/cjs/lib/ICommandClassContainer.js.map +0 -7
  294. package/build/esm/lib/ICommandClassContainer.d.ts +0 -2
  295. package/build/esm/lib/ICommandClassContainer.d.ts.map +0 -1
  296. package/build/esm/lib/ICommandClassContainer.js +0 -2
  297. package/build/esm/lib/ICommandClassContainer.js.map +0 -1
@@ -135,7 +135,7 @@ let AlarmSensorCCAPI = (() => {
135
135
  if (response)
136
136
  return (0, import_shared.pick)(response, ["state", "severity", "duration"]);
137
137
  }
138
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
138
+ // oxlint-disable-next-line typescript/explicit-module-boundary-types
139
139
  async getSupportedSensorTypes() {
140
140
  this.assertSupportsCommand(import_Types.AlarmSensorCommand, import_Types.AlarmSensorCommand.SupportedGet);
141
141
  const cc = new AlarmSensorCCSupportedGet({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cc/AlarmSensorCC.ts"],
4
- "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, isEnumMember, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } 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\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { AlarmSensorCommand, AlarmSensorType } from \"../lib/_Types.js\";\n\nexport const AlarmSensorCCValues = V.defineCCValues(\n\tCommandClasses[\"Alarm Sensor\"],\n\t{\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"state\",\n\t\t\t\"state\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"state\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\t\t\tlabel: `${alarmName} state`,\n\t\t\t\t\tdescription: \"Whether the alarm is active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"severity\",\n\t\t\t\"severity\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"severity\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 100,\n\t\t\t\t\tunit: \"%\",\n\t\t\t\t\tlabel: `${alarmName} severity`,\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"duration\",\n\t\t\t\"duration\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"duration\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tunit: \"s\",\n\t\t\t\t\tlabel: `${alarmName} duration`,\n\t\t\t\t\tdescription: \"For how long the alarm should be active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.staticProperty(\"supportedSensorTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t},\n);\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Alarm Sensor\"])\nexport class AlarmSensorCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AlarmSensorCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AlarmSensorCommand.Get:\n\t\t\tcase AlarmSensorCommand.SupportedGet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Retrieves the current value from this sensor\n\t * @param sensorType The (optional) sensor type to retrieve the value for\n\t */\n\t@validateArgs({ strictEnums: true })\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(sensorType?: AlarmSensorType) {\n\t\tthis.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.Get);\n\n\t\tconst cc = new AlarmSensorCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsensorType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<AlarmSensorCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return pick(response, [\"state\", \"severity\", \"duration\"]);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupportedSensorTypes() {\n\t\tthis.assertSupportsCommand(\n\t\t\tAlarmSensorCommand,\n\t\t\tAlarmSensorCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new AlarmSensorCCSupportedGet({\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\tAlarmSensorCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.supportedSensorTypes;\n\t}\n}\n\n@commandClass(CommandClasses[\"Alarm Sensor\"])\n@implementedVersion(1)\n@ccValues(AlarmSensorCCValues)\nexport class AlarmSensorCC extends CommandClass {\n\tdeclare ccCommand: AlarmSensorCommand;\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\t// Skip the interview in favor of Notification CC if possible\n\t\tif (endpoint.supportsCC(CommandClasses.Notification)) {\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`${this.constructor.name}: skipping interview because Notification CC is supported...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\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// Find out which sensor types this sensor supports\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported sensor types...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst supportedSensorTypes = await api.getSupportedSensorTypes();\n\t\tif (supportedSensorTypes) {\n\t\t\tconst logMessage = `received supported sensor types: ${\n\t\t\t\tsupportedSensorTypes\n\t\t\t\t\t.map((type) => getEnumMemberName(AlarmSensorType, type))\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\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 supported sensor types timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query (all of) the sensor's current value(s)\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\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 supportedSensorTypes: readonly AlarmSensorType[] =\n\t\t\tthis.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes)\n\t\t\t\t?? [];\n\n\t\t// Always query (all of) the sensor's current value(s)\n\t\tfor (const type of supportedSensorTypes) {\n\t\t\t// Some devices report invalid sensor types, but the CC API checks\n\t\t\t// for valid values and throws otherwise.\n\t\t\tif (!isEnumMember(AlarmSensorType, type)) continue;\n\n\t\t\tconst sensorName = getEnumMemberName(AlarmSensorType, type);\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying current value for ${sensorName}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst currentValue = await api.get(type);\n\t\t\tif (currentValue) {\n\t\t\t\tlet message = `received current value for ${sensorName}: \nstate: ${currentValue.state}`;\n\t\t\t\tif (currentValue.severity != undefined) {\n\t\t\t\t\tmessage += `\nseverity: ${currentValue.severity}`;\n\t\t\t\t}\n\t\t\t\tif (currentValue.duration != undefined) {\n\t\t\t\t\tmessage += `\nduration: ${currentValue.duration}`;\n\t\t\t\t}\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns which sensor types are supported.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getSupportedSensorTypesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<AlarmSensorType[]> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAlarmSensorCCValues.supportedSensorTypes.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tprotected createMetadataForSensorType(\n\t\tctx: GetValueDB,\n\t\tsensorType: AlarmSensorType,\n\t): void {\n\t\tconst stateValue = AlarmSensorCCValues.state(sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(sensorType);\n\n\t\t// Always create metadata if it does not exist\n\t\tthis.ensureMetadata(ctx, stateValue);\n\t\tthis.ensureMetadata(ctx, severityValue);\n\t\tthis.ensureMetadata(ctx, durationValue);\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCReportOptions {\n\tsensorType: AlarmSensorType;\n\tstate: boolean;\n\tseverity?: number;\n\tduration?: number;\n}\n\n@CCCommand(AlarmSensorCommand.Report)\nexport class AlarmSensorCCReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sensorType = options.sensorType;\n\t\tthis.state = options.state;\n\t\tthis.severity = options.severity;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AlarmSensorCCReport {\n\t\tvalidatePayload(raw.payload.length >= 5, raw.payload[1] !== 0xff);\n\t\tconst sourceNodeId = raw.payload[0];\n\n\t\tconst sensorType: AlarmSensorType = raw.payload[1];\n\t\t// Any positive value gets interpreted as alarm\n\t\tconst state: boolean = raw.payload[2] > 0;\n\t\t// Severity only ranges from 1 to 100\n\t\tlet severity: number | undefined;\n\t\tif (raw.payload[2] > 0 && raw.payload[2] <= 0x64) {\n\t\t\tseverity = raw.payload[2];\n\t\t}\n\n\t\t// ignore zero durations\n\t\tconst duration = raw.payload.readUInt16BE(3) || undefined;\n\n\t\treturn new this({\n\t\t\t// Alarm Sensor reports may be forwarded by a different node, in this case\n\t\t\t// (and only then!) the payload contains the original node ID\n\t\t\tnodeId: sourceNodeId || ctx.sourceNodeId,\n\t\t\tsensorType,\n\t\t\tstate,\n\t\t\tseverity,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic readonly sensorType: AlarmSensorType;\n\tpublic readonly state: boolean;\n\tpublic readonly severity: number | undefined;\n\tpublic readonly duration: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"sensor type\": getEnumMemberName(AlarmSensorType, this.sensorType),\n\t\t\t\"alarm state\": this.state,\n\t\t};\n\t\tif (this.severity != undefined) {\n\t\t\tmessage.severity = this.severity;\n\t\t}\n\t\tif (this.duration != undefined) {\n\t\t\tmessage.duration = `${this.duration} seconds`;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata if it does not exist\n\t\tthis.createMetadataForSensorType(ctx, this.sensorType);\n\n\t\tconst stateValue = AlarmSensorCCValues.state(this.sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(this.sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(this.sensorType);\n\n\t\tthis.setValue(ctx, stateValue, this.state);\n\t\tthis.setValue(ctx, severityValue, this.severity);\n\t\tthis.setValue(ctx, durationValue, this.duration);\n\n\t\treturn true;\n\t}\n}\n\nfunction testResponseForAlarmSensorGet(\n\tsent: AlarmSensorCCGet,\n\treceived: AlarmSensorCCReport,\n) {\n\t// We expect a Alarm Sensor Report that matches the requested sensor type (if a type was requested)\n\treturn (\n\t\tsent.sensorType === AlarmSensorType.Any\n\t\t|| received.sensorType === sent.sensorType\n\t);\n}\n\n// @publicAPI\nexport interface AlarmSensorCCGetOptions {\n\tsensorType?: AlarmSensorType;\n}\n\n@CCCommand(AlarmSensorCommand.Get)\n@expectedCCResponse(AlarmSensorCCReport, testResponseForAlarmSensorGet)\nexport class AlarmSensorCCGet extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sensorType = options.sensorType ?? AlarmSensorType.Any;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): AlarmSensorCCGet {\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 AlarmSensorCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sensorType: AlarmSensorType;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.sensorType]);\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\"sensor type\": getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tthis.sensorType,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCSupportedReportOptions {\n\tsupportedSensorTypes: AlarmSensorType[];\n}\n\n@CCCommand(AlarmSensorCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedSensorTypes\",\n\tAlarmSensorCCValues.supportedSensorTypes,\n)\nexport class AlarmSensorCCSupportedReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportedSensorTypes = options.supportedSensorTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AlarmSensorCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst bitMaskLength = raw.payload[0];\n\t\tvalidatePayload(raw.payload.length >= 1 + bitMaskLength);\n\t\tconst supportedSensorTypes: AlarmSensorType[] = parseBitMask(\n\t\t\traw.payload.subarray(1, 1 + bitMaskLength),\n\t\t\tAlarmSensorType[\"General Purpose\"],\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedSensorTypes,\n\t\t});\n\t}\n\n\tpublic supportedSensorTypes: AlarmSensorType[];\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata for each sensor type\n\t\tfor (const type of this.supportedSensorTypes) {\n\t\t\tthis.createMetadataForSensorType(ctx, type);\n\t\t}\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\"supported sensor types\": this.supportedSensorTypes\n\t\t\t\t\t.map((t) => getEnumMemberName(AlarmSensorType, t))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(AlarmSensorCommand.SupportedGet)\n@expectedCCResponse(AlarmSensorCCSupportedReport)\nexport class AlarmSensorCCSupportedGet extends AlarmSensorCC {}\n"],
4
+ "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, isEnumMember, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } 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\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { AlarmSensorCommand, AlarmSensorType } from \"../lib/_Types.js\";\n\nexport const AlarmSensorCCValues = V.defineCCValues(\n\tCommandClasses[\"Alarm Sensor\"],\n\t{\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"state\",\n\t\t\t\"state\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"state\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\t\t\tlabel: `${alarmName} state`,\n\t\t\t\t\tdescription: \"Whether the alarm is active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"severity\",\n\t\t\t\"severity\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"severity\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 100,\n\t\t\t\t\tunit: \"%\",\n\t\t\t\t\tlabel: `${alarmName} severity`,\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"duration\",\n\t\t\t\"duration\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"duration\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tunit: \"s\",\n\t\t\t\t\tlabel: `${alarmName} duration`,\n\t\t\t\t\tdescription: \"For how long the alarm should be active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.staticProperty(\"supportedSensorTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t},\n);\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Alarm Sensor\"])\nexport class AlarmSensorCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AlarmSensorCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AlarmSensorCommand.Get:\n\t\t\tcase AlarmSensorCommand.SupportedGet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Retrieves the current value from this sensor\n\t * @param sensorType The (optional) sensor type to retrieve the value for\n\t */\n\t@validateArgs({ strictEnums: true })\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async get(sensorType?: AlarmSensorType) {\n\t\tthis.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.Get);\n\n\t\tconst cc = new AlarmSensorCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsensorType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<AlarmSensorCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return pick(response, [\"state\", \"severity\", \"duration\"]);\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getSupportedSensorTypes() {\n\t\tthis.assertSupportsCommand(\n\t\t\tAlarmSensorCommand,\n\t\t\tAlarmSensorCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new AlarmSensorCCSupportedGet({\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\tAlarmSensorCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.supportedSensorTypes;\n\t}\n}\n\n@commandClass(CommandClasses[\"Alarm Sensor\"])\n@implementedVersion(1)\n@ccValues(AlarmSensorCCValues)\nexport class AlarmSensorCC extends CommandClass {\n\tdeclare ccCommand: AlarmSensorCommand;\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\t// Skip the interview in favor of Notification CC if possible\n\t\tif (endpoint.supportsCC(CommandClasses.Notification)) {\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`${this.constructor.name}: skipping interview because Notification CC is supported...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\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// Find out which sensor types this sensor supports\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported sensor types...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst supportedSensorTypes = await api.getSupportedSensorTypes();\n\t\tif (supportedSensorTypes) {\n\t\t\tconst logMessage = `received supported sensor types: ${\n\t\t\t\tsupportedSensorTypes\n\t\t\t\t\t.map((type) => getEnumMemberName(AlarmSensorType, type))\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\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 supported sensor types timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query (all of) the sensor's current value(s)\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\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 supportedSensorTypes: readonly AlarmSensorType[] =\n\t\t\tthis.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes)\n\t\t\t\t?? [];\n\n\t\t// Always query (all of) the sensor's current value(s)\n\t\tfor (const type of supportedSensorTypes) {\n\t\t\t// Some devices report invalid sensor types, but the CC API checks\n\t\t\t// for valid values and throws otherwise.\n\t\t\tif (!isEnumMember(AlarmSensorType, type)) continue;\n\n\t\t\tconst sensorName = getEnumMemberName(AlarmSensorType, type);\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying current value for ${sensorName}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst currentValue = await api.get(type);\n\t\t\tif (currentValue) {\n\t\t\t\tlet message = `received current value for ${sensorName}: \nstate: ${currentValue.state}`;\n\t\t\t\tif (currentValue.severity != undefined) {\n\t\t\t\t\tmessage += `\nseverity: ${currentValue.severity}`;\n\t\t\t\t}\n\t\t\t\tif (currentValue.duration != undefined) {\n\t\t\t\t\tmessage += `\nduration: ${currentValue.duration}`;\n\t\t\t\t}\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns which sensor types are supported.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getSupportedSensorTypesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<AlarmSensorType[]> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAlarmSensorCCValues.supportedSensorTypes.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tprotected createMetadataForSensorType(\n\t\tctx: GetValueDB,\n\t\tsensorType: AlarmSensorType,\n\t): void {\n\t\tconst stateValue = AlarmSensorCCValues.state(sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(sensorType);\n\n\t\t// Always create metadata if it does not exist\n\t\tthis.ensureMetadata(ctx, stateValue);\n\t\tthis.ensureMetadata(ctx, severityValue);\n\t\tthis.ensureMetadata(ctx, durationValue);\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCReportOptions {\n\tsensorType: AlarmSensorType;\n\tstate: boolean;\n\tseverity?: number;\n\tduration?: number;\n}\n\n@CCCommand(AlarmSensorCommand.Report)\nexport class AlarmSensorCCReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sensorType = options.sensorType;\n\t\tthis.state = options.state;\n\t\tthis.severity = options.severity;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AlarmSensorCCReport {\n\t\tvalidatePayload(raw.payload.length >= 5, raw.payload[1] !== 0xff);\n\t\tconst sourceNodeId = raw.payload[0];\n\n\t\tconst sensorType: AlarmSensorType = raw.payload[1];\n\t\t// Any positive value gets interpreted as alarm\n\t\tconst state: boolean = raw.payload[2] > 0;\n\t\t// Severity only ranges from 1 to 100\n\t\tlet severity: number | undefined;\n\t\tif (raw.payload[2] > 0 && raw.payload[2] <= 0x64) {\n\t\t\tseverity = raw.payload[2];\n\t\t}\n\n\t\t// ignore zero durations\n\t\tconst duration = raw.payload.readUInt16BE(3) || undefined;\n\n\t\treturn new this({\n\t\t\t// Alarm Sensor reports may be forwarded by a different node, in this case\n\t\t\t// (and only then!) the payload contains the original node ID\n\t\t\tnodeId: sourceNodeId || ctx.sourceNodeId,\n\t\t\tsensorType,\n\t\t\tstate,\n\t\t\tseverity,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic readonly sensorType: AlarmSensorType;\n\tpublic readonly state: boolean;\n\tpublic readonly severity: number | undefined;\n\tpublic readonly duration: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"sensor type\": getEnumMemberName(AlarmSensorType, this.sensorType),\n\t\t\t\"alarm state\": this.state,\n\t\t};\n\t\tif (this.severity != undefined) {\n\t\t\tmessage.severity = this.severity;\n\t\t}\n\t\tif (this.duration != undefined) {\n\t\t\tmessage.duration = `${this.duration} seconds`;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata if it does not exist\n\t\tthis.createMetadataForSensorType(ctx, this.sensorType);\n\n\t\tconst stateValue = AlarmSensorCCValues.state(this.sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(this.sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(this.sensorType);\n\n\t\tthis.setValue(ctx, stateValue, this.state);\n\t\tthis.setValue(ctx, severityValue, this.severity);\n\t\tthis.setValue(ctx, durationValue, this.duration);\n\n\t\treturn true;\n\t}\n}\n\nfunction testResponseForAlarmSensorGet(\n\tsent: AlarmSensorCCGet,\n\treceived: AlarmSensorCCReport,\n) {\n\t// We expect a Alarm Sensor Report that matches the requested sensor type (if a type was requested)\n\treturn (\n\t\tsent.sensorType === AlarmSensorType.Any\n\t\t|| received.sensorType === sent.sensorType\n\t);\n}\n\n// @publicAPI\nexport interface AlarmSensorCCGetOptions {\n\tsensorType?: AlarmSensorType;\n}\n\n@CCCommand(AlarmSensorCommand.Get)\n@expectedCCResponse(AlarmSensorCCReport, testResponseForAlarmSensorGet)\nexport class AlarmSensorCCGet extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sensorType = options.sensorType ?? AlarmSensorType.Any;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): AlarmSensorCCGet {\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 AlarmSensorCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sensorType: AlarmSensorType;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.sensorType]);\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\"sensor type\": getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tthis.sensorType,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCSupportedReportOptions {\n\tsupportedSensorTypes: AlarmSensorType[];\n}\n\n@CCCommand(AlarmSensorCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedSensorTypes\",\n\tAlarmSensorCCValues.supportedSensorTypes,\n)\nexport class AlarmSensorCCSupportedReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportedSensorTypes = options.supportedSensorTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AlarmSensorCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst bitMaskLength = raw.payload[0];\n\t\tvalidatePayload(raw.payload.length >= 1 + bitMaskLength);\n\t\tconst supportedSensorTypes: AlarmSensorType[] = parseBitMask(\n\t\t\traw.payload.subarray(1, 1 + bitMaskLength),\n\t\t\tAlarmSensorType[\"General Purpose\"],\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedSensorTypes,\n\t\t});\n\t}\n\n\tpublic supportedSensorTypes: AlarmSensorType[];\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata for each sensor type\n\t\tfor (const type of this.supportedSensorTypes) {\n\t\t\tthis.createMetadataForSensorType(ctx, type);\n\t\t}\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\"supported sensor types\": this.supportedSensorTypes\n\t\t\t\t\t.map((t) => getEnumMemberName(AlarmSensorType, t))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(AlarmSensorCommand.SupportedGet)\n@expectedCCResponse(AlarmSensorCCSupportedReport)\nexport class AlarmSensorCCSupportedGet extends AlarmSensorCC {}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAcO;AACP,oBAA6D;AAE7D,iBAAqC;AACrC,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0EvC,oBAAgB,MAAA;8BAD5B,mCAAI,2BAAe,cAAc,CAAC,CAAC;;;;oBACE;;;wCAAA,YAAa;WAAA;;;;;;;;yBAcjD,kCAAa,EAAE,aAAa,KAAI,CAAE,CAAC;AAEpC,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;AAhBjB,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACL,gBAAgB,KAAuB;AAC7C,cAAQ,KAAK;QACZ,KAAK,gCAAmB;QACxB,KAAK,gCAAmB;AACvB,iBAAO;MACT;AACA,aAAO,MAAM,gBAAgB,GAAG;IACjC;;;;;IAQO,MAAM,IAAI,YAA4B;AAC5C,WAAK,sBAAsB,iCAAoB,gCAAmB,GAAG;AAErE,YAAM,KAAK,IAAI,iBAAiB;QAC/B,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4B,KAAK,IAAI;MAC3C;AACA,aAAO;IACR;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,0BAA0B,KAAK,qBAC7B,IAAI,CAAC,UAAM,iCAAkB,8BAAiB,CAAC,CAAC,EAChD,KAAK,IAAI;;;IAGd;;;;IAKY,6BAAyB,MAAA;8BAFrC,yCAAU,gCAAmB,YAAY,OACzC,kDAAmB,4BAA4B,CAAC;;;;oBACF;iDAAA,YAAa;WAAA;;;;;;;;AAA5D,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,33 @@
1
+ import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
2
+ import { type MaybeNotKnown, type MessageOrCCLogEntry, type SinglecastCC, type WithAddress } from "@zwave-js/core";
3
+ import { Bytes } from "@zwave-js/shared";
4
+ import { CCAPI } from "../lib/API.js";
5
+ import { type CCRaw, CommandClass } from "../lib/CommandClass.js";
6
+ import { ApplicationStatus, ApplicationStatusCommand } from "../lib/_Types.js";
7
+ export declare class ApplicationStatusCCAPI extends CCAPI {
8
+ supportsCommand(cmd: ApplicationStatusCommand): MaybeNotKnown<boolean>;
9
+ }
10
+ export declare class ApplicationStatusCC extends CommandClass implements SinglecastCC<ApplicationStatusCC> {
11
+ ccCommand: ApplicationStatusCommand;
12
+ nodeId: number;
13
+ }
14
+ export interface ApplicationStatusCCBusyOptions {
15
+ status: ApplicationStatus;
16
+ waitTime?: number;
17
+ }
18
+ export declare class ApplicationStatusCCBusy extends ApplicationStatusCC {
19
+ constructor(options: WithAddress<ApplicationStatusCCBusyOptions>);
20
+ static from(raw: CCRaw, ctx: CCParsingContext): ApplicationStatusCCBusy;
21
+ readonly status: ApplicationStatus;
22
+ readonly waitTime: number | undefined;
23
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
24
+ toLogEntry(): MessageOrCCLogEntry;
25
+ }
26
+ export interface ApplicationStatusCCRejectedRequestOptions {
27
+ status: number;
28
+ }
29
+ export declare class ApplicationStatusCCRejectedRequest extends ApplicationStatusCC {
30
+ static from(raw: CCRaw, ctx: CCParsingContext): ApplicationStatusCCRejectedRequest;
31
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
32
+ }
33
+ //# sourceMappingURL=ApplicationStatusCC.d.ts.map
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var ApplicationStatusCC_exports = {};
21
+ __export(ApplicationStatusCC_exports, {
22
+ ApplicationStatusCC: () => ApplicationStatusCC,
23
+ ApplicationStatusCCAPI: () => ApplicationStatusCCAPI,
24
+ ApplicationStatusCCBusy: () => ApplicationStatusCCBusy,
25
+ ApplicationStatusCCRejectedRequest: () => ApplicationStatusCCRejectedRequest
26
+ });
27
+ module.exports = __toCommonJS(ApplicationStatusCC_exports);
28
+ var import_core = require("@zwave-js/core");
29
+ var import_shared = require("@zwave-js/shared");
30
+ var import_API = require("../lib/API.js");
31
+ var import_CommandClass = require("../lib/CommandClass.js");
32
+ var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
33
+ var import_Types = require("../lib/_Types.js");
34
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
35
+ function accept(f) {
36
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
37
+ return f;
38
+ }
39
+ __name(accept, "accept");
40
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
41
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
42
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
43
+ var _, done = false;
44
+ for (var i = decorators.length - 1; i >= 0; i--) {
45
+ var context = {};
46
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
47
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
48
+ context.addInitializer = function(f) {
49
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
50
+ extraInitializers.push(accept(f || null));
51
+ };
52
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
53
+ if (kind === "accessor") {
54
+ if (result === void 0) continue;
55
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
56
+ if (_ = accept(result.get)) descriptor.get = _;
57
+ if (_ = accept(result.set)) descriptor.set = _;
58
+ if (_ = accept(result.init)) initializers.unshift(_);
59
+ } else if (_ = accept(result)) {
60
+ if (kind === "field") initializers.unshift(_);
61
+ else descriptor[key] = _;
62
+ }
63
+ }
64
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
65
+ done = true;
66
+ };
67
+ var __runInitializers = function(thisArg, initializers, value) {
68
+ var useValue = arguments.length > 2;
69
+ for (var i = 0; i < initializers.length; i++) {
70
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
71
+ }
72
+ return useValue ? value : void 0;
73
+ };
74
+ let ApplicationStatusCCAPI = (() => {
75
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses["Application Status"])];
76
+ let _classDescriptor;
77
+ let _classExtraInitializers = [];
78
+ let _classThis;
79
+ let _classSuper = import_API.CCAPI;
80
+ var ApplicationStatusCCAPI2 = class extends _classSuper {
81
+ static {
82
+ __name(this, "ApplicationStatusCCAPI");
83
+ }
84
+ static {
85
+ _classThis = this;
86
+ }
87
+ static {
88
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
89
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
90
+ ApplicationStatusCCAPI2 = _classThis = _classDescriptor.value;
91
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
92
+ __runInitializers(_classThis, _classExtraInitializers);
93
+ }
94
+ supportsCommand(cmd) {
95
+ switch (cmd) {
96
+ case import_Types.ApplicationStatusCommand.Busy:
97
+ case import_Types.ApplicationStatusCommand.RejectedRequest:
98
+ return true;
99
+ }
100
+ return super.supportsCommand(cmd);
101
+ }
102
+ };
103
+ return ApplicationStatusCCAPI2 = _classThis;
104
+ })();
105
+ let ApplicationStatusCC = (() => {
106
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Application Status"]), (0, import_CommandClassDecorators.implementedVersion)(1)];
107
+ let _classDescriptor;
108
+ let _classExtraInitializers = [];
109
+ let _classThis;
110
+ let _classSuper = import_CommandClass.CommandClass;
111
+ var ApplicationStatusCC2 = class extends _classSuper {
112
+ static {
113
+ __name(this, "ApplicationStatusCC");
114
+ }
115
+ static {
116
+ _classThis = this;
117
+ }
118
+ static {
119
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
120
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
121
+ ApplicationStatusCC2 = _classThis = _classDescriptor.value;
122
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
123
+ __runInitializers(_classThis, _classExtraInitializers);
124
+ }
125
+ };
126
+ return ApplicationStatusCC2 = _classThis;
127
+ })();
128
+ let ApplicationStatusCCBusy = (() => {
129
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ApplicationStatusCommand.Busy)];
130
+ let _classDescriptor;
131
+ let _classExtraInitializers = [];
132
+ let _classThis;
133
+ let _classSuper = ApplicationStatusCC;
134
+ var ApplicationStatusCCBusy2 = class extends _classSuper {
135
+ static {
136
+ __name(this, "ApplicationStatusCCBusy");
137
+ }
138
+ static {
139
+ _classThis = this;
140
+ }
141
+ static {
142
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
143
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
144
+ ApplicationStatusCCBusy2 = _classThis = _classDescriptor.value;
145
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
146
+ __runInitializers(_classThis, _classExtraInitializers);
147
+ }
148
+ constructor(options) {
149
+ super(options);
150
+ this.status = options.status;
151
+ this.waitTime = options.waitTime;
152
+ }
153
+ static from(raw, ctx) {
154
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
155
+ const status = raw.payload[0];
156
+ let waitTime;
157
+ if (status === import_Types.ApplicationStatus.TryAgainInWaitTimeSeconds && raw.payload.length >= 2) {
158
+ waitTime = raw.payload[1];
159
+ }
160
+ return new this({
161
+ nodeId: ctx.sourceNodeId,
162
+ status,
163
+ waitTime
164
+ });
165
+ }
166
+ status;
167
+ waitTime;
168
+ serialize(ctx) {
169
+ this.payload = import_shared.Bytes.from([this.status, this.waitTime ?? 0]);
170
+ return super.serialize(ctx);
171
+ }
172
+ toLogEntry() {
173
+ const message = {
174
+ status: (0, import_shared.getEnumMemberName)(import_Types.ApplicationStatus, this.status)
175
+ };
176
+ if (this.status === import_Types.ApplicationStatus.TryAgainInWaitTimeSeconds) {
177
+ message["wait time"] = `${this.waitTime} seconds`;
178
+ }
179
+ return {
180
+ ...super.toLogEntry(),
181
+ message
182
+ };
183
+ }
184
+ };
185
+ return ApplicationStatusCCBusy2 = _classThis;
186
+ })();
187
+ let ApplicationStatusCCRejectedRequest = (() => {
188
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ApplicationStatusCommand.RejectedRequest)];
189
+ let _classDescriptor;
190
+ let _classExtraInitializers = [];
191
+ let _classThis;
192
+ let _classSuper = ApplicationStatusCC;
193
+ var ApplicationStatusCCRejectedRequest2 = class extends _classSuper {
194
+ static {
195
+ __name(this, "ApplicationStatusCCRejectedRequest");
196
+ }
197
+ static {
198
+ _classThis = this;
199
+ }
200
+ static {
201
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
202
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
203
+ ApplicationStatusCCRejectedRequest2 = _classThis = _classDescriptor.value;
204
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
205
+ __runInitializers(_classThis, _classExtraInitializers);
206
+ }
207
+ static from(raw, ctx) {
208
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
209
+ const status = raw.payload[0];
210
+ (0, import_core.validatePayload)(status === 0);
211
+ return new this({
212
+ nodeId: ctx.sourceNodeId
213
+ });
214
+ }
215
+ serialize(ctx) {
216
+ this.payload = import_shared.Bytes.from([0]);
217
+ return super.serialize(ctx);
218
+ }
219
+ };
220
+ return ApplicationStatusCCRejectedRequest2 = _classThis;
221
+ })();
222
+ // Annotate the CommonJS export names for ESM import in node:
223
+ 0 && (module.exports = {
224
+ ApplicationStatusCC,
225
+ ApplicationStatusCCAPI,
226
+ ApplicationStatusCCBusy,
227
+ ApplicationStatusCCRejectedRequest
228
+ });
229
+ //# sourceMappingURL=ApplicationStatusCC.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cc/ApplicationStatusCC.ts"],
4
+ "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype SinglecastCC,\n\ttype WithAddress,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName } from \"@zwave-js/shared\";\nimport { CCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass } from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tcommandClass,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { ApplicationStatus, ApplicationStatusCommand } from \"../lib/_Types.js\";\n\n@API(CommandClasses[\"Application Status\"])\nexport class ApplicationStatusCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: ApplicationStatusCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ApplicationStatusCommand.Busy:\n\t\t\tcase ApplicationStatusCommand.RejectedRequest:\n\t\t\t\treturn true; // These are receive-only commands\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n}\n\n@commandClass(CommandClasses[\"Application Status\"])\n@implementedVersion(1)\nexport class ApplicationStatusCC extends CommandClass\n\timplements SinglecastCC<ApplicationStatusCC>\n{\n\tdeclare ccCommand: ApplicationStatusCommand;\n\tdeclare nodeId: number;\n}\n\n// @publicAPI\nexport interface ApplicationStatusCCBusyOptions {\n\tstatus: ApplicationStatus;\n\twaitTime?: number;\n}\n\n@CCCommand(ApplicationStatusCommand.Busy)\nexport class ApplicationStatusCCBusy extends ApplicationStatusCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ApplicationStatusCCBusyOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.status = options.status;\n\t\tthis.waitTime = options.waitTime;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ApplicationStatusCCBusy {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst status: ApplicationStatus = raw.payload[0];\n\t\tlet waitTime: number | undefined;\n\t\tif (\n\t\t\tstatus === ApplicationStatus.TryAgainInWaitTimeSeconds\n\t\t\t&& raw.payload.length >= 2\n\t\t) {\n\t\t\twaitTime = raw.payload[1];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tstatus,\n\t\t\twaitTime,\n\t\t});\n\t}\n\n\tpublic readonly status: ApplicationStatus;\n\tpublic readonly waitTime: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.status, this.waitTime ?? 0]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tstatus: getEnumMemberName(ApplicationStatus, this.status),\n\t\t};\n\t\tif (\n\t\t\tthis.status === ApplicationStatus.TryAgainInWaitTimeSeconds\n\t\t) {\n\t\t\tmessage[\"wait time\"] = `${this.waitTime} seconds`;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ApplicationStatusCCRejectedRequestOptions {\n\tstatus: number;\n}\n\n@CCCommand(ApplicationStatusCommand.RejectedRequest)\nexport class ApplicationStatusCCRejectedRequest extends ApplicationStatusCC {\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ApplicationStatusCCRejectedRequest {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst status: number = raw.payload[0];\n\t\t// This field MUST be set to 0\n\t\tvalidatePayload(status === 0);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t});\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([0x00]);\n\t\treturn super.serialize(ctx);\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAQO;AACP,oBAAyC;AACzC,iBAAsB;AACtB,0BAAyC;AACzC,oCAKO;AACP,mBAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG/C,0BAAsB,MAAA;8BADlC,mCAAI,2BAAe,oBAAoB,CAAC,CAAC;;;;oBACE;8CAAA,YAAK;WAAA;;;;;;;;AAAjD,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACL,gBACN,KAA6B;AAE7B,cAAQ,KAAK;QACZ,KAAK,sCAAyB;QAC9B,KAAK,sCAAyB;AAC7B,iBAAO;MACT;AACA,aAAO,MAAM,gBAAgB,GAAG;IACjC;;;;IAKY,uBAAmB,MAAA;8BAF/B,4CAAa,2BAAe,oBAAoB,CAAC,OACjD,kDAAmB,CAAC,CAAC;;;;oBACmB;2CAAA,YAAY;WAAA;;;;;;;;AAArD,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;IAcA,2BAAuB,MAAA;8BADnC,yCAAU,sCAAyB,IA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I,QAAQ,UAAU,CAAC;AACvC,YAAM,SAAiB,IAAI,QAAQ,CAAC;AAEpC,uCAAgB,WAAW,CAAC;AAE5B,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;OACZ;IACF;IAEO,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,CAAC,CAAI,CAAC;AAChC,aAAO,MAAM,UAAU,GAAG;IAC3B;;;;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cc/AssociationCC.ts"],
4
- "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\tMAX_NODES,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type AssociationAddress, AssociationCommand } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\n\nexport const AssociationCCValues = V.defineCCValues(\n\tCommandClasses.Association,\n\t{\n\t\t...V.staticProperty(\"hasLifeline\", undefined, { internal: true }),\n\t\t...V.staticProperty(\"groupCount\", undefined, { internal: true }),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"maxNodes\",\n\t\t\t\"maxNodes\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"maxNodes\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"nodeIds\",\n\t\t\t\"nodeIds\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"nodeIds\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t},\n);\n\n// @noSetValueAPI\n\n@API(CommandClasses.Association)\nexport class AssociationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AssociationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AssociationCommand.Get:\n\t\t\tcase AssociationCommand.Set:\n\t\t\tcase AssociationCommand.Report:\n\t\t\tcase AssociationCommand.Remove:\n\t\t\tcase AssociationCommand.SupportedGroupingsGet:\n\t\t\tcase AssociationCommand.SupportedGroupingsReport:\n\t\t\t\treturn true;\n\t\t\tcase AssociationCommand.SpecificGroupGet:\n\t\t\tcase AssociationCommand.SpecificGroupReport:\n\t\t\t\treturn this.version >= 2;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Returns the number of association groups a node supports.\n\t * Association groups are consecutive, starting at 1.\n\t */\n\tpublic async getGroupCount(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SupportedGroupingsGet,\n\t\t);\n\n\t\tconst cc = new AssociationCCSupportedGroupingsGet({\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\tAssociationCCSupportedGroupingsReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.groupCount;\n\t}\n\n\t@validateArgs()\n\tpublic async reportGroupCount(groupCount: number): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SupportedGroupingsReport,\n\t\t);\n\n\t\tconst cc = new AssociationCCSupportedGroupingsReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupCount,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Returns information about an association group.\n\t */\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getGroup(groupId: number) {\n\t\tthis.assertSupportsCommand(AssociationCommand, AssociationCommand.Get);\n\n\t\tconst cc = new AssociationCCGet({\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<AssociationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn {\n\t\t\t\tmaxNodes: response.maxNodes,\n\t\t\t\tnodeIds: response.nodeIds,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: AssociationCCReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Report,\n\t\t);\n\n\t\tconst cc = new AssociationCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Adds new nodes to an association group\n\t */\n\t@validateArgs()\n\tpublic async addNodeIds(\n\t\tgroupId: number,\n\t\t...nodeIds: number[]\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(AssociationCommand, AssociationCommand.Set);\n\n\t\tconst cc = new AssociationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Removes nodes from an association group\n\t */\n\t@validateArgs()\n\tpublic async removeNodeIds(\n\t\toptions: AssociationCCRemoveOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Remove,\n\t\t);\n\n\t\t// Validate options\n\t\tif (!options.groupId) {\n\t\t\tif (this.version === 1) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (options.groupId < 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new AssociationCCRemove({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Removes nodes from all association groups\n\t */\n\t@validateArgs()\n\tpublic async removeNodeIdsFromAllGroups(\n\t\tnodeIds: number[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Remove,\n\t\t);\n\n\t\tif (this.version >= 2) {\n\t\t\t// The node supports bulk removal\n\t\t\treturn this.removeNodeIds({ nodeIds, groupId: 0 });\n\t\t} else {\n\t\t\t// We have to remove the node manually from all groups\n\t\t\tconst groupCount = this.tryGetValueDB()?.getValue<number>(\n\t\t\t\tAssociationCCValues.groupCount.endpoint(\n\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t),\n\t\t\t) ?? 0;\n\t\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\t\t// TODO: evaluate intermediate supervision results\n\t\t\t\tawait this.removeNodeIds({ nodeIds, groupId });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Request the association group that represents the most recently detected button press\n\t */\n\t@validateArgs()\n\tpublic async getSpecificGroup(): Promise<number | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SpecificGroupGet,\n\t\t);\n\n\t\tconst cc = new AssociationCCSpecificGroupGet({\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\tAssociationCCSpecificGroupReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.group;\n\t}\n\n\t/**\n\t * Report the association group that represents the most recently detected button press\n\t */\n\t@validateArgs()\n\tpublic async reportSpecificGroup(\n\t\tgroup: number,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SpecificGroupReport,\n\t\t);\n\n\t\tconst cc = new AssociationCCSpecificGroupReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroup,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Association)\n@implementedVersion(4)\n@ccValues(AssociationCCValues)\nexport class AssociationCC extends CommandClass {\n\tdeclare ccCommand: AssociationCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// AssociationCC must be interviewed after Z-Wave+ if that is supported\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses[\"Z-Wave Plus Info\"],\n\t\t\t// We need information about endpoints to correctly configure the lifeline associations\n\t\t\tCommandClasses[\"Multi Channel\"],\n\t\t];\n\t}\n\n\t/**\n\t * Returns the number of association groups reported by the node/endpoint.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getGroupCountCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAssociationCCValues.groupCount.endpoint(endpoint.index),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns the number of nodes an association group supports.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getMaxNodesCached(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): number {\n\t\treturn (\n\t\t\tctx\n\t\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t\t.getValue(\n\t\t\t\t\tAssociationCCValues.maxNodes(groupId).endpoint(\n\t\t\t\t\t\tendpoint.index,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t// If the information is not available, fall back to the configuration file if possible\n\t\t\t\t// This can happen on some legacy devices which have \"hidden\" association groups\n\t\t\t\t?? ctx\n\t\t\t\t\t.getDeviceConfig?.(endpoint.nodeId)\n\t\t\t\t\t?.getAssociationConfigForEndpoint(endpoint.index, groupId)\n\t\t\t\t\t?.maxNodes\n\t\t\t\t?? 0\n\t\t);\n\t}\n\n\t/**\n\t * Returns all the destinations of all association groups reported by the node/endpoint.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getAllDestinationsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): ReadonlyMap<number, readonly AssociationAddress[]> {\n\t\tconst ret = new Map<number, AssociationAddress[]>();\n\t\tconst groupCount = this.getGroupCountCached(ctx, endpoint);\n\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\t\tfor (let i = 1; i <= groupCount; i++) {\n\t\t\t// Add all root destinations\n\t\t\tconst nodes = valueDB.getValue<number[]>(\n\t\t\t\tAssociationCCValues.nodeIds(i).endpoint(endpoint.index),\n\t\t\t) ?? [];\n\n\t\t\tret.set(\n\t\t\t\ti,\n\t\t\t\t// Filter out duplicates\n\t\t\t\tdistinct(nodes).map((nodeId) => ({ nodeId })),\n\t\t\t);\n\t\t}\n\t\treturn ret;\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\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// Even if Multi Channel Association is supported, we still need to query the number of\n\t\t// normal association groups since some devices report more association groups than\n\t\t// multi channel association groups\n\n\t\t// Find out how many groups are supported\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying number of association groups...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst groupCount = await api.getGroupCount();\n\t\tif (groupCount != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `supports ${groupCount} association groups`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\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 association groups timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query each association group for its members\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Skip the remaining Association CC interview in favor of Multi Channel Association if possible\n\t\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\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`${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\t// And set up lifeline associations\n\t\tawait ccUtils.configureLifelineAssociations(ctx, endpoint);\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.Association,\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 = AssociationCC.getGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\n\t\t// Query each association group\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: `querying association group #${groupId}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst group = await api.getGroup(groupId);\n\t\t\tif (group != undefined) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`received information for association group #${groupId}:\nmaximum # of nodes: ${group.maxNodes}\ncurrently assigned nodes: ${group.nodeIds.map(String).join(\", \")}`;\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\n// @publicAPI\nexport interface AssociationCCSetOptions {\n\tgroupId: number;\n\tnodeIds: number[];\n}\n\n@CCCommand(AssociationCommand.Set)\n@useSupervision()\nexport class AssociationCCSet extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tif (options.nodeIds.some((n) => n < 1 || n > MAX_NODES)) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`All node IDs must be between 1 and ${MAX_NODES}!`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.groupId = options.groupId;\n\t\tthis.nodeIds = options.nodeIds;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst groupId = raw.payload[0];\n\t\tconst nodeIds = [...raw.payload.subarray(1)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\tpublic nodeIds: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.groupId, ...this.nodeIds]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"group id\": this.groupId || \"all groups\",\n\t\t\t\"node ids\": this.nodeIds.length\n\t\t\t\t? this.nodeIds.join(\", \")\n\t\t\t\t: \"all nodes\",\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 AssociationCCRemoveOptions {\n\t/** The group from which to remove the nodes. If none is specified, the nodes will be removed from all nodes. */\n\tgroupId?: number;\n\t/** The nodes to remove. If none are specified, ALL nodes will be removed. */\n\tnodeIds?: number[];\n}\n\n@CCCommand(AssociationCommand.Remove)\n@useSupervision()\nexport class AssociationCCRemove extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCRemoveOptions>,\n\t) {\n\t\tsuper(options);\n\t\t// When removing associations, we allow invalid node IDs.\n\t\t// See GH#3606 - it is possible that those exist.\n\t\tthis.groupId = options.groupId;\n\t\tthis.nodeIds = options.nodeIds;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCRemove {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tlet groupId: number | undefined;\n\t\tif (raw.payload[0] !== 0) {\n\t\t\tgroupId = raw.payload[0];\n\t\t}\n\t\tconst nodeIds = [...raw.payload.subarray(1)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId?: number;\n\tpublic nodeIds?: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId || 0,\n\t\t\t...(this.nodeIds || []),\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\t\"group id\": this.groupId || \"all groups\",\n\t\t\t\"node ids\": this.nodeIds && this.nodeIds.length\n\t\t\t\t? this.nodeIds.join(\", \")\n\t\t\t\t: \"all nodes\",\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 AssociationCCReportOptions {\n\tgroupId: number;\n\tmaxNodes: number;\n\tnodeIds: number[];\n\treportsToFollow: number;\n}\n\n@CCCommand(AssociationCommand.Report)\n@ccValueProperty(\n\t\"maxNodes\",\n\tAssociationCCValues.maxNodes,\n\t(self) => [self.groupId],\n)\n@ccValueProperty(\n\t\"nodeIds\",\n\tAssociationCCValues.nodeIds,\n\t(self) => [self.groupId],\n)\nexport class AssociationCCReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupId = options.groupId;\n\t\tthis.maxNodes = options.maxNodes;\n\t\tthis.nodeIds = options.nodeIds;\n\t\tthis.reportsToFollow = options.reportsToFollow;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst groupId = raw.payload[0];\n\t\tconst maxNodes = raw.payload[1];\n\t\tconst reportsToFollow = raw.payload[2];\n\t\tconst nodeIds = [...raw.payload.subarray(3)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tmaxNodes,\n\t\t\treportsToFollow,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\n\tpublic maxNodes: number;\n\n\tpublic nodeIds: number[];\n\n\tpublic reportsToFollow: number;\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Distinguish sessions by the association group ID\n\t\treturn { groupId: this.groupId };\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn this.reportsToFollow > 0;\n\t}\n\n\tpublic mergePartialCCs(\n\t\tpartials: AssociationCCReport[],\n\t\t_ctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// Concat the list of nodes\n\t\tthis.nodeIds = [...partials, this]\n\t\t\t.map((report) => report.nodeIds)\n\t\t\t.reduce((prev, cur) => prev.concat(...cur), []);\n\t\treturn Promise.resolve();\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId,\n\t\t\tthis.maxNodes,\n\t\t\tthis.reportsToFollow,\n\t\t\t...this.nodeIds,\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\"max # of nodes\": this.maxNodes,\n\t\t\t\t\"node IDs\": this.nodeIds.join(\", \"),\n\t\t\t\t\"reports to follow\": this.reportsToFollow,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCGetOptions {\n\tgroupId: number;\n}\n\n@CCCommand(AssociationCommand.Get)\n@expectedCCResponse(AssociationCCReport)\nexport class AssociationCCGet extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupId = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\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\n// @publicAPI\nexport interface AssociationCCSupportedGroupingsReportOptions {\n\tgroupCount: number;\n}\n\n@CCCommand(AssociationCommand.SupportedGroupingsReport)\n@ccValueProperty(\"groupCount\", AssociationCCValues.groupCount)\nexport class AssociationCCSupportedGroupingsReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSupportedGroupingsReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupCount = options.groupCount;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationCCSupportedGroupingsReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupCount = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupCount,\n\t\t});\n\t}\n\n\tpublic groupCount: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.groupCount]);\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 count\": this.groupCount },\n\t\t};\n\t}\n}\n\n@CCCommand(AssociationCommand.SupportedGroupingsGet)\n@expectedCCResponse(AssociationCCSupportedGroupingsReport)\nexport class AssociationCCSupportedGroupingsGet extends AssociationCC {}\n\n// @publicAPI\nexport interface AssociationCCSpecificGroupReportOptions {\n\tgroup: number;\n}\n\n@CCCommand(AssociationCommand.SpecificGroupReport)\nexport class AssociationCCSpecificGroupReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSpecificGroupReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.group = options.group;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationCCSpecificGroupReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst group = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroup,\n\t\t});\n\t}\n\n\tpublic group: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.group]);\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: this.group },\n\t\t};\n\t}\n}\n\n@CCCommand(AssociationCommand.SpecificGroupGet)\n@expectedCCResponse(AssociationCCSpecificGroupReport)\nexport class AssociationCCSpecificGroupGet extends AssociationCC {}\n"],
4
+ "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\tMAX_NODES,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type AssociationAddress, AssociationCommand } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\n\nexport const AssociationCCValues = V.defineCCValues(\n\tCommandClasses.Association,\n\t{\n\t\t...V.staticProperty(\"hasLifeline\", undefined, { internal: true }),\n\t\t...V.staticProperty(\"groupCount\", undefined, { internal: true }),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"maxNodes\",\n\t\t\t\"maxNodes\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"maxNodes\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"nodeIds\",\n\t\t\t\"nodeIds\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"nodeIds\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t},\n);\n\n// @noSetValueAPI\n\n@API(CommandClasses.Association)\nexport class AssociationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AssociationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AssociationCommand.Get:\n\t\t\tcase AssociationCommand.Set:\n\t\t\tcase AssociationCommand.Report:\n\t\t\tcase AssociationCommand.Remove:\n\t\t\tcase AssociationCommand.SupportedGroupingsGet:\n\t\t\tcase AssociationCommand.SupportedGroupingsReport:\n\t\t\t\treturn true;\n\t\t\tcase AssociationCommand.SpecificGroupGet:\n\t\t\tcase AssociationCommand.SpecificGroupReport:\n\t\t\t\treturn this.version >= 2;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Returns the number of association groups a node supports.\n\t * Association groups are consecutive, starting at 1.\n\t */\n\tpublic async getGroupCount(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SupportedGroupingsGet,\n\t\t);\n\n\t\tconst cc = new AssociationCCSupportedGroupingsGet({\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\tAssociationCCSupportedGroupingsReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.groupCount;\n\t}\n\n\t@validateArgs()\n\tpublic async reportGroupCount(groupCount: number): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SupportedGroupingsReport,\n\t\t);\n\n\t\tconst cc = new AssociationCCSupportedGroupingsReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupCount,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Returns information about an association group.\n\t */\n\t@validateArgs()\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getGroup(groupId: number) {\n\t\tthis.assertSupportsCommand(AssociationCommand, AssociationCommand.Get);\n\n\t\tconst cc = new AssociationCCGet({\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<AssociationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn {\n\t\t\t\tmaxNodes: response.maxNodes,\n\t\t\t\tnodeIds: response.nodeIds,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: AssociationCCReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Report,\n\t\t);\n\n\t\tconst cc = new AssociationCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Adds new nodes to an association group\n\t */\n\t@validateArgs()\n\tpublic async addNodeIds(\n\t\tgroupId: number,\n\t\t...nodeIds: number[]\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(AssociationCommand, AssociationCommand.Set);\n\n\t\tconst cc = new AssociationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Removes nodes from an association group\n\t */\n\t@validateArgs()\n\tpublic async removeNodeIds(\n\t\toptions: AssociationCCRemoveOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Remove,\n\t\t);\n\n\t\t// Validate options\n\t\tif (!options.groupId) {\n\t\t\tif (this.version === 1) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (options.groupId < 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new AssociationCCRemove({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Removes nodes from all association groups\n\t */\n\t@validateArgs()\n\tpublic async removeNodeIdsFromAllGroups(\n\t\tnodeIds: number[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Remove,\n\t\t);\n\n\t\tif (this.version >= 2) {\n\t\t\t// The node supports bulk removal\n\t\t\treturn this.removeNodeIds({ nodeIds, groupId: 0 });\n\t\t} else {\n\t\t\t// We have to remove the node manually from all groups\n\t\t\tconst groupCount = this.tryGetValueDB()?.getValue<number>(\n\t\t\t\tAssociationCCValues.groupCount.endpoint(\n\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t),\n\t\t\t) ?? 0;\n\t\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\t\t// TODO: evaluate intermediate supervision results\n\t\t\t\tawait this.removeNodeIds({ nodeIds, groupId });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Request the association group that represents the most recently detected button press\n\t */\n\t@validateArgs()\n\tpublic async getSpecificGroup(): Promise<number | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SpecificGroupGet,\n\t\t);\n\n\t\tconst cc = new AssociationCCSpecificGroupGet({\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\tAssociationCCSpecificGroupReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.group;\n\t}\n\n\t/**\n\t * Report the association group that represents the most recently detected button press\n\t */\n\t@validateArgs()\n\tpublic async reportSpecificGroup(\n\t\tgroup: number,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SpecificGroupReport,\n\t\t);\n\n\t\tconst cc = new AssociationCCSpecificGroupReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroup,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Association)\n@implementedVersion(4)\n@ccValues(AssociationCCValues)\nexport class AssociationCC extends CommandClass {\n\tdeclare ccCommand: AssociationCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// AssociationCC must be interviewed after Z-Wave+ if that is supported\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses[\"Z-Wave Plus Info\"],\n\t\t\t// We need information about endpoints to correctly configure the lifeline associations\n\t\t\tCommandClasses[\"Multi Channel\"],\n\t\t];\n\t}\n\n\t/**\n\t * Returns the number of association groups reported by the node/endpoint.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getGroupCountCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAssociationCCValues.groupCount.endpoint(endpoint.index),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns the number of nodes an association group supports.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getMaxNodesCached(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): number {\n\t\treturn (\n\t\t\tctx\n\t\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t\t.getValue(\n\t\t\t\t\tAssociationCCValues.maxNodes(groupId).endpoint(\n\t\t\t\t\t\tendpoint.index,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t// If the information is not available, fall back to the configuration file if possible\n\t\t\t\t// This can happen on some legacy devices which have \"hidden\" association groups\n\t\t\t\t?? ctx\n\t\t\t\t\t.getDeviceConfig?.(endpoint.nodeId)\n\t\t\t\t\t?.getAssociationConfigForEndpoint(endpoint.index, groupId)\n\t\t\t\t\t?.maxNodes\n\t\t\t\t?? 0\n\t\t);\n\t}\n\n\t/**\n\t * Returns all the destinations of all association groups reported by the node/endpoint.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getAllDestinationsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): ReadonlyMap<number, readonly AssociationAddress[]> {\n\t\tconst ret = new Map<number, AssociationAddress[]>();\n\t\tconst groupCount = this.getGroupCountCached(ctx, endpoint);\n\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\t\tfor (let i = 1; i <= groupCount; i++) {\n\t\t\t// Add all root destinations\n\t\t\tconst nodes = valueDB.getValue<number[]>(\n\t\t\t\tAssociationCCValues.nodeIds(i).endpoint(endpoint.index),\n\t\t\t) ?? [];\n\n\t\t\tret.set(\n\t\t\t\ti,\n\t\t\t\t// Filter out duplicates\n\t\t\t\tdistinct(nodes).map((nodeId) => ({ nodeId })),\n\t\t\t);\n\t\t}\n\t\treturn ret;\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\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// Even if Multi Channel Association is supported, we still need to query the number of\n\t\t// normal association groups since some devices report more association groups than\n\t\t// multi channel association groups\n\n\t\t// Find out how many groups are supported\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying number of association groups...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst groupCount = await api.getGroupCount();\n\t\tif (groupCount != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `supports ${groupCount} association groups`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\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 association groups timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query each association group for its members\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Skip the remaining Association CC interview in favor of Multi Channel Association if possible\n\t\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\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`${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\t// And set up lifeline associations\n\t\tawait ccUtils.configureLifelineAssociations(ctx, endpoint);\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.Association,\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 = AssociationCC.getGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\n\t\t// Query each association group\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: `querying association group #${groupId}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst group = await api.getGroup(groupId);\n\t\t\tif (group != undefined) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`received information for association group #${groupId}:\nmaximum # of nodes: ${group.maxNodes}\ncurrently assigned nodes: ${group.nodeIds.map(String).join(\", \")}`;\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\n// @publicAPI\nexport interface AssociationCCSetOptions {\n\tgroupId: number;\n\tnodeIds: number[];\n}\n\n@CCCommand(AssociationCommand.Set)\n@useSupervision()\nexport class AssociationCCSet extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tif (options.nodeIds.some((n) => n < 1 || n > MAX_NODES)) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`All node IDs must be between 1 and ${MAX_NODES}!`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.groupId = options.groupId;\n\t\tthis.nodeIds = options.nodeIds;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst groupId = raw.payload[0];\n\t\tconst nodeIds = [...raw.payload.subarray(1)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\tpublic nodeIds: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.groupId, ...this.nodeIds]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"group id\": this.groupId || \"all groups\",\n\t\t\t\"node ids\": this.nodeIds.length\n\t\t\t\t? this.nodeIds.join(\", \")\n\t\t\t\t: \"all nodes\",\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 AssociationCCRemoveOptions {\n\t/** The group from which to remove the nodes. If none is specified, the nodes will be removed from all nodes. */\n\tgroupId?: number;\n\t/** The nodes to remove. If none are specified, ALL nodes will be removed. */\n\tnodeIds?: number[];\n}\n\n@CCCommand(AssociationCommand.Remove)\n@useSupervision()\nexport class AssociationCCRemove extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCRemoveOptions>,\n\t) {\n\t\tsuper(options);\n\t\t// When removing associations, we allow invalid node IDs.\n\t\t// See GH#3606 - it is possible that those exist.\n\t\tthis.groupId = options.groupId;\n\t\tthis.nodeIds = options.nodeIds;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCRemove {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tlet groupId: number | undefined;\n\t\tif (raw.payload[0] !== 0) {\n\t\t\tgroupId = raw.payload[0];\n\t\t}\n\t\tconst nodeIds = [...raw.payload.subarray(1)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId?: number;\n\tpublic nodeIds?: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId || 0,\n\t\t\t...(this.nodeIds || []),\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\t\"group id\": this.groupId || \"all groups\",\n\t\t\t\"node ids\": this.nodeIds && this.nodeIds.length\n\t\t\t\t? this.nodeIds.join(\", \")\n\t\t\t\t: \"all nodes\",\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 AssociationCCReportOptions {\n\tgroupId: number;\n\tmaxNodes: number;\n\tnodeIds: number[];\n\treportsToFollow: number;\n}\n\n@CCCommand(AssociationCommand.Report)\n@ccValueProperty(\n\t\"maxNodes\",\n\tAssociationCCValues.maxNodes,\n\t(self) => [self.groupId],\n)\n@ccValueProperty(\n\t\"nodeIds\",\n\tAssociationCCValues.nodeIds,\n\t(self) => [self.groupId],\n)\nexport class AssociationCCReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupId = options.groupId;\n\t\tthis.maxNodes = options.maxNodes;\n\t\tthis.nodeIds = options.nodeIds;\n\t\tthis.reportsToFollow = options.reportsToFollow;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst groupId = raw.payload[0];\n\t\tconst maxNodes = raw.payload[1];\n\t\tconst reportsToFollow = raw.payload[2];\n\t\tconst nodeIds = [...raw.payload.subarray(3)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tmaxNodes,\n\t\t\treportsToFollow,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\n\tpublic maxNodes: number;\n\n\tpublic nodeIds: number[];\n\n\tpublic reportsToFollow: number;\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Distinguish sessions by the association group ID\n\t\treturn { groupId: this.groupId };\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn this.reportsToFollow > 0;\n\t}\n\n\tpublic mergePartialCCs(\n\t\tpartials: AssociationCCReport[],\n\t\t_ctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// Concat the list of nodes\n\t\tthis.nodeIds = [...partials, this]\n\t\t\t.map((report) => report.nodeIds)\n\t\t\t.reduce((prev, cur) => prev.concat(...cur), []);\n\t\treturn Promise.resolve();\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId,\n\t\t\tthis.maxNodes,\n\t\t\tthis.reportsToFollow,\n\t\t\t...this.nodeIds,\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\"max # of nodes\": this.maxNodes,\n\t\t\t\t\"node IDs\": this.nodeIds.join(\", \"),\n\t\t\t\t\"reports to follow\": this.reportsToFollow,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCGetOptions {\n\tgroupId: number;\n}\n\n@CCCommand(AssociationCommand.Get)\n@expectedCCResponse(AssociationCCReport)\nexport class AssociationCCGet extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupId = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\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\n// @publicAPI\nexport interface AssociationCCSupportedGroupingsReportOptions {\n\tgroupCount: number;\n}\n\n@CCCommand(AssociationCommand.SupportedGroupingsReport)\n@ccValueProperty(\"groupCount\", AssociationCCValues.groupCount)\nexport class AssociationCCSupportedGroupingsReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSupportedGroupingsReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupCount = options.groupCount;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationCCSupportedGroupingsReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupCount = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupCount,\n\t\t});\n\t}\n\n\tpublic groupCount: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.groupCount]);\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 count\": this.groupCount },\n\t\t};\n\t}\n}\n\n@CCCommand(AssociationCommand.SupportedGroupingsGet)\n@expectedCCResponse(AssociationCCSupportedGroupingsReport)\nexport class AssociationCCSupportedGroupingsGet extends AssociationCC {}\n\n// @publicAPI\nexport interface AssociationCCSpecificGroupReportOptions {\n\tgroup: number;\n}\n\n@CCCommand(AssociationCommand.SpecificGroupReport)\nexport class AssociationCCSpecificGroupReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSpecificGroupReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.group = options.group;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationCCSpecificGroupReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst group = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroup,\n\t\t});\n\t}\n\n\tpublic group: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.group]);\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: this.group },\n\t\t};\n\t}\n}\n\n@CCCommand(AssociationCommand.SpecificGroupGet)\n@expectedCCResponse(AssociationCCSpecificGroupReport)\nexport class AssociationCCSpecificGroupGet extends AssociationCC {}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAcO;AACP,oBAAsB;AAEtB,oBAAyB;AACzB,iBAAqC;AACrC,0BAKO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAA4D;AAC5D,cAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BZ,oBAAgB,MAAA;8BAD5B,mCAAI,2BAAe,WAAW,CAAC;;;;oBACM;;;;;;;;;;wCAAA,YAAa;WAAA;;;;;;;;sCAwCjD,+CAAA,CAAc;8BAkBd,uCAAA,CAAc;gCAsBd,yCAAA,CAAc;gCAoBd,yCAAA,CAAc;mCAmBd,4CAAA,CAAc;gDAmCd,yDAAA,CAAc;sCA6Bd,+CAAA,CAAc;yCAuBd,kDAAA,CAAc;AArKf,mBAAA,MAAA,MAAA,8BAAA,EAAA,MAAA,UAAA,MAAA,oBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,sBAAA,KAAA,QAAA,KAA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AAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
6
6
  "names": ["AssociationCC"]
7
7
  }
@@ -534,11 +534,11 @@ let AssociationGroupInfoCCInfoReport = (() => {
534
534
  message: {
535
535
  "is list mode": this.isListMode,
536
536
  "has dynamic info": this.hasDynamicInfo,
537
- groups: `${this.groups.map((g) => `
537
+ groups: this.groups.map((g) => `
538
538
  \xB7 Group #${g.groupId}
539
539
  mode: ${g.mode}
540
540
  profile: ${g.profile}
541
- event code: ${g.eventCode}`).join("")}`
541
+ event code: ${g.eventCode}`).join("")
542
542
  }
543
543
  };
544
544
  }
@@ -686,10 +686,10 @@ let AssociationGroupInfoCCCommandListReport = (() => {
686
686
  ...super.toLogEntry(ctx),
687
687
  message: {
688
688
  "group id": this.groupId,
689
- commands: `${[...this.commands].map(([cc, cmds]) => {
689
+ commands: [...this.commands].map(([cc, cmds]) => {
690
690
  return `
691
691
  \xB7 ${(0, import_core.getCCName)(cc)}: ${cmds.map((cmd) => (0, import_shared.num2hex)(cmd)).join(", ")}`;
692
- }).join("")}`
692
+ }).join("")
693
693
  }
694
694
  };
695
695
  }