@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5

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 (331) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +381 -266
  2. package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
  3. package/build/cjs/cc/AssociationCC.js +669 -503
  4. package/build/cjs/cc/AssociationCC.js.map +3 -3
  5. package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
  6. package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
  7. package/build/cjs/cc/BarrierOperatorCC.js +595 -429
  8. package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
  9. package/build/cjs/cc/BasicCC.js +354 -260
  10. package/build/cjs/cc/BasicCC.js.map +3 -3
  11. package/build/cjs/cc/BatteryCC.js +427 -345
  12. package/build/cjs/cc/BatteryCC.js.map +3 -3
  13. package/build/cjs/cc/BinarySensorCC.js +391 -276
  14. package/build/cjs/cc/BinarySensorCC.js.map +3 -3
  15. package/build/cjs/cc/BinarySwitchCC.js +347 -253
  16. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  17. package/build/cjs/cc/CRC16CC.js +160 -85
  18. package/build/cjs/cc/CRC16CC.js.map +3 -3
  19. package/build/cjs/cc/CentralSceneCC.js +459 -324
  20. package/build/cjs/cc/CentralSceneCC.js.map +3 -3
  21. package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
  23. package/build/cjs/cc/ClockCC.js +254 -150
  24. package/build/cjs/cc/ClockCC.js.map +3 -3
  25. package/build/cjs/cc/ColorSwitchCC.js +758 -610
  26. package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
  27. package/build/cjs/cc/ConfigurationCC.js +1700 -1453
  28. package/build/cjs/cc/ConfigurationCC.js.map +3 -3
  29. package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
  30. package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
  31. package/build/cjs/cc/DoorLockCC.js +904 -777
  32. package/build/cjs/cc/DoorLockCC.js.map +3 -3
  33. package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
  34. package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
  35. package/build/cjs/cc/EnergyProductionCC.js +249 -160
  36. package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
  37. package/build/cjs/cc/EntryControlCC.js +619 -458
  38. package/build/cjs/cc/EntryControlCC.js.map +3 -3
  39. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
  40. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
  41. package/build/cjs/cc/HailCC.js +57 -11
  42. package/build/cjs/cc/HailCC.js.map +2 -2
  43. package/build/cjs/cc/HumidityControlModeCC.js +359 -233
  44. package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
  45. package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
  46. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
  47. package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
  48. package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
  49. package/build/cjs/cc/InclusionControllerCC.js +205 -114
  50. package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
  51. package/build/cjs/cc/IndicatorCC.js +897 -736
  52. package/build/cjs/cc/IndicatorCC.js.map +3 -3
  53. package/build/cjs/cc/IrrigationCC.js +1651 -1405
  54. package/build/cjs/cc/IrrigationCC.js.map +3 -3
  55. package/build/cjs/cc/LanguageCC.js +268 -171
  56. package/build/cjs/cc/LanguageCC.js.map +3 -3
  57. package/build/cjs/cc/LockCC.js +254 -154
  58. package/build/cjs/cc/LockCC.js.map +3 -3
  59. package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
  60. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  61. package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
  62. package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
  63. package/build/cjs/cc/MeterCC.js +827 -707
  64. package/build/cjs/cc/MeterCC.js.map +3 -3
  65. package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
  66. package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
  67. package/build/cjs/cc/MultiChannelCC.js +1037 -819
  68. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  69. package/build/cjs/cc/MultiCommandCC.js +172 -97
  70. package/build/cjs/cc/MultiCommandCC.js.map +3 -3
  71. package/build/cjs/cc/MultilevelSensorCC.js +589 -449
  72. package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
  73. package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
  74. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  75. package/build/cjs/cc/NoOperationCC.js +89 -27
  76. package/build/cjs/cc/NoOperationCC.js.map +2 -2
  77. package/build/cjs/cc/NodeNamingCC.js +417 -277
  78. package/build/cjs/cc/NodeNamingCC.js.map +3 -3
  79. package/build/cjs/cc/NotificationCC.js +972 -818
  80. package/build/cjs/cc/NotificationCC.js.map +3 -3
  81. package/build/cjs/cc/PowerlevelCC.js +450 -303
  82. package/build/cjs/cc/PowerlevelCC.js.map +3 -3
  83. package/build/cjs/cc/ProtectionCC.js +686 -494
  84. package/build/cjs/cc/ProtectionCC.js.map +3 -3
  85. package/build/cjs/cc/SceneActivationCC.js +165 -97
  86. package/build/cjs/cc/SceneActivationCC.js.map +3 -3
  87. package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
  88. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
  89. package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
  90. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
  91. package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
  92. package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
  93. package/build/cjs/cc/Security2CC.js +1483 -1219
  94. package/build/cjs/cc/Security2CC.js.map +3 -3
  95. package/build/cjs/cc/SecurityCC.js +839 -619
  96. package/build/cjs/cc/SecurityCC.js.map +3 -3
  97. package/build/cjs/cc/SoundSwitchCC.js +707 -515
  98. package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
  99. package/build/cjs/cc/SupervisionCC.js +327 -237
  100. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  101. package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
  102. package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
  103. package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
  104. package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
  105. package/build/cjs/cc/ThermostatModeCC.js +425 -302
  106. package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
  107. package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
  108. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
  109. package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
  110. package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
  111. package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
  112. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  113. package/build/cjs/cc/TimeCC.js +515 -353
  114. package/build/cjs/cc/TimeCC.js.map +3 -3
  115. package/build/cjs/cc/TimeParametersCC.js +302 -202
  116. package/build/cjs/cc/TimeParametersCC.js.map +3 -3
  117. package/build/cjs/cc/TransportServiceCC.js +433 -315
  118. package/build/cjs/cc/TransportServiceCC.js.map +3 -3
  119. package/build/cjs/cc/UserCodeCC.js +1385 -1102
  120. package/build/cjs/cc/UserCodeCC.js.map +3 -3
  121. package/build/cjs/cc/VersionCC.js +696 -562
  122. package/build/cjs/cc/VersionCC.js.map +3 -3
  123. package/build/cjs/cc/WakeUpCC.js +499 -346
  124. package/build/cjs/cc/WakeUpCC.js.map +3 -3
  125. package/build/cjs/cc/WindowCoveringCC.js +626 -478
  126. package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
  127. package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
  128. package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
  129. package/build/cjs/cc/ZWavePlusCC.js +233 -159
  130. package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
  131. package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
  132. package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
  133. package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  134. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
  135. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
  136. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
  137. package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
  138. package/build/cjs/lib/CommandClassDecorators.js +19 -20
  139. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  140. package/build/cjs/lib/Security2/Extension.d.ts +1 -1
  141. package/build/cjs/lib/Security2/Extension.js +217 -126
  142. package/build/cjs/lib/Security2/Extension.js.map +3 -3
  143. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  144. package/build/esm/cc/AlarmSensorCC.js +389 -291
  145. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  146. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  147. package/build/esm/cc/AssociationCC.js +678 -537
  148. package/build/esm/cc/AssociationCC.js.map +1 -1
  149. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  150. package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
  151. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  152. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  153. package/build/esm/cc/BarrierOperatorCC.js +634 -493
  154. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  155. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  156. package/build/esm/cc/BasicCC.js +380 -302
  157. package/build/esm/cc/BasicCC.js.map +1 -1
  158. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  159. package/build/esm/cc/BatteryCC.js +449 -384
  160. package/build/esm/cc/BatteryCC.js.map +1 -1
  161. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  162. package/build/esm/cc/BinarySensorCC.js +395 -297
  163. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  164. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  165. package/build/esm/cc/BinarySwitchCC.js +353 -274
  166. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  167. package/build/esm/cc/CRC16CC.js +162 -98
  168. package/build/esm/cc/CRC16CC.js.map +1 -1
  169. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  170. package/build/esm/cc/CentralSceneCC.js +465 -351
  171. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  172. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  173. package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
  174. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  175. package/build/esm/cc/ClockCC.js +248 -159
  176. package/build/esm/cc/ClockCC.js.map +1 -1
  177. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  178. package/build/esm/cc/ColorSwitchCC.js +802 -677
  179. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  180. package/build/esm/cc/ConfigurationCC.js +1899 -1687
  181. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  182. package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
  183. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  184. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  185. package/build/esm/cc/DoorLockCC.js +951 -849
  186. package/build/esm/cc/DoorLockCC.js.map +1 -1
  187. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  188. package/build/esm/cc/DoorLockLoggingCC.js +316 -218
  189. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  190. package/build/esm/cc/EnergyProductionCC.js +240 -164
  191. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  192. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  193. package/build/esm/cc/EntryControlCC.js +629 -493
  194. package/build/esm/cc/EntryControlCC.js.map +1 -1
  195. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  196. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
  197. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  198. package/build/esm/cc/HailCC.js +51 -12
  199. package/build/esm/cc/HailCC.js.map +1 -1
  200. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  201. package/build/esm/cc/HumidityControlModeCC.js +357 -250
  202. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  203. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  204. package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
  205. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  206. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  207. package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
  208. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  209. package/build/esm/cc/InclusionControllerCC.js +197 -119
  210. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  211. package/build/esm/cc/IndicatorCC.js +973 -835
  212. package/build/esm/cc/IndicatorCC.js.map +1 -1
  213. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  214. package/build/esm/cc/IrrigationCC.js +1697 -1496
  215. package/build/esm/cc/IrrigationCC.js.map +1 -1
  216. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  217. package/build/esm/cc/LanguageCC.js +266 -184
  218. package/build/esm/cc/LanguageCC.js.map +1 -1
  219. package/build/esm/cc/LockCC.d.ts.map +1 -1
  220. package/build/esm/cc/LockCC.js +247 -162
  221. package/build/esm/cc/LockCC.js.map +1 -1
  222. package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
  223. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  224. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  225. package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
  226. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  227. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  228. package/build/esm/cc/MeterCC.js +896 -795
  229. package/build/esm/cc/MeterCC.js.map +1 -1
  230. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  231. package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
  232. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  233. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  234. package/build/esm/cc/MultiChannelCC.js +1106 -921
  235. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  236. package/build/esm/cc/MultiCommandCC.js +166 -102
  237. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  238. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  239. package/build/esm/cc/MultilevelSensorCC.js +616 -497
  240. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  241. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  242. package/build/esm/cc/MultilevelSwitchCC.js +621 -496
  243. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  244. package/build/esm/cc/NoOperationCC.js +82 -29
  245. package/build/esm/cc/NoOperationCC.js.map +1 -1
  246. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  247. package/build/esm/cc/NodeNamingCC.js +413 -294
  248. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  249. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  250. package/build/esm/cc/NotificationCC.js +1097 -966
  251. package/build/esm/cc/NotificationCC.js.map +1 -1
  252. package/build/esm/cc/PowerlevelCC.js +437 -311
  253. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  254. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  255. package/build/esm/cc/ProtectionCC.js +704 -543
  256. package/build/esm/cc/ProtectionCC.js.map +1 -1
  257. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  258. package/build/esm/cc/SceneActivationCC.js +157 -100
  259. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  260. package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
  261. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  262. package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
  263. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  264. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  265. package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
  266. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  267. package/build/esm/cc/Security2CC.js +1633 -1406
  268. package/build/esm/cc/Security2CC.js.map +1 -1
  269. package/build/esm/cc/SecurityCC.js +876 -687
  270. package/build/esm/cc/SecurityCC.js.map +1 -1
  271. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  272. package/build/esm/cc/SoundSwitchCC.js +689 -526
  273. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  274. package/build/esm/cc/SupervisionCC.js +349 -272
  275. package/build/esm/cc/SupervisionCC.js.map +1 -1
  276. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  277. package/build/esm/cc/ThermostatFanModeCC.js +388 -284
  278. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  279. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  280. package/build/esm/cc/ThermostatFanStateCC.js +184 -111
  281. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  282. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  283. package/build/esm/cc/ThermostatModeCC.js +435 -331
  284. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  285. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  286. package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
  287. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  288. package/build/esm/cc/ThermostatSetbackCC.js +274 -185
  289. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  290. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  291. package/build/esm/cc/ThermostatSetpointCC.js +674 -543
  292. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  293. package/build/esm/cc/TimeCC.js +499 -360
  294. package/build/esm/cc/TimeCC.js.map +1 -1
  295. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  296. package/build/esm/cc/TimeParametersCC.js +296 -211
  297. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  298. package/build/esm/cc/TransportServiceCC.js +464 -363
  299. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  300. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  301. package/build/esm/cc/UserCodeCC.js +1443 -1205
  302. package/build/esm/cc/UserCodeCC.js.map +1 -1
  303. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  304. package/build/esm/cc/VersionCC.js +744 -635
  305. package/build/esm/cc/VersionCC.js.map +1 -1
  306. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  307. package/build/esm/cc/WakeUpCC.js +494 -364
  308. package/build/esm/cc/WakeUpCC.js.map +1 -1
  309. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  310. package/build/esm/cc/WindowCoveringCC.js +655 -530
  311. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  312. package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
  313. package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
  314. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  315. package/build/esm/cc/ZWavePlusCC.js +223 -162
  316. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  317. package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
  318. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  319. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  320. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  321. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
  322. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  323. package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
  324. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  325. package/build/esm/lib/CommandClassDecorators.js +24 -24
  326. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  327. package/build/esm/lib/Security2/Extension.d.ts +1 -1
  328. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  329. package/build/esm/lib/Security2/Extension.js +207 -123
  330. package/build/esm/lib/Security2/Extension.js.map +1 -1
  331. package/package.json +6 -6
@@ -50,13 +50,45 @@ var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
50
50
  var import_Values = require("../lib/Values.js");
51
51
  var import_Types = require("../lib/_Types.js");
52
52
  var ccUtils = __toESM(require("../lib/utils.js"), 1);
53
- var __decorate = function(decorators, target, key, desc) {
54
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
55
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
56
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
57
- return c > 3 && r && Object.defineProperty(target, key, r), r;
53
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
54
+ function accept(f) {
55
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
56
+ return f;
57
+ }
58
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
59
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
60
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
61
+ var _, done = false;
62
+ for (var i = decorators.length - 1; i >= 0; i--) {
63
+ var context = {};
64
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
65
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
66
+ context.addInitializer = function(f) {
67
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
68
+ extraInitializers.push(accept(f || null));
69
+ };
70
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
71
+ if (kind === "accessor") {
72
+ if (result === void 0) continue;
73
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
74
+ if (_ = accept(result.get)) descriptor.get = _;
75
+ if (_ = accept(result.set)) descriptor.set = _;
76
+ if (_ = accept(result.init)) initializers.unshift(_);
77
+ } else if (_ = accept(result)) {
78
+ if (kind === "field") initializers.unshift(_);
79
+ else descriptor[key] = _;
80
+ }
81
+ }
82
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
83
+ done = true;
84
+ };
85
+ var __runInitializers = function(thisArg, initializers, value) {
86
+ var useValue = arguments.length > 2;
87
+ for (var i = 0; i < initializers.length; i++) {
88
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
89
+ }
90
+ return useValue ? value : void 0;
58
91
  };
59
- var AssociationCC_1, AssociationCCSet_1, AssociationCCRemove_1, AssociationCCReport_1, AssociationCCGet_1, AssociationCCSupportedGroupingsReport_1, AssociationCCSpecificGroupReport_1;
60
92
  function __assertType(argName, typeName, boundHasError) {
61
93
  const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
62
94
  if (boundHasError()) {
@@ -175,525 +207,659 @@ const AssociationCCValues = Object.freeze({
175
207
  ...import_Values.V.dynamicPropertyAndKeyWithName("nodeIds", "nodeIds", (groupId) => groupId, ({ property, propertyKey }) => property === "nodeIds" && typeof propertyKey === "number", void 0, { internal: true })
176
208
  })
177
209
  });
178
- let AssociationCCAPI = class AssociationCCAPI2 extends import_API.PhysicalCCAPI {
179
- supportsCommand(cmd) {
180
- switch (cmd) {
181
- case import_Types.AssociationCommand.Get:
182
- case import_Types.AssociationCommand.Set:
183
- case import_Types.AssociationCommand.Report:
184
- case import_Types.AssociationCommand.Remove:
185
- case import_Types.AssociationCommand.SupportedGroupingsGet:
186
- case import_Types.AssociationCommand.SupportedGroupingsReport:
187
- return true;
188
- case import_Types.AssociationCommand.SpecificGroupGet:
189
- case import_Types.AssociationCommand.SpecificGroupReport:
190
- return this.version >= 2;
191
- }
192
- return super.supportsCommand(cmd);
193
- }
194
- /**
195
- * Returns the number of association groups a node supports.
196
- * Association groups are consecutive, starting at 1.
197
- */
198
- async getGroupCount() {
199
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.SupportedGroupingsGet);
200
- const cc = new AssociationCCSupportedGroupingsGet({
201
- nodeId: this.endpoint.nodeId,
202
- endpointIndex: this.endpoint.index
203
- });
204
- const response = await this.host.sendCommand(cc, this.commandOptions);
205
- if (response)
206
- return response.groupCount;
207
- }
208
- async reportGroupCount(groupCount) {
209
- __assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount));
210
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.SupportedGroupingsReport);
211
- const cc = new AssociationCCSupportedGroupingsReport({
212
- nodeId: this.endpoint.nodeId,
213
- endpointIndex: this.endpoint.index,
214
- groupCount
215
- });
216
- await this.host.sendCommand(cc, this.commandOptions);
217
- }
218
- /**
219
- * Returns information about an association group.
220
- */
221
- async getGroup(groupId) {
222
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
223
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Get);
224
- const cc = new AssociationCCGet({
225
- nodeId: this.endpoint.nodeId,
226
- endpointIndex: this.endpoint.index,
227
- groupId
228
- });
229
- const response = await this.host.sendCommand(cc, this.commandOptions);
230
- if (response) {
231
- return {
232
- maxNodes: response.maxNodes,
233
- nodeIds: response.nodeIds
234
- };
210
+ let AssociationCCAPI = (() => {
211
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Association)];
212
+ let _classDescriptor;
213
+ let _classExtraInitializers = [];
214
+ let _classThis;
215
+ let _classSuper = import_API.PhysicalCCAPI;
216
+ var AssociationCCAPI2 = class extends _classSuper {
217
+ static {
218
+ _classThis = this;
235
219
  }
236
- }
237
- async sendReport(options) {
238
- __assertType("options", "AssociationCCReportOptions", __assertType__AssociationCCReportOptions.bind(void 0, options));
239
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Report);
240
- const cc = new AssociationCCReport({
241
- nodeId: this.endpoint.nodeId,
242
- endpointIndex: this.endpoint.index,
243
- ...options
244
- });
245
- await this.host.sendCommand(cc, this.commandOptions);
246
- }
247
- /**
248
- * Adds new nodes to an association group
249
- */
250
- async addNodeIds(groupId, ...nodeIds) {
251
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
252
- __assertType("nodeIds", void 0, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
253
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Set);
254
- const cc = new AssociationCCSet({
255
- nodeId: this.endpoint.nodeId,
256
- endpointIndex: this.endpoint.index,
257
- groupId,
258
- nodeIds
259
- });
260
- return this.host.sendCommand(cc, this.commandOptions);
261
- }
262
- /**
263
- * Removes nodes from an association group
264
- */
265
- async removeNodeIds(options) {
266
- __assertType("options", "AssociationCCRemoveOptions", __assertType__AssociationCCRemoveOptions.bind(void 0, options));
267
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Remove);
268
- if (!options.groupId) {
269
- if (this.version === 1) {
270
- throw new import_safe.ZWaveError(`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, import_safe.ZWaveErrorCodes.Argument_Invalid);
220
+ static {
221
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
222
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
223
+ AssociationCCAPI2 = _classThis = _classDescriptor.value;
224
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
225
+ __runInitializers(_classThis, _classExtraInitializers);
226
+ }
227
+ supportsCommand(cmd) {
228
+ switch (cmd) {
229
+ case import_Types.AssociationCommand.Get:
230
+ case import_Types.AssociationCommand.Set:
231
+ case import_Types.AssociationCommand.Report:
232
+ case import_Types.AssociationCommand.Remove:
233
+ case import_Types.AssociationCommand.SupportedGroupingsGet:
234
+ case import_Types.AssociationCommand.SupportedGroupingsReport:
235
+ return true;
236
+ case import_Types.AssociationCommand.SpecificGroupGet:
237
+ case import_Types.AssociationCommand.SpecificGroupReport:
238
+ return this.version >= 2;
271
239
  }
272
- } else if (options.groupId < 0) {
273
- throw new import_safe.ZWaveError("The group id must be positive!", import_safe.ZWaveErrorCodes.Argument_Invalid);
274
- }
275
- const cc = new AssociationCCRemove({
276
- nodeId: this.endpoint.nodeId,
277
- endpointIndex: this.endpoint.index,
278
- ...options
279
- });
280
- return this.host.sendCommand(cc, this.commandOptions);
281
- }
282
- /**
283
- * Removes nodes from all association groups
284
- */
285
- async removeNodeIdsFromAllGroups(nodeIds) {
286
- __assertType("nodeIds", void 0, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
287
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Remove);
288
- if (this.version >= 2) {
289
- return this.removeNodeIds({ nodeIds, groupId: 0 });
290
- } else {
291
- const groupCount = this.tryGetValueDB()?.getValue(AssociationCCValues.groupCount.endpoint(this.endpoint.index)) ?? 0;
292
- for (let groupId = 1; groupId <= groupCount; groupId++) {
293
- await this.removeNodeIds({ nodeIds, groupId });
240
+ return super.supportsCommand(cmd);
241
+ }
242
+ /**
243
+ * Returns the number of association groups a node supports.
244
+ * Association groups are consecutive, starting at 1.
245
+ */
246
+ async getGroupCount() {
247
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.SupportedGroupingsGet);
248
+ const cc = new AssociationCCSupportedGroupingsGet({
249
+ nodeId: this.endpoint.nodeId,
250
+ endpointIndex: this.endpoint.index
251
+ });
252
+ const response = await this.host.sendCommand(cc, this.commandOptions);
253
+ if (response)
254
+ return response.groupCount;
255
+ }
256
+ async reportGroupCount(groupCount) {
257
+ __assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount));
258
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.SupportedGroupingsReport);
259
+ const cc = new AssociationCCSupportedGroupingsReport({
260
+ nodeId: this.endpoint.nodeId,
261
+ endpointIndex: this.endpoint.index,
262
+ groupCount
263
+ });
264
+ await this.host.sendCommand(cc, this.commandOptions);
265
+ }
266
+ /**
267
+ * Returns information about an association group.
268
+ */
269
+ async getGroup(groupId) {
270
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
271
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Get);
272
+ const cc = new AssociationCCGet({
273
+ nodeId: this.endpoint.nodeId,
274
+ endpointIndex: this.endpoint.index,
275
+ groupId
276
+ });
277
+ const response = await this.host.sendCommand(cc, this.commandOptions);
278
+ if (response) {
279
+ return {
280
+ maxNodes: response.maxNodes,
281
+ nodeIds: response.nodeIds
282
+ };
294
283
  }
295
284
  }
296
- }
297
- /**
298
- * Request the association group that represents the most recently detected button press
299
- */
300
- async getSpecificGroup() {
301
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.SpecificGroupGet);
302
- const cc = new AssociationCCSpecificGroupGet({
303
- nodeId: this.endpoint.nodeId,
304
- endpointIndex: this.endpoint.index
305
- });
306
- const response = await this.host.sendCommand(cc, this.commandOptions);
307
- return response?.group;
308
- }
309
- /**
310
- * Report the association group that represents the most recently detected button press
311
- */
312
- async reportSpecificGroup(group) {
313
- __assertType("group", "number", __assertType__number.bind(void 0, group));
314
- this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.SpecificGroupReport);
315
- const cc = new AssociationCCSpecificGroupReport({
316
- nodeId: this.endpoint.nodeId,
317
- endpointIndex: this.endpoint.index,
318
- group
319
- });
320
- await this.host.sendCommand(cc, this.commandOptions);
321
- }
322
- };
323
- AssociationCCAPI = __decorate([
324
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Association)
325
- ], AssociationCCAPI);
326
- let AssociationCC = AssociationCC_1 = class AssociationCC2 extends import_CommandClass.CommandClass {
327
- determineRequiredCCInterviews() {
328
- return [
329
- ...super.determineRequiredCCInterviews(),
330
- import_safe.CommandClasses["Z-Wave Plus Info"],
331
- // We need information about endpoints to correctly configure the lifeline associations
332
- import_safe.CommandClasses["Multi Channel"]
333
- ];
334
- }
335
- /**
336
- * Returns the number of association groups reported by the node/endpoint.
337
- * This only works AFTER the interview process
338
- */
339
- static getGroupCountCached(ctx, endpoint) {
340
- return ctx.getValueDB(endpoint.nodeId).getValue(AssociationCCValues.groupCount.endpoint(endpoint.index)) || 0;
341
- }
342
- /**
343
- * Returns the number of nodes an association group supports.
344
- * This only works AFTER the interview process
345
- */
346
- static getMaxNodesCached(ctx, endpoint, groupId) {
347
- return ctx.getValueDB(endpoint.nodeId).getValue(AssociationCCValues.maxNodes(groupId).endpoint(endpoint.index)) ?? ctx.getDeviceConfig?.(endpoint.nodeId)?.getAssociationConfigForEndpoint(endpoint.index, groupId)?.maxNodes ?? 0;
348
- }
349
- /**
350
- * Returns all the destinations of all association groups reported by the node/endpoint.
351
- * This only works AFTER the interview process
352
- */
353
- static getAllDestinationsCached(ctx, endpoint) {
354
- const ret = /* @__PURE__ */ new Map();
355
- const groupCount = this.getGroupCountCached(ctx, endpoint);
356
- const valueDB = ctx.getValueDB(endpoint.nodeId);
357
- for (let i = 1; i <= groupCount; i++) {
358
- const nodes = valueDB.getValue(AssociationCCValues.nodeIds(i).endpoint(endpoint.index)) ?? [];
359
- ret.set(
360
- i,
361
- // Filter out duplicates
362
- (0, import_arrays.distinct)(nodes).map((nodeId) => ({ nodeId }))
363
- );
364
- }
365
- return ret;
366
- }
367
- async interview(ctx) {
368
- const node = this.getNode(ctx);
369
- const endpoint = this.getEndpoint(ctx);
370
- const api = import_API.CCAPI.create(import_safe.CommandClasses.Association, ctx, endpoint).withOptions({
371
- priority: import_safe.MessagePriority.NodeQuery
372
- });
373
- ctx.logNode(node.id, {
374
- endpoint: this.endpointIndex,
375
- message: `Interviewing ${this.ccName}...`,
376
- direction: "none"
377
- });
378
- ctx.logNode(node.id, {
379
- endpoint: this.endpointIndex,
380
- message: "querying number of association groups...",
381
- direction: "outbound"
382
- });
383
- const groupCount = await api.getGroupCount();
384
- if (groupCount != void 0) {
385
- ctx.logNode(node.id, {
386
- endpoint: this.endpointIndex,
387
- message: `supports ${groupCount} association groups`,
388
- direction: "inbound"
285
+ async sendReport(options) {
286
+ __assertType("options", "AssociationCCReportOptions", __assertType__AssociationCCReportOptions.bind(void 0, options));
287
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Report);
288
+ const cc = new AssociationCCReport({
289
+ nodeId: this.endpoint.nodeId,
290
+ endpointIndex: this.endpoint.index,
291
+ ...options
389
292
  });
390
- } else {
391
- ctx.logNode(node.id, {
392
- endpoint: this.endpointIndex,
393
- message: "Querying association groups timed out, skipping interview...",
394
- level: "warn"
293
+ await this.host.sendCommand(cc, this.commandOptions);
294
+ }
295
+ /**
296
+ * Adds new nodes to an association group
297
+ */
298
+ async addNodeIds(groupId, ...nodeIds) {
299
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
300
+ __assertType("nodeIds", void 0, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
301
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Set);
302
+ const cc = new AssociationCCSet({
303
+ nodeId: this.endpoint.nodeId,
304
+ endpointIndex: this.endpoint.index,
305
+ groupId,
306
+ nodeIds
395
307
  });
396
- return;
308
+ return this.host.sendCommand(cc, this.commandOptions);
309
+ }
310
+ /**
311
+ * Removes nodes from an association group
312
+ */
313
+ async removeNodeIds(options) {
314
+ __assertType("options", "AssociationCCRemoveOptions", __assertType__AssociationCCRemoveOptions.bind(void 0, options));
315
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Remove);
316
+ if (!options.groupId) {
317
+ if (this.version === 1) {
318
+ throw new import_safe.ZWaveError(`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, import_safe.ZWaveErrorCodes.Argument_Invalid);
319
+ }
320
+ } else if (options.groupId < 0) {
321
+ throw new import_safe.ZWaveError("The group id must be positive!", import_safe.ZWaveErrorCodes.Argument_Invalid);
322
+ }
323
+ const cc = new AssociationCCRemove({
324
+ nodeId: this.endpoint.nodeId,
325
+ endpointIndex: this.endpoint.index,
326
+ ...options
327
+ });
328
+ return this.host.sendCommand(cc, this.commandOptions);
329
+ }
330
+ /**
331
+ * Removes nodes from all association groups
332
+ */
333
+ async removeNodeIdsFromAllGroups(nodeIds) {
334
+ __assertType("nodeIds", void 0, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
335
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.Remove);
336
+ if (this.version >= 2) {
337
+ return this.removeNodeIds({ nodeIds, groupId: 0 });
338
+ } else {
339
+ const groupCount = this.tryGetValueDB()?.getValue(AssociationCCValues.groupCount.endpoint(this.endpoint.index)) ?? 0;
340
+ for (let groupId = 1; groupId <= groupCount; groupId++) {
341
+ await this.removeNodeIds({ nodeIds, groupId });
342
+ }
343
+ }
344
+ }
345
+ /**
346
+ * Request the association group that represents the most recently detected button press
347
+ */
348
+ async getSpecificGroup() {
349
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.SpecificGroupGet);
350
+ const cc = new AssociationCCSpecificGroupGet({
351
+ nodeId: this.endpoint.nodeId,
352
+ endpointIndex: this.endpoint.index
353
+ });
354
+ const response = await this.host.sendCommand(cc, this.commandOptions);
355
+ return response?.group;
356
+ }
357
+ /**
358
+ * Report the association group that represents the most recently detected button press
359
+ */
360
+ async reportSpecificGroup(group) {
361
+ __assertType("group", "number", __assertType__number.bind(void 0, group));
362
+ this.assertSupportsCommand(import_Types.AssociationCommand, import_Types.AssociationCommand.SpecificGroupReport);
363
+ const cc = new AssociationCCSpecificGroupReport({
364
+ nodeId: this.endpoint.nodeId,
365
+ endpointIndex: this.endpoint.index,
366
+ group
367
+ });
368
+ await this.host.sendCommand(cc, this.commandOptions);
369
+ }
370
+ };
371
+ return AssociationCCAPI2 = _classThis;
372
+ })();
373
+ let AssociationCC = (() => {
374
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Association), (0, import_CommandClassDecorators.implementedVersion)(4), (0, import_CommandClassDecorators.ccValues)(AssociationCCValues)];
375
+ let _classDescriptor;
376
+ let _classExtraInitializers = [];
377
+ let _classThis;
378
+ let _classSuper = import_CommandClass.CommandClass;
379
+ var AssociationCC2 = class extends _classSuper {
380
+ static {
381
+ _classThis = this;
382
+ }
383
+ static {
384
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
385
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
386
+ AssociationCC2 = _classThis = _classDescriptor.value;
387
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
388
+ __runInitializers(_classThis, _classExtraInitializers);
389
+ }
390
+ determineRequiredCCInterviews() {
391
+ return [
392
+ ...super.determineRequiredCCInterviews(),
393
+ import_safe.CommandClasses["Z-Wave Plus Info"],
394
+ // We need information about endpoints to correctly configure the lifeline associations
395
+ import_safe.CommandClasses["Multi Channel"]
396
+ ];
397
397
  }
398
- await this.refreshValues(ctx);
399
- if (endpoint.supportsCC(import_safe.CommandClasses["Multi Channel Association"])) {
398
+ /**
399
+ * Returns the number of association groups reported by the node/endpoint.
400
+ * This only works AFTER the interview process
401
+ */
402
+ static getGroupCountCached(ctx, endpoint) {
403
+ return ctx.getValueDB(endpoint.nodeId).getValue(AssociationCCValues.groupCount.endpoint(endpoint.index)) || 0;
404
+ }
405
+ /**
406
+ * Returns the number of nodes an association group supports.
407
+ * This only works AFTER the interview process
408
+ */
409
+ static getMaxNodesCached(ctx, endpoint, groupId) {
410
+ return ctx.getValueDB(endpoint.nodeId).getValue(AssociationCCValues.maxNodes(groupId).endpoint(endpoint.index)) ?? ctx.getDeviceConfig?.(endpoint.nodeId)?.getAssociationConfigForEndpoint(endpoint.index, groupId)?.maxNodes ?? 0;
411
+ }
412
+ /**
413
+ * Returns all the destinations of all association groups reported by the node/endpoint.
414
+ * This only works AFTER the interview process
415
+ */
416
+ static getAllDestinationsCached(ctx, endpoint) {
417
+ const ret = /* @__PURE__ */ new Map();
418
+ const groupCount = this.getGroupCountCached(ctx, endpoint);
419
+ const valueDB = ctx.getValueDB(endpoint.nodeId);
420
+ for (let i = 1; i <= groupCount; i++) {
421
+ const nodes = valueDB.getValue(AssociationCCValues.nodeIds(i).endpoint(endpoint.index)) ?? [];
422
+ ret.set(
423
+ i,
424
+ // Filter out duplicates
425
+ (0, import_arrays.distinct)(nodes).map((nodeId) => ({ nodeId }))
426
+ );
427
+ }
428
+ return ret;
429
+ }
430
+ async interview(ctx) {
431
+ const node = this.getNode(ctx);
432
+ const endpoint = this.getEndpoint(ctx);
433
+ const api = import_API.CCAPI.create(import_safe.CommandClasses.Association, ctx, endpoint).withOptions({
434
+ priority: import_safe.MessagePriority.NodeQuery
435
+ });
400
436
  ctx.logNode(node.id, {
401
437
  endpoint: this.endpointIndex,
402
- message: `${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,
438
+ message: `Interviewing ${this.ccName}...`,
403
439
  direction: "none"
404
440
  });
405
- this.setInterviewComplete(ctx, true);
406
- return;
407
- }
408
- await ccUtils.configureLifelineAssociations(ctx, endpoint);
409
- this.setInterviewComplete(ctx, true);
410
- }
411
- async refreshValues(ctx) {
412
- const node = this.getNode(ctx);
413
- const endpoint = this.getEndpoint(ctx);
414
- const api = import_API.CCAPI.create(import_safe.CommandClasses.Association, ctx, endpoint).withOptions({
415
- priority: import_safe.MessagePriority.NodeQuery
416
- });
417
- const groupCount = AssociationCC_1.getGroupCountCached(ctx, endpoint);
418
- for (let groupId = 1; groupId <= groupCount; groupId++) {
419
441
  ctx.logNode(node.id, {
420
442
  endpoint: this.endpointIndex,
421
- message: `querying association group #${groupId}...`,
443
+ message: "querying number of association groups...",
422
444
  direction: "outbound"
423
445
  });
424
- const group = await api.getGroup(groupId);
425
- if (group != void 0) {
426
- const logMessage = `received information for association group #${groupId}:
427
- maximum # of nodes: ${group.maxNodes}
428
- currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
446
+ const groupCount = await api.getGroupCount();
447
+ if (groupCount != void 0) {
429
448
  ctx.logNode(node.id, {
430
449
  endpoint: this.endpointIndex,
431
- message: logMessage,
450
+ message: `supports ${groupCount} association groups`,
432
451
  direction: "inbound"
433
452
  });
453
+ } else {
454
+ ctx.logNode(node.id, {
455
+ endpoint: this.endpointIndex,
456
+ message: "Querying association groups timed out, skipping interview...",
457
+ level: "warn"
458
+ });
459
+ return;
460
+ }
461
+ await this.refreshValues(ctx);
462
+ if (endpoint.supportsCC(import_safe.CommandClasses["Multi Channel Association"])) {
463
+ ctx.logNode(node.id, {
464
+ endpoint: this.endpointIndex,
465
+ message: `${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,
466
+ direction: "none"
467
+ });
468
+ this.setInterviewComplete(ctx, true);
469
+ return;
434
470
  }
471
+ await ccUtils.configureLifelineAssociations(ctx, endpoint);
472
+ this.setInterviewComplete(ctx, true);
435
473
  }
436
- }
437
- };
438
- AssociationCC = AssociationCC_1 = __decorate([
439
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Association),
440
- (0, import_CommandClassDecorators.implementedVersion)(4),
441
- (0, import_CommandClassDecorators.ccValues)(AssociationCCValues)
442
- ], AssociationCC);
443
- let AssociationCCSet = AssociationCCSet_1 = class AssociationCCSet2 extends AssociationCC {
444
- constructor(options) {
445
- super(options);
446
- if (options.groupId < 1) {
447
- throw new import_safe.ZWaveError("The group id must be positive!", import_safe.ZWaveErrorCodes.Argument_Invalid);
448
- }
449
- if (options.nodeIds.some((n) => n < 1 || n > import_safe.MAX_NODES)) {
450
- throw new import_safe.ZWaveError(`All node IDs must be between 1 and ${import_safe.MAX_NODES}!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
451
- }
452
- this.groupId = options.groupId;
453
- this.nodeIds = options.nodeIds;
454
- }
455
- static from(raw, ctx) {
456
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
457
- const groupId = raw.payload[0];
458
- const nodeIds = [...raw.payload.subarray(1)];
459
- return new AssociationCCSet_1({
460
- nodeId: ctx.sourceNodeId,
461
- groupId,
462
- nodeIds
463
- });
464
- }
465
- groupId;
466
- nodeIds;
467
- serialize(ctx) {
468
- this.payload = import_safe2.Bytes.from([this.groupId, ...this.nodeIds]);
469
- return super.serialize(ctx);
470
- }
471
- toLogEntry(ctx) {
472
- const message = {
473
- "group id": this.groupId || "all groups",
474
- "node ids": this.nodeIds.length ? this.nodeIds.join(", ") : "all nodes"
475
- };
476
- return {
477
- ...super.toLogEntry(ctx),
478
- message
479
- };
480
- }
481
- };
482
- AssociationCCSet = AssociationCCSet_1 = __decorate([
483
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.Set),
484
- (0, import_CommandClassDecorators.useSupervision)()
485
- ], AssociationCCSet);
486
- let AssociationCCRemove = AssociationCCRemove_1 = class AssociationCCRemove2 extends AssociationCC {
487
- constructor(options) {
488
- super(options);
489
- this.groupId = options.groupId;
490
- this.nodeIds = options.nodeIds;
491
- }
492
- static from(raw, ctx) {
493
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
494
- let groupId;
495
- if (raw.payload[0] !== 0) {
496
- groupId = raw.payload[0];
497
- }
498
- const nodeIds = [...raw.payload.subarray(1)];
499
- return new AssociationCCRemove_1({
500
- nodeId: ctx.sourceNodeId,
501
- groupId,
502
- nodeIds
503
- });
504
- }
505
- groupId;
506
- nodeIds;
507
- serialize(ctx) {
508
- this.payload = import_safe2.Bytes.from([
509
- this.groupId || 0,
510
- ...this.nodeIds || []
511
- ]);
512
- return super.serialize(ctx);
513
- }
514
- toLogEntry(ctx) {
515
- const message = {
516
- "group id": this.groupId || "all groups",
517
- "node ids": this.nodeIds && this.nodeIds.length ? this.nodeIds.join(", ") : "all nodes"
518
- };
519
- return {
520
- ...super.toLogEntry(ctx),
521
- message
522
- };
523
- }
524
- };
525
- AssociationCCRemove = AssociationCCRemove_1 = __decorate([
526
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.Remove),
527
- (0, import_CommandClassDecorators.useSupervision)()
528
- ], AssociationCCRemove);
529
- let AssociationCCReport = AssociationCCReport_1 = class AssociationCCReport2 extends AssociationCC {
530
- constructor(options) {
531
- super(options);
532
- this.groupId = options.groupId;
533
- this.maxNodes = options.maxNodes;
534
- this.nodeIds = options.nodeIds;
535
- this.reportsToFollow = options.reportsToFollow;
536
- }
537
- static from(raw, ctx) {
538
- (0, import_safe.validatePayload)(raw.payload.length >= 3);
539
- const groupId = raw.payload[0];
540
- const maxNodes = raw.payload[1];
541
- const reportsToFollow = raw.payload[2];
542
- const nodeIds = [...raw.payload.subarray(3)];
543
- return new AssociationCCReport_1({
544
- nodeId: ctx.sourceNodeId,
545
- groupId,
546
- maxNodes,
547
- reportsToFollow,
548
- nodeIds
549
- });
550
- }
551
- groupId;
552
- maxNodes;
553
- nodeIds;
554
- reportsToFollow;
555
- getPartialCCSessionId() {
556
- return { groupId: this.groupId };
557
- }
558
- expectMoreMessages() {
559
- return this.reportsToFollow > 0;
560
- }
561
- mergePartialCCs(partials, _ctx) {
562
- this.nodeIds = [...partials, this].map((report) => report.nodeIds).reduce((prev, cur) => prev.concat(...cur), []);
563
- }
564
- serialize(ctx) {
565
- this.payload = import_safe2.Bytes.from([
566
- this.groupId,
567
- this.maxNodes,
568
- this.reportsToFollow,
569
- ...this.nodeIds
570
- ]);
571
- return super.serialize(ctx);
572
- }
573
- toLogEntry(ctx) {
574
- return {
575
- ...super.toLogEntry(ctx),
576
- message: {
577
- "group id": this.groupId,
578
- "max # of nodes": this.maxNodes,
579
- "node IDs": this.nodeIds.join(", "),
580
- "reports to follow": this.reportsToFollow
474
+ async refreshValues(ctx) {
475
+ const node = this.getNode(ctx);
476
+ const endpoint = this.getEndpoint(ctx);
477
+ const api = import_API.CCAPI.create(import_safe.CommandClasses.Association, ctx, endpoint).withOptions({
478
+ priority: import_safe.MessagePriority.NodeQuery
479
+ });
480
+ const groupCount = AssociationCC2.getGroupCountCached(ctx, endpoint);
481
+ for (let groupId = 1; groupId <= groupCount; groupId++) {
482
+ ctx.logNode(node.id, {
483
+ endpoint: this.endpointIndex,
484
+ message: `querying association group #${groupId}...`,
485
+ direction: "outbound"
486
+ });
487
+ const group = await api.getGroup(groupId);
488
+ if (group != void 0) {
489
+ const logMessage = `received information for association group #${groupId}:
490
+ maximum # of nodes: ${group.maxNodes}
491
+ currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
492
+ ctx.logNode(node.id, {
493
+ endpoint: this.endpointIndex,
494
+ message: logMessage,
495
+ direction: "inbound"
496
+ });
497
+ }
581
498
  }
582
- };
583
- }
584
- };
585
- __decorate([
586
- (0, import_CommandClassDecorators.ccValue)(AssociationCCValues.maxNodes, (self) => [self.groupId])
587
- ], AssociationCCReport.prototype, "maxNodes", void 0);
588
- __decorate([
589
- (0, import_CommandClassDecorators.ccValue)(AssociationCCValues.nodeIds, (self) => [self.groupId])
590
- ], AssociationCCReport.prototype, "nodeIds", void 0);
591
- AssociationCCReport = AssociationCCReport_1 = __decorate([
592
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.Report)
593
- ], AssociationCCReport);
594
- let AssociationCCGet = AssociationCCGet_1 = class AssociationCCGet2 extends AssociationCC {
595
- constructor(options) {
596
- super(options);
597
- if (options.groupId < 1) {
598
- throw new import_safe.ZWaveError("The group id must be positive!", import_safe.ZWaveErrorCodes.Argument_Invalid);
599
- }
600
- this.groupId = options.groupId;
601
- }
602
- static from(raw, ctx) {
603
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
604
- const groupId = raw.payload[0];
605
- return new AssociationCCGet_1({
606
- nodeId: ctx.sourceNodeId,
607
- groupId
608
- });
609
- }
610
- groupId;
611
- serialize(ctx) {
612
- this.payload = import_safe2.Bytes.from([this.groupId]);
613
- return super.serialize(ctx);
614
- }
615
- toLogEntry(ctx) {
616
- return {
617
- ...super.toLogEntry(ctx),
618
- message: { "group id": this.groupId }
619
- };
620
- }
621
- };
622
- AssociationCCGet = AssociationCCGet_1 = __decorate([
623
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.Get),
624
- (0, import_CommandClassDecorators.expectedCCResponse)(AssociationCCReport)
625
- ], AssociationCCGet);
626
- let AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport_1 = class AssociationCCSupportedGroupingsReport2 extends AssociationCC {
627
- constructor(options) {
628
- super(options);
629
- this.groupCount = options.groupCount;
630
- }
631
- static from(raw, ctx) {
632
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
633
- const groupCount = raw.payload[0];
634
- return new AssociationCCSupportedGroupingsReport_1({
635
- nodeId: ctx.sourceNodeId,
636
- groupCount
637
- });
638
- }
639
- groupCount;
640
- serialize(ctx) {
641
- this.payload = import_safe2.Bytes.from([this.groupCount]);
642
- return super.serialize(ctx);
643
- }
644
- toLogEntry(ctx) {
645
- return {
646
- ...super.toLogEntry(ctx),
647
- message: { "group count": this.groupCount }
648
- };
649
- }
650
- };
651
- __decorate([
652
- (0, import_CommandClassDecorators.ccValue)(AssociationCCValues.groupCount)
653
- ], AssociationCCSupportedGroupingsReport.prototype, "groupCount", void 0);
654
- AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport_1 = __decorate([
655
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.SupportedGroupingsReport)
656
- ], AssociationCCSupportedGroupingsReport);
657
- let AssociationCCSupportedGroupingsGet = class AssociationCCSupportedGroupingsGet2 extends AssociationCC {
658
- };
659
- AssociationCCSupportedGroupingsGet = __decorate([
660
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.SupportedGroupingsGet),
661
- (0, import_CommandClassDecorators.expectedCCResponse)(AssociationCCSupportedGroupingsReport)
662
- ], AssociationCCSupportedGroupingsGet);
663
- let AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport_1 = class AssociationCCSpecificGroupReport2 extends AssociationCC {
664
- constructor(options) {
665
- super(options);
666
- this.group = options.group;
667
- }
668
- static from(raw, ctx) {
669
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
670
- const group = raw.payload[0];
671
- return new AssociationCCSpecificGroupReport_1({
672
- nodeId: ctx.sourceNodeId,
673
- group
674
- });
675
- }
676
- group;
677
- serialize(ctx) {
678
- this.payload = import_safe2.Bytes.from([this.group]);
679
- return super.serialize(ctx);
680
- }
681
- toLogEntry(ctx) {
682
- return {
683
- ...super.toLogEntry(ctx),
684
- message: { group: this.group }
685
- };
686
- }
687
- };
688
- AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport_1 = __decorate([
689
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.SpecificGroupReport)
690
- ], AssociationCCSpecificGroupReport);
691
- let AssociationCCSpecificGroupGet = class AssociationCCSpecificGroupGet2 extends AssociationCC {
692
- };
693
- AssociationCCSpecificGroupGet = __decorate([
694
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.SpecificGroupGet),
695
- (0, import_CommandClassDecorators.expectedCCResponse)(AssociationCCSpecificGroupReport)
696
- ], AssociationCCSpecificGroupGet);
499
+ }
500
+ };
501
+ return AssociationCC2 = _classThis;
502
+ })();
503
+ let AssociationCCSet = (() => {
504
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.Set), (0, import_CommandClassDecorators.useSupervision)()];
505
+ let _classDescriptor;
506
+ let _classExtraInitializers = [];
507
+ let _classThis;
508
+ let _classSuper = AssociationCC;
509
+ var AssociationCCSet2 = class extends _classSuper {
510
+ static {
511
+ _classThis = this;
512
+ }
513
+ static {
514
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
515
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
516
+ AssociationCCSet2 = _classThis = _classDescriptor.value;
517
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
518
+ __runInitializers(_classThis, _classExtraInitializers);
519
+ }
520
+ constructor(options) {
521
+ super(options);
522
+ if (options.groupId < 1) {
523
+ throw new import_safe.ZWaveError("The group id must be positive!", import_safe.ZWaveErrorCodes.Argument_Invalid);
524
+ }
525
+ if (options.nodeIds.some((n) => n < 1 || n > import_safe.MAX_NODES)) {
526
+ throw new import_safe.ZWaveError(`All node IDs must be between 1 and ${import_safe.MAX_NODES}!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
527
+ }
528
+ this.groupId = options.groupId;
529
+ this.nodeIds = options.nodeIds;
530
+ }
531
+ static from(raw, ctx) {
532
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
533
+ const groupId = raw.payload[0];
534
+ const nodeIds = [...raw.payload.subarray(1)];
535
+ return new this({
536
+ nodeId: ctx.sourceNodeId,
537
+ groupId,
538
+ nodeIds
539
+ });
540
+ }
541
+ groupId;
542
+ nodeIds;
543
+ serialize(ctx) {
544
+ this.payload = import_safe2.Bytes.from([this.groupId, ...this.nodeIds]);
545
+ return super.serialize(ctx);
546
+ }
547
+ toLogEntry(ctx) {
548
+ const message = {
549
+ "group id": this.groupId || "all groups",
550
+ "node ids": this.nodeIds.length ? this.nodeIds.join(", ") : "all nodes"
551
+ };
552
+ return {
553
+ ...super.toLogEntry(ctx),
554
+ message
555
+ };
556
+ }
557
+ };
558
+ return AssociationCCSet2 = _classThis;
559
+ })();
560
+ let AssociationCCRemove = (() => {
561
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.Remove), (0, import_CommandClassDecorators.useSupervision)()];
562
+ let _classDescriptor;
563
+ let _classExtraInitializers = [];
564
+ let _classThis;
565
+ let _classSuper = AssociationCC;
566
+ var AssociationCCRemove2 = class extends _classSuper {
567
+ static {
568
+ _classThis = this;
569
+ }
570
+ static {
571
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
572
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
573
+ AssociationCCRemove2 = _classThis = _classDescriptor.value;
574
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
575
+ __runInitializers(_classThis, _classExtraInitializers);
576
+ }
577
+ constructor(options) {
578
+ super(options);
579
+ this.groupId = options.groupId;
580
+ this.nodeIds = options.nodeIds;
581
+ }
582
+ static from(raw, ctx) {
583
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
584
+ let groupId;
585
+ if (raw.payload[0] !== 0) {
586
+ groupId = raw.payload[0];
587
+ }
588
+ const nodeIds = [...raw.payload.subarray(1)];
589
+ return new this({
590
+ nodeId: ctx.sourceNodeId,
591
+ groupId,
592
+ nodeIds
593
+ });
594
+ }
595
+ groupId;
596
+ nodeIds;
597
+ serialize(ctx) {
598
+ this.payload = import_safe2.Bytes.from([
599
+ this.groupId || 0,
600
+ ...this.nodeIds || []
601
+ ]);
602
+ return super.serialize(ctx);
603
+ }
604
+ toLogEntry(ctx) {
605
+ const message = {
606
+ "group id": this.groupId || "all groups",
607
+ "node ids": this.nodeIds && this.nodeIds.length ? this.nodeIds.join(", ") : "all nodes"
608
+ };
609
+ return {
610
+ ...super.toLogEntry(ctx),
611
+ message
612
+ };
613
+ }
614
+ };
615
+ return AssociationCCRemove2 = _classThis;
616
+ })();
617
+ let AssociationCCReport = (() => {
618
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.Report), (0, import_CommandClassDecorators.ccValueProperty)("maxNodes", AssociationCCValues.maxNodes, (self) => [self.groupId]), (0, import_CommandClassDecorators.ccValueProperty)("nodeIds", AssociationCCValues.nodeIds, (self) => [self.groupId])];
619
+ let _classDescriptor;
620
+ let _classExtraInitializers = [];
621
+ let _classThis;
622
+ let _classSuper = AssociationCC;
623
+ var AssociationCCReport2 = class extends _classSuper {
624
+ static {
625
+ _classThis = this;
626
+ }
627
+ static {
628
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
629
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
630
+ AssociationCCReport2 = _classThis = _classDescriptor.value;
631
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
632
+ __runInitializers(_classThis, _classExtraInitializers);
633
+ }
634
+ constructor(options) {
635
+ super(options);
636
+ this.groupId = options.groupId;
637
+ this.maxNodes = options.maxNodes;
638
+ this.nodeIds = options.nodeIds;
639
+ this.reportsToFollow = options.reportsToFollow;
640
+ }
641
+ static from(raw, ctx) {
642
+ (0, import_safe.validatePayload)(raw.payload.length >= 3);
643
+ const groupId = raw.payload[0];
644
+ const maxNodes = raw.payload[1];
645
+ const reportsToFollow = raw.payload[2];
646
+ const nodeIds = [...raw.payload.subarray(3)];
647
+ return new this({
648
+ nodeId: ctx.sourceNodeId,
649
+ groupId,
650
+ maxNodes,
651
+ reportsToFollow,
652
+ nodeIds
653
+ });
654
+ }
655
+ groupId;
656
+ maxNodes;
657
+ nodeIds;
658
+ reportsToFollow;
659
+ getPartialCCSessionId() {
660
+ return { groupId: this.groupId };
661
+ }
662
+ expectMoreMessages() {
663
+ return this.reportsToFollow > 0;
664
+ }
665
+ mergePartialCCs(partials, _ctx) {
666
+ this.nodeIds = [...partials, this].map((report) => report.nodeIds).reduce((prev, cur) => prev.concat(...cur), []);
667
+ }
668
+ serialize(ctx) {
669
+ this.payload = import_safe2.Bytes.from([
670
+ this.groupId,
671
+ this.maxNodes,
672
+ this.reportsToFollow,
673
+ ...this.nodeIds
674
+ ]);
675
+ return super.serialize(ctx);
676
+ }
677
+ toLogEntry(ctx) {
678
+ return {
679
+ ...super.toLogEntry(ctx),
680
+ message: {
681
+ "group id": this.groupId,
682
+ "max # of nodes": this.maxNodes,
683
+ "node IDs": this.nodeIds.join(", "),
684
+ "reports to follow": this.reportsToFollow
685
+ }
686
+ };
687
+ }
688
+ };
689
+ return AssociationCCReport2 = _classThis;
690
+ })();
691
+ let AssociationCCGet = (() => {
692
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(AssociationCCReport)];
693
+ let _classDescriptor;
694
+ let _classExtraInitializers = [];
695
+ let _classThis;
696
+ let _classSuper = AssociationCC;
697
+ var AssociationCCGet2 = class extends _classSuper {
698
+ static {
699
+ _classThis = this;
700
+ }
701
+ static {
702
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
703
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
704
+ AssociationCCGet2 = _classThis = _classDescriptor.value;
705
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
706
+ __runInitializers(_classThis, _classExtraInitializers);
707
+ }
708
+ constructor(options) {
709
+ super(options);
710
+ if (options.groupId < 1) {
711
+ throw new import_safe.ZWaveError("The group id must be positive!", import_safe.ZWaveErrorCodes.Argument_Invalid);
712
+ }
713
+ this.groupId = options.groupId;
714
+ }
715
+ static from(raw, ctx) {
716
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
717
+ const groupId = raw.payload[0];
718
+ return new this({
719
+ nodeId: ctx.sourceNodeId,
720
+ groupId
721
+ });
722
+ }
723
+ groupId;
724
+ serialize(ctx) {
725
+ this.payload = import_safe2.Bytes.from([this.groupId]);
726
+ return super.serialize(ctx);
727
+ }
728
+ toLogEntry(ctx) {
729
+ return {
730
+ ...super.toLogEntry(ctx),
731
+ message: { "group id": this.groupId }
732
+ };
733
+ }
734
+ };
735
+ return AssociationCCGet2 = _classThis;
736
+ })();
737
+ let AssociationCCSupportedGroupingsReport = (() => {
738
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.SupportedGroupingsReport), (0, import_CommandClassDecorators.ccValueProperty)("groupCount", AssociationCCValues.groupCount)];
739
+ let _classDescriptor;
740
+ let _classExtraInitializers = [];
741
+ let _classThis;
742
+ let _classSuper = AssociationCC;
743
+ var AssociationCCSupportedGroupingsReport2 = class extends _classSuper {
744
+ static {
745
+ _classThis = this;
746
+ }
747
+ static {
748
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
749
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
750
+ AssociationCCSupportedGroupingsReport2 = _classThis = _classDescriptor.value;
751
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
752
+ __runInitializers(_classThis, _classExtraInitializers);
753
+ }
754
+ constructor(options) {
755
+ super(options);
756
+ this.groupCount = options.groupCount;
757
+ }
758
+ static from(raw, ctx) {
759
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
760
+ const groupCount = raw.payload[0];
761
+ return new this({
762
+ nodeId: ctx.sourceNodeId,
763
+ groupCount
764
+ });
765
+ }
766
+ groupCount;
767
+ serialize(ctx) {
768
+ this.payload = import_safe2.Bytes.from([this.groupCount]);
769
+ return super.serialize(ctx);
770
+ }
771
+ toLogEntry(ctx) {
772
+ return {
773
+ ...super.toLogEntry(ctx),
774
+ message: { "group count": this.groupCount }
775
+ };
776
+ }
777
+ };
778
+ return AssociationCCSupportedGroupingsReport2 = _classThis;
779
+ })();
780
+ let AssociationCCSupportedGroupingsGet = (() => {
781
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.SupportedGroupingsGet), (0, import_CommandClassDecorators.expectedCCResponse)(AssociationCCSupportedGroupingsReport)];
782
+ let _classDescriptor;
783
+ let _classExtraInitializers = [];
784
+ let _classThis;
785
+ let _classSuper = AssociationCC;
786
+ var AssociationCCSupportedGroupingsGet2 = class extends _classSuper {
787
+ static {
788
+ _classThis = this;
789
+ }
790
+ static {
791
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
792
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
793
+ AssociationCCSupportedGroupingsGet2 = _classThis = _classDescriptor.value;
794
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
795
+ __runInitializers(_classThis, _classExtraInitializers);
796
+ }
797
+ };
798
+ return AssociationCCSupportedGroupingsGet2 = _classThis;
799
+ })();
800
+ let AssociationCCSpecificGroupReport = (() => {
801
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.SpecificGroupReport)];
802
+ let _classDescriptor;
803
+ let _classExtraInitializers = [];
804
+ let _classThis;
805
+ let _classSuper = AssociationCC;
806
+ var AssociationCCSpecificGroupReport2 = class extends _classSuper {
807
+ static {
808
+ _classThis = this;
809
+ }
810
+ static {
811
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
812
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
813
+ AssociationCCSpecificGroupReport2 = _classThis = _classDescriptor.value;
814
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
815
+ __runInitializers(_classThis, _classExtraInitializers);
816
+ }
817
+ constructor(options) {
818
+ super(options);
819
+ this.group = options.group;
820
+ }
821
+ static from(raw, ctx) {
822
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
823
+ const group = raw.payload[0];
824
+ return new this({
825
+ nodeId: ctx.sourceNodeId,
826
+ group
827
+ });
828
+ }
829
+ group;
830
+ serialize(ctx) {
831
+ this.payload = import_safe2.Bytes.from([this.group]);
832
+ return super.serialize(ctx);
833
+ }
834
+ toLogEntry(ctx) {
835
+ return {
836
+ ...super.toLogEntry(ctx),
837
+ message: { group: this.group }
838
+ };
839
+ }
840
+ };
841
+ return AssociationCCSpecificGroupReport2 = _classThis;
842
+ })();
843
+ let AssociationCCSpecificGroupGet = (() => {
844
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationCommand.SpecificGroupGet), (0, import_CommandClassDecorators.expectedCCResponse)(AssociationCCSpecificGroupReport)];
845
+ let _classDescriptor;
846
+ let _classExtraInitializers = [];
847
+ let _classThis;
848
+ let _classSuper = AssociationCC;
849
+ var AssociationCCSpecificGroupGet2 = class extends _classSuper {
850
+ static {
851
+ _classThis = this;
852
+ }
853
+ static {
854
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
855
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
856
+ AssociationCCSpecificGroupGet2 = _classThis = _classDescriptor.value;
857
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
858
+ __runInitializers(_classThis, _classExtraInitializers);
859
+ }
860
+ };
861
+ return AssociationCCSpecificGroupGet2 = _classThis;
862
+ })();
697
863
  // Annotate the CommonJS export names for ESM import in node:
698
864
  0 && (module.exports = {
699
865
  AssociationCC,