@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
@@ -1,10 +1,37 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- 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;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
6
34
  };
7
- var MultiChannelAssociationCCSet_1, MultiChannelAssociationCCRemove_1, MultiChannelAssociationCCReport_1, MultiChannelAssociationCCGet_1, MultiChannelAssociationCCSupportedGroupingsReport_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -335,7 +362,7 @@ import { Bytes } from "@zwave-js/shared/safe";
335
362
  import { pick } from "@zwave-js/shared/safe";
336
363
  import { CCAPI, PhysicalCCAPI } from "../lib/API.js";
337
364
  import { CommandClass, } from "../lib/CommandClass.js";
338
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
365
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
339
366
  import { V } from "../lib/Values.js";
340
367
  import { MultiChannelAssociationCommand, } from "../lib/_Types.js";
341
368
  import * as ccUtils from "../lib/utils.js";
@@ -423,559 +450,645 @@ function deserializeMultiChannelAssociationDestination(data) {
423
450
  return { nodeIds, endpoints };
424
451
  }
425
452
  // @noSetValueAPI
426
- let MultiChannelAssociationCCAPI = class MultiChannelAssociationCCAPI extends PhysicalCCAPI {
427
- supportsCommand(cmd) {
428
- switch (cmd) {
429
- case MultiChannelAssociationCommand.Get:
430
- case MultiChannelAssociationCommand.Set:
431
- case MultiChannelAssociationCommand.Report:
432
- case MultiChannelAssociationCommand.Remove:
433
- case MultiChannelAssociationCommand.SupportedGroupingsGet:
434
- case MultiChannelAssociationCommand.SupportedGroupingsReport:
435
- return true; // This is mandatory
436
- }
437
- return super.supportsCommand(cmd);
438
- }
439
- /**
440
- * Returns the number of association groups a node supports.
441
- * Association groups are consecutive, starting at 1.
442
- */
443
- async getGroupCount() {
444
- this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.SupportedGroupingsGet);
445
- const cc = new MultiChannelAssociationCCSupportedGroupingsGet({
446
- nodeId: this.endpoint.nodeId,
447
- endpointIndex: this.endpoint.index,
448
- });
449
- const response = await this.host.sendCommand(cc, this.commandOptions);
450
- return response?.groupCount;
451
- }
452
- async reportGroupCount(groupCount) {
453
- __assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount));
454
- this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.SupportedGroupingsReport);
455
- const cc = new MultiChannelAssociationCCSupportedGroupingsReport({
456
- nodeId: this.endpoint.nodeId,
457
- endpointIndex: this.endpoint.index,
458
- groupCount,
459
- });
460
- await this.host.sendCommand(cc, this.commandOptions);
461
- }
462
- /**
463
- * Returns information about an association group.
464
- */
465
- async getGroup(groupId) {
466
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
467
- this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.Get);
468
- const cc = new MultiChannelAssociationCCGet({
469
- nodeId: this.endpoint.nodeId,
470
- endpointIndex: this.endpoint.index,
471
- groupId,
472
- });
473
- const response = await this.host.sendCommand(cc, this.commandOptions);
474
- if (response) {
475
- return pick(response, ["maxNodes", "nodeIds", "endpoints"]);
476
- }
477
- }
478
- async sendReport(options) {
479
- __assertType("options", "MultiChannelAssociationCCReportOptions", __assertType__MultiChannelAssociationCCReportOptions.bind(void 0, options));
480
- this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.Report);
481
- const cc = new MultiChannelAssociationCCReport({
482
- nodeId: this.endpoint.nodeId,
483
- endpointIndex: this.endpoint.index,
484
- ...options,
485
- });
486
- await this.host.sendCommand(cc, this.commandOptions);
487
- }
488
- /**
489
- * Adds new nodes or endpoints to an association group
490
- */
491
- async addDestinations(options) {
492
- __assertType("options", "MultiChannelAssociationCCSetOptions", __assertType__MultiChannelAssociationCCSetOptions.bind(void 0, options));
493
- this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.Set);
494
- const cc = new MultiChannelAssociationCCSet({
495
- nodeId: this.endpoint.nodeId,
496
- endpointIndex: this.endpoint.index,
497
- ...options,
498
- });
499
- return this.host.sendCommand(cc, this.commandOptions);
500
- }
501
- /**
502
- * Removes nodes or endpoints from an association group
503
- */
504
- async removeDestinations(options) {
505
- __assertType("options", "MultiChannelAssociationCCRemoveOptions", __assertType__MultiChannelAssociationCCRemoveOptions.bind(void 0, options));
506
- this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.Remove);
507
- if (!options.groupId && this.version === 1) {
508
- // V1 does not support omitting the group, manually remove the destination from all groups
509
- // We don't want to do too much work, so find out which groups the destination is in
510
- const currentDestinations = MultiChannelAssociationCC
511
- .getAllDestinationsCached(this.host, this.endpoint);
512
- for (const [group, destinations] of currentDestinations) {
513
- const cc = new MultiChannelAssociationCCRemove({
514
- nodeId: this.endpoint.nodeId,
515
- endpointIndex: this.endpoint.index,
516
- groupId: group,
517
- nodeIds: destinations
518
- .filter((d) => d.endpoint != undefined)
519
- .map((d) => d.nodeId),
520
- endpoints: destinations.filter((d) => d.endpoint != undefined),
521
- });
522
- // TODO: evaluate intermediate supervision results
523
- await this.host.sendCommand(cc, this.commandOptions);
453
+ let MultiChannelAssociationCCAPI = (() => {
454
+ let _classDecorators = [API(CommandClasses["Multi Channel Association"])];
455
+ let _classDescriptor;
456
+ let _classExtraInitializers = [];
457
+ let _classThis;
458
+ let _classSuper = PhysicalCCAPI;
459
+ var MultiChannelAssociationCCAPI = class extends _classSuper {
460
+ static { _classThis = this; }
461
+ static {
462
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
463
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
464
+ MultiChannelAssociationCCAPI = _classThis = _classDescriptor.value;
465
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
466
+ __runInitializers(_classThis, _classExtraInitializers);
467
+ }
468
+ supportsCommand(cmd) {
469
+ switch (cmd) {
470
+ case MultiChannelAssociationCommand.Get:
471
+ case MultiChannelAssociationCommand.Set:
472
+ case MultiChannelAssociationCommand.Report:
473
+ case MultiChannelAssociationCommand.Remove:
474
+ case MultiChannelAssociationCommand.SupportedGroupingsGet:
475
+ case MultiChannelAssociationCommand.SupportedGroupingsReport:
476
+ return true; // This is mandatory
524
477
  }
478
+ return super.supportsCommand(cmd);
525
479
  }
526
- else if (options.groupId && options.groupId < 0) {
527
- throw new ZWaveError("The group id must not be negative!", ZWaveErrorCodes.Argument_Invalid);
480
+ /**
481
+ * Returns the number of association groups a node supports.
482
+ * Association groups are consecutive, starting at 1.
483
+ */
484
+ async getGroupCount() {
485
+ this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.SupportedGroupingsGet);
486
+ const cc = new MultiChannelAssociationCCSupportedGroupingsGet({
487
+ nodeId: this.endpoint.nodeId,
488
+ endpointIndex: this.endpoint.index,
489
+ });
490
+ const response = await this.host.sendCommand(cc, this.commandOptions);
491
+ return response?.groupCount;
528
492
  }
529
- else {
530
- const cc = new MultiChannelAssociationCCRemove({
493
+ async reportGroupCount(groupCount) {
494
+ __assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount));
495
+ this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.SupportedGroupingsReport);
496
+ const cc = new MultiChannelAssociationCCSupportedGroupingsReport({
497
+ nodeId: this.endpoint.nodeId,
498
+ endpointIndex: this.endpoint.index,
499
+ groupCount,
500
+ });
501
+ await this.host.sendCommand(cc, this.commandOptions);
502
+ }
503
+ /**
504
+ * Returns information about an association group.
505
+ */
506
+ async getGroup(groupId) {
507
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
508
+ this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.Get);
509
+ const cc = new MultiChannelAssociationCCGet({
510
+ nodeId: this.endpoint.nodeId,
511
+ endpointIndex: this.endpoint.index,
512
+ groupId,
513
+ });
514
+ const response = await this.host.sendCommand(cc, this.commandOptions);
515
+ if (response) {
516
+ return pick(response, ["maxNodes", "nodeIds", "endpoints"]);
517
+ }
518
+ }
519
+ async sendReport(options) {
520
+ __assertType("options", "MultiChannelAssociationCCReportOptions", __assertType__MultiChannelAssociationCCReportOptions.bind(void 0, options));
521
+ this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.Report);
522
+ const cc = new MultiChannelAssociationCCReport({
523
+ nodeId: this.endpoint.nodeId,
524
+ endpointIndex: this.endpoint.index,
525
+ ...options,
526
+ });
527
+ await this.host.sendCommand(cc, this.commandOptions);
528
+ }
529
+ /**
530
+ * Adds new nodes or endpoints to an association group
531
+ */
532
+ async addDestinations(options) {
533
+ __assertType("options", "MultiChannelAssociationCCSetOptions", __assertType__MultiChannelAssociationCCSetOptions.bind(void 0, options));
534
+ this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.Set);
535
+ const cc = new MultiChannelAssociationCCSet({
531
536
  nodeId: this.endpoint.nodeId,
532
537
  endpointIndex: this.endpoint.index,
533
538
  ...options,
534
539
  });
535
540
  return this.host.sendCommand(cc, this.commandOptions);
536
541
  }
537
- }
538
- };
539
- MultiChannelAssociationCCAPI = __decorate([
540
- API(CommandClasses["Multi Channel Association"])
541
- ], MultiChannelAssociationCCAPI);
542
- export { MultiChannelAssociationCCAPI };
543
- let MultiChannelAssociationCC = class MultiChannelAssociationCC extends CommandClass {
544
- determineRequiredCCInterviews() {
545
- // MultiChannelAssociationCC must be interviewed after Z-Wave+ if that is supported
546
- return [
547
- ...super.determineRequiredCCInterviews(),
548
- CommandClasses["Z-Wave Plus Info"],
549
- // We need information about endpoints to correctly configure the lifeline associations
550
- CommandClasses["Multi Channel"],
551
- // AssociationCC will short-circuit if this CC is supported
552
- CommandClasses.Association,
553
- ];
554
- }
555
- /**
556
- * Returns the number of association groups reported by the node/endpoint.
557
- * This only works AFTER the interview process
558
- */
559
- static getGroupCountCached(ctx, endpoint) {
560
- return ctx
561
- .getValueDB(endpoint.nodeId)
562
- .getValue(MultiChannelAssociationCCValues.groupCount.endpoint(endpoint.index)) || 0;
563
- }
564
- /**
565
- * Returns the number of nodes an association group supports.
566
- * This only works AFTER the interview process
567
- */
568
- static getMaxNodesCached(ctx, endpoint, groupId) {
569
- return ctx
570
- .getValueDB(endpoint.nodeId)
571
- .getValue(MultiChannelAssociationCCValues.maxNodes(groupId).endpoint(endpoint.index)) ?? 0;
572
- }
573
- /**
574
- * Returns all the destinations of all association groups reported by the node/endpoint.
575
- * This only works AFTER the interview process
576
- */
577
- static getAllDestinationsCached(ctx, endpoint) {
578
- const ret = new Map();
579
- const groupCount = this.getGroupCountCached(ctx, endpoint);
580
- const valueDB = ctx.getValueDB(endpoint.nodeId);
581
- for (let i = 1; i <= groupCount; i++) {
582
- const groupDestinations = [];
583
- // Add all node destinations
584
- const nodes = valueDB.getValue(MultiChannelAssociationCCValues.nodeIds(i).endpoint(endpoint.index)) ?? [];
585
- groupDestinations.push(...nodes.map((nodeId) => ({ nodeId })));
586
- // And all endpoint destinations
587
- const endpoints = valueDB.getValue(MultiChannelAssociationCCValues.endpoints(i).endpoint(endpoint.index)) ?? [];
588
- for (const ep of endpoints) {
589
- if (typeof ep.endpoint === "number") {
590
- groupDestinations.push({
591
- nodeId: ep.nodeId,
592
- endpoint: ep.endpoint,
542
+ /**
543
+ * Removes nodes or endpoints from an association group
544
+ */
545
+ async removeDestinations(options) {
546
+ __assertType("options", "MultiChannelAssociationCCRemoveOptions", __assertType__MultiChannelAssociationCCRemoveOptions.bind(void 0, options));
547
+ this.assertSupportsCommand(MultiChannelAssociationCommand, MultiChannelAssociationCommand.Remove);
548
+ if (!options.groupId && this.version === 1) {
549
+ // V1 does not support omitting the group, manually remove the destination from all groups
550
+ // We don't want to do too much work, so find out which groups the destination is in
551
+ const currentDestinations = MultiChannelAssociationCC
552
+ .getAllDestinationsCached(this.host, this.endpoint);
553
+ for (const [group, destinations] of currentDestinations) {
554
+ const cc = new MultiChannelAssociationCCRemove({
555
+ nodeId: this.endpoint.nodeId,
556
+ endpointIndex: this.endpoint.index,
557
+ groupId: group,
558
+ nodeIds: destinations
559
+ .filter((d) => d.endpoint != undefined)
560
+ .map((d) => d.nodeId),
561
+ endpoints: destinations.filter((d) => d.endpoint != undefined),
593
562
  });
563
+ // TODO: evaluate intermediate supervision results
564
+ await this.host.sendCommand(cc, this.commandOptions);
594
565
  }
595
- else {
596
- groupDestinations.push(...ep.endpoint.map((e) => ({
597
- nodeId: ep.nodeId,
598
- endpoint: e,
599
- })));
566
+ }
567
+ else if (options.groupId && options.groupId < 0) {
568
+ throw new ZWaveError("The group id must not be negative!", ZWaveErrorCodes.Argument_Invalid);
569
+ }
570
+ else {
571
+ const cc = new MultiChannelAssociationCCRemove({
572
+ nodeId: this.endpoint.nodeId,
573
+ endpointIndex: this.endpoint.index,
574
+ ...options,
575
+ });
576
+ return this.host.sendCommand(cc, this.commandOptions);
577
+ }
578
+ }
579
+ };
580
+ return MultiChannelAssociationCCAPI = _classThis;
581
+ })();
582
+ export { MultiChannelAssociationCCAPI };
583
+ let MultiChannelAssociationCC = (() => {
584
+ let _classDecorators = [commandClass(CommandClasses["Multi Channel Association"]), implementedVersion(5), ccValues(MultiChannelAssociationCCValues)];
585
+ let _classDescriptor;
586
+ let _classExtraInitializers = [];
587
+ let _classThis;
588
+ let _classSuper = CommandClass;
589
+ var MultiChannelAssociationCC = class extends _classSuper {
590
+ static { _classThis = this; }
591
+ static {
592
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
593
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
594
+ MultiChannelAssociationCC = _classThis = _classDescriptor.value;
595
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
596
+ __runInitializers(_classThis, _classExtraInitializers);
597
+ }
598
+ determineRequiredCCInterviews() {
599
+ // MultiChannelAssociationCC must be interviewed after Z-Wave+ if that is supported
600
+ return [
601
+ ...super.determineRequiredCCInterviews(),
602
+ CommandClasses["Z-Wave Plus Info"],
603
+ // We need information about endpoints to correctly configure the lifeline associations
604
+ CommandClasses["Multi Channel"],
605
+ // AssociationCC will short-circuit if this CC is supported
606
+ CommandClasses.Association,
607
+ ];
608
+ }
609
+ /**
610
+ * Returns the number of association groups reported by the node/endpoint.
611
+ * This only works AFTER the interview process
612
+ */
613
+ static getGroupCountCached(ctx, endpoint) {
614
+ return ctx
615
+ .getValueDB(endpoint.nodeId)
616
+ .getValue(MultiChannelAssociationCCValues.groupCount.endpoint(endpoint.index)) || 0;
617
+ }
618
+ /**
619
+ * Returns the number of nodes an association group supports.
620
+ * This only works AFTER the interview process
621
+ */
622
+ static getMaxNodesCached(ctx, endpoint, groupId) {
623
+ return ctx
624
+ .getValueDB(endpoint.nodeId)
625
+ .getValue(MultiChannelAssociationCCValues.maxNodes(groupId).endpoint(endpoint.index)) ?? 0;
626
+ }
627
+ /**
628
+ * Returns all the destinations of all association groups reported by the node/endpoint.
629
+ * This only works AFTER the interview process
630
+ */
631
+ static getAllDestinationsCached(ctx, endpoint) {
632
+ const ret = new Map();
633
+ const groupCount = this.getGroupCountCached(ctx, endpoint);
634
+ const valueDB = ctx.getValueDB(endpoint.nodeId);
635
+ for (let i = 1; i <= groupCount; i++) {
636
+ const groupDestinations = [];
637
+ // Add all node destinations
638
+ const nodes = valueDB.getValue(MultiChannelAssociationCCValues.nodeIds(i).endpoint(endpoint.index)) ?? [];
639
+ groupDestinations.push(...nodes.map((nodeId) => ({ nodeId })));
640
+ // And all endpoint destinations
641
+ const endpoints = valueDB.getValue(MultiChannelAssociationCCValues.endpoints(i).endpoint(endpoint.index)) ?? [];
642
+ for (const ep of endpoints) {
643
+ if (typeof ep.endpoint === "number") {
644
+ groupDestinations.push({
645
+ nodeId: ep.nodeId,
646
+ endpoint: ep.endpoint,
647
+ });
648
+ }
649
+ else {
650
+ groupDestinations.push(...ep.endpoint.map((e) => ({
651
+ nodeId: ep.nodeId,
652
+ endpoint: e,
653
+ })));
654
+ }
600
655
  }
656
+ ret.set(i,
657
+ // Filter out duplicates
658
+ groupDestinations.filter((addr, index) => index
659
+ === groupDestinations.findIndex(({ nodeId, endpoint }) => nodeId === addr.nodeId
660
+ && endpoint === addr.endpoint)));
601
661
  }
602
- ret.set(i,
603
- // Filter out duplicates
604
- groupDestinations.filter((addr, index) => index
605
- === groupDestinations.findIndex(({ nodeId, endpoint }) => nodeId === addr.nodeId
606
- && endpoint === addr.endpoint)));
607
- }
608
- return ret;
609
- }
610
- async interview(ctx) {
611
- const node = this.getNode(ctx);
612
- const endpoint = this.getEndpoint(ctx);
613
- const mcAPI = CCAPI.create(CommandClasses["Multi Channel Association"], ctx, endpoint);
614
- ctx.logNode(node.id, {
615
- endpoint: this.endpointIndex,
616
- message: `Interviewing ${this.ccName}...`,
617
- direction: "none",
618
- });
619
- // First find out how many groups are supported as multi channel
620
- ctx.logNode(node.id, {
621
- endpoint: this.endpointIndex,
622
- message: "querying number of multi channel association groups...",
623
- direction: "outbound",
624
- });
625
- const mcGroupCount = await mcAPI.getGroupCount();
626
- if (mcGroupCount != undefined) {
627
- ctx.logNode(node.id, {
628
- endpoint: this.endpointIndex,
629
- message: `supports ${mcGroupCount} multi channel association groups`,
630
- direction: "inbound",
631
- });
662
+ return ret;
632
663
  }
633
- else {
664
+ async interview(ctx) {
665
+ const node = this.getNode(ctx);
666
+ const endpoint = this.getEndpoint(ctx);
667
+ const mcAPI = CCAPI.create(CommandClasses["Multi Channel Association"], ctx, endpoint);
634
668
  ctx.logNode(node.id, {
635
669
  endpoint: this.endpointIndex,
636
- message: "Querying multi channel association groups timed out, skipping interview...",
637
- level: "warn",
670
+ message: `Interviewing ${this.ccName}...`,
671
+ direction: "none",
638
672
  });
639
- return;
640
- }
641
- // Query each association group for its members
642
- await this.refreshValues(ctx);
643
- // And set up lifeline associations
644
- await ccUtils.configureLifelineAssociations(ctx, endpoint);
645
- // Remember that the interview is complete
646
- this.setInterviewComplete(ctx, true);
647
- }
648
- async refreshValues(ctx) {
649
- const node = this.getNode(ctx);
650
- const endpoint = this.getEndpoint(ctx);
651
- const mcAPI = CCAPI.create(CommandClasses["Multi Channel Association"], ctx, endpoint).withOptions({
652
- priority: MessagePriority.NodeQuery,
653
- });
654
- const assocAPI = CCAPI.create(CommandClasses.Association, ctx, endpoint).withOptions({
655
- priority: MessagePriority.NodeQuery,
656
- });
657
- const mcGroupCount = this.getValue(ctx, MultiChannelAssociationCCValues.groupCount) ?? 0;
658
- // Some devices report more association groups than multi channel association groups, so we need this info here
659
- const assocGroupCount = this.getValue(ctx, AssociationCCValues.groupCount)
660
- || mcGroupCount;
661
- // Then query each multi channel association group
662
- for (let groupId = 1; groupId <= mcGroupCount; groupId++) {
673
+ // First find out how many groups are supported as multi channel
663
674
  ctx.logNode(node.id, {
664
675
  endpoint: this.endpointIndex,
665
- message: `querying multi channel association group #${groupId}...`,
676
+ message: "querying number of multi channel association groups...",
666
677
  direction: "outbound",
667
678
  });
668
- const group = await mcAPI.getGroup(groupId);
669
- if (!group)
670
- continue;
671
- const logMessage = `received information for multi channel association group #${groupId}:
672
- maximum # of nodes: ${group.maxNodes}
673
- currently assigned nodes: ${group.nodeIds.map(String).join(", ")}
674
- currently assigned endpoints: ${group.endpoints
675
- .map(({ nodeId, endpoint }) => {
676
- if (typeof endpoint === "number") {
677
- return `${nodeId}:${endpoint}`;
678
- }
679
- else {
680
- return `${nodeId}:[${endpoint.map(String).join(", ")}]`;
681
- }
682
- })
683
- .join("")}`;
684
- ctx.logNode(node.id, {
685
- endpoint: this.endpointIndex,
686
- message: logMessage,
687
- direction: "inbound",
688
- });
679
+ const mcGroupCount = await mcAPI.getGroupCount();
680
+ if (mcGroupCount != undefined) {
681
+ ctx.logNode(node.id, {
682
+ endpoint: this.endpointIndex,
683
+ message: `supports ${mcGroupCount} multi channel association groups`,
684
+ direction: "inbound",
685
+ });
686
+ }
687
+ else {
688
+ ctx.logNode(node.id, {
689
+ endpoint: this.endpointIndex,
690
+ message: "Querying multi channel association groups timed out, skipping interview...",
691
+ level: "warn",
692
+ });
693
+ return;
694
+ }
695
+ // Query each association group for its members
696
+ await this.refreshValues(ctx);
697
+ // And set up lifeline associations
698
+ await ccUtils.configureLifelineAssociations(ctx, endpoint);
699
+ // Remember that the interview is complete
700
+ this.setInterviewComplete(ctx, true);
689
701
  }
690
- // Check if there are more non-multi-channel association groups we haven't queried yet
691
- if (assocAPI.isSupported() && assocGroupCount > mcGroupCount) {
692
- ctx.logNode(node.id, {
693
- endpoint: this.endpointIndex,
694
- message: `querying additional non-multi-channel association groups...`,
695
- direction: "outbound",
702
+ async refreshValues(ctx) {
703
+ const node = this.getNode(ctx);
704
+ const endpoint = this.getEndpoint(ctx);
705
+ const mcAPI = CCAPI.create(CommandClasses["Multi Channel Association"], ctx, endpoint).withOptions({
706
+ priority: MessagePriority.NodeQuery,
707
+ });
708
+ const assocAPI = CCAPI.create(CommandClasses.Association, ctx, endpoint).withOptions({
709
+ priority: MessagePriority.NodeQuery,
696
710
  });
697
- for (let groupId = mcGroupCount + 1; groupId <= assocGroupCount; groupId++) {
711
+ const mcGroupCount = this.getValue(ctx, MultiChannelAssociationCCValues.groupCount) ?? 0;
712
+ // Some devices report more association groups than multi channel association groups, so we need this info here
713
+ const assocGroupCount = this.getValue(ctx, AssociationCCValues.groupCount)
714
+ || mcGroupCount;
715
+ // Then query each multi channel association group
716
+ for (let groupId = 1; groupId <= mcGroupCount; groupId++) {
698
717
  ctx.logNode(node.id, {
699
718
  endpoint: this.endpointIndex,
700
- message: `querying association group #${groupId}...`,
719
+ message: `querying multi channel association group #${groupId}...`,
701
720
  direction: "outbound",
702
721
  });
703
- const group = await assocAPI.getGroup(groupId);
722
+ const group = await mcAPI.getGroup(groupId);
704
723
  if (!group)
705
724
  continue;
706
- const logMessage = `received information for association group #${groupId}:
725
+ const logMessage = `received information for multi channel association group #${groupId}:
707
726
  maximum # of nodes: ${group.maxNodes}
708
- currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
727
+ currently assigned nodes: ${group.nodeIds.map(String).join(", ")}
728
+ currently assigned endpoints: ${group.endpoints
729
+ .map(({ nodeId, endpoint }) => {
730
+ if (typeof endpoint === "number") {
731
+ return `${nodeId}:${endpoint}`;
732
+ }
733
+ else {
734
+ return `${nodeId}:[${endpoint.map(String).join(", ")}]`;
735
+ }
736
+ })
737
+ .join("")}`;
709
738
  ctx.logNode(node.id, {
710
739
  endpoint: this.endpointIndex,
711
740
  message: logMessage,
712
741
  direction: "inbound",
713
742
  });
714
743
  }
744
+ // Check if there are more non-multi-channel association groups we haven't queried yet
745
+ if (assocAPI.isSupported() && assocGroupCount > mcGroupCount) {
746
+ ctx.logNode(node.id, {
747
+ endpoint: this.endpointIndex,
748
+ message: `querying additional non-multi-channel association groups...`,
749
+ direction: "outbound",
750
+ });
751
+ for (let groupId = mcGroupCount + 1; groupId <= assocGroupCount; groupId++) {
752
+ ctx.logNode(node.id, {
753
+ endpoint: this.endpointIndex,
754
+ message: `querying association group #${groupId}...`,
755
+ direction: "outbound",
756
+ });
757
+ const group = await assocAPI.getGroup(groupId);
758
+ if (!group)
759
+ continue;
760
+ const logMessage = `received information for association group #${groupId}:
761
+ maximum # of nodes: ${group.maxNodes}
762
+ currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
763
+ ctx.logNode(node.id, {
764
+ endpoint: this.endpointIndex,
765
+ message: logMessage,
766
+ direction: "inbound",
767
+ });
768
+ }
769
+ }
715
770
  }
716
- }
717
- };
718
- MultiChannelAssociationCC = __decorate([
719
- commandClass(CommandClasses["Multi Channel Association"]),
720
- implementedVersion(5),
721
- ccValues(MultiChannelAssociationCCValues)
722
- ], MultiChannelAssociationCC);
771
+ };
772
+ return MultiChannelAssociationCC = _classThis;
773
+ })();
723
774
  export { MultiChannelAssociationCC };
724
- let MultiChannelAssociationCCSet = MultiChannelAssociationCCSet_1 = class MultiChannelAssociationCCSet extends MultiChannelAssociationCC {
725
- constructor(options) {
726
- super(options);
727
- if (options.groupId < 1) {
728
- throw new ZWaveError("The group id must be positive!", ZWaveErrorCodes.Argument_Invalid);
729
- }
730
- this.groupId = options.groupId;
731
- this.nodeIds = ("nodeIds" in options && options.nodeIds) || [];
732
- if (this.nodeIds.some((n) => n < 1 || n > MAX_NODES)) {
733
- throw new ZWaveError(`All node IDs must be between 1 and ${MAX_NODES}!`, ZWaveErrorCodes.Argument_Invalid);
734
- }
735
- this.endpoints = ("endpoints" in options && options.endpoints)
736
- || [];
737
- }
738
- static from(raw, ctx) {
739
- validatePayload(raw.payload.length >= 1);
740
- const groupId = raw.payload[0];
741
- const { nodeIds, endpoints } = deserializeMultiChannelAssociationDestination(raw.payload.subarray(1));
742
- return new MultiChannelAssociationCCSet_1({
743
- nodeId: ctx.sourceNodeId,
744
- groupId,
745
- nodeIds,
746
- endpoints,
747
- });
748
- }
749
- groupId;
750
- nodeIds;
751
- endpoints;
752
- serialize(ctx) {
753
- this.payload = Bytes.concat([
754
- Bytes.from([this.groupId]),
755
- serializeMultiChannelAssociationDestination(this.nodeIds, this.endpoints),
756
- ]);
757
- return super.serialize(ctx);
758
- }
759
- toLogEntry(ctx) {
760
- return {
761
- ...super.toLogEntry(ctx),
762
- message: {
763
- "group id": this.groupId,
764
- "node ids": this.nodeIds.join(", "),
765
- endpoints: endpointAddressesToString(this.endpoints),
766
- },
767
- };
768
- }
769
- };
770
- MultiChannelAssociationCCSet = MultiChannelAssociationCCSet_1 = __decorate([
771
- CCCommand(MultiChannelAssociationCommand.Set),
772
- useSupervision()
773
- ], MultiChannelAssociationCCSet);
775
+ let MultiChannelAssociationCCSet = (() => {
776
+ let _classDecorators = [CCCommand(MultiChannelAssociationCommand.Set), useSupervision()];
777
+ let _classDescriptor;
778
+ let _classExtraInitializers = [];
779
+ let _classThis;
780
+ let _classSuper = MultiChannelAssociationCC;
781
+ var MultiChannelAssociationCCSet = class extends _classSuper {
782
+ static { _classThis = this; }
783
+ static {
784
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
785
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
786
+ MultiChannelAssociationCCSet = _classThis = _classDescriptor.value;
787
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
788
+ __runInitializers(_classThis, _classExtraInitializers);
789
+ }
790
+ constructor(options) {
791
+ super(options);
792
+ if (options.groupId < 1) {
793
+ throw new ZWaveError("The group id must be positive!", ZWaveErrorCodes.Argument_Invalid);
794
+ }
795
+ this.groupId = options.groupId;
796
+ this.nodeIds = ("nodeIds" in options && options.nodeIds) || [];
797
+ if (this.nodeIds.some((n) => n < 1 || n > MAX_NODES)) {
798
+ throw new ZWaveError(`All node IDs must be between 1 and ${MAX_NODES}!`, ZWaveErrorCodes.Argument_Invalid);
799
+ }
800
+ this.endpoints = ("endpoints" in options && options.endpoints)
801
+ || [];
802
+ }
803
+ static from(raw, ctx) {
804
+ validatePayload(raw.payload.length >= 1);
805
+ const groupId = raw.payload[0];
806
+ const { nodeIds, endpoints } = deserializeMultiChannelAssociationDestination(raw.payload.subarray(1));
807
+ return new this({
808
+ nodeId: ctx.sourceNodeId,
809
+ groupId,
810
+ nodeIds,
811
+ endpoints,
812
+ });
813
+ }
814
+ groupId;
815
+ nodeIds;
816
+ endpoints;
817
+ serialize(ctx) {
818
+ this.payload = Bytes.concat([
819
+ Bytes.from([this.groupId]),
820
+ serializeMultiChannelAssociationDestination(this.nodeIds, this.endpoints),
821
+ ]);
822
+ return super.serialize(ctx);
823
+ }
824
+ toLogEntry(ctx) {
825
+ return {
826
+ ...super.toLogEntry(ctx),
827
+ message: {
828
+ "group id": this.groupId,
829
+ "node ids": this.nodeIds.join(", "),
830
+ endpoints: endpointAddressesToString(this.endpoints),
831
+ },
832
+ };
833
+ }
834
+ };
835
+ return MultiChannelAssociationCCSet = _classThis;
836
+ })();
774
837
  export { MultiChannelAssociationCCSet };
775
- let MultiChannelAssociationCCRemove = MultiChannelAssociationCCRemove_1 = class MultiChannelAssociationCCRemove extends MultiChannelAssociationCC {
776
- constructor(options) {
777
- super(options);
778
- // When removing associations, we allow invalid node IDs.
779
- // See GH#3606 - it is possible that those exist.
780
- this.groupId = options.groupId;
781
- this.nodeIds = options.nodeIds;
782
- this.endpoints = options.endpoints;
783
- }
784
- static from(raw, ctx) {
785
- validatePayload(raw.payload.length >= 1);
786
- const groupId = raw.payload[0];
787
- const { nodeIds, endpoints } = deserializeMultiChannelAssociationDestination(raw.payload.subarray(1));
788
- return new MultiChannelAssociationCCRemove_1({
789
- nodeId: ctx.sourceNodeId,
790
- groupId,
791
- nodeIds,
792
- endpoints,
793
- });
794
- }
795
- groupId;
796
- nodeIds;
797
- endpoints;
798
- serialize(ctx) {
799
- this.payload = Bytes.concat([
800
- Bytes.from([this.groupId || 0]),
801
- serializeMultiChannelAssociationDestination(this.nodeIds || [], this.endpoints || []),
802
- ]);
803
- return super.serialize(ctx);
804
- }
805
- toLogEntry(ctx) {
806
- const message = {
807
- "group id": this.groupId || "(all groups)",
808
- };
809
- if (this.nodeIds) {
810
- message["node ids"] = this.nodeIds.join(", ");
811
- }
812
- if (this.endpoints) {
813
- message.endpoints = endpointAddressesToString(this.endpoints);
814
- }
815
- return {
816
- ...super.toLogEntry(ctx),
817
- message,
818
- };
819
- }
820
- };
821
- MultiChannelAssociationCCRemove = MultiChannelAssociationCCRemove_1 = __decorate([
822
- CCCommand(MultiChannelAssociationCommand.Remove),
823
- useSupervision()
824
- ], MultiChannelAssociationCCRemove);
838
+ let MultiChannelAssociationCCRemove = (() => {
839
+ let _classDecorators = [CCCommand(MultiChannelAssociationCommand.Remove), useSupervision()];
840
+ let _classDescriptor;
841
+ let _classExtraInitializers = [];
842
+ let _classThis;
843
+ let _classSuper = MultiChannelAssociationCC;
844
+ var MultiChannelAssociationCCRemove = class extends _classSuper {
845
+ static { _classThis = this; }
846
+ static {
847
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
848
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
849
+ MultiChannelAssociationCCRemove = _classThis = _classDescriptor.value;
850
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
851
+ __runInitializers(_classThis, _classExtraInitializers);
852
+ }
853
+ constructor(options) {
854
+ super(options);
855
+ // When removing associations, we allow invalid node IDs.
856
+ // See GH#3606 - it is possible that those exist.
857
+ this.groupId = options.groupId;
858
+ this.nodeIds = options.nodeIds;
859
+ this.endpoints = options.endpoints;
860
+ }
861
+ static from(raw, ctx) {
862
+ validatePayload(raw.payload.length >= 1);
863
+ const groupId = raw.payload[0];
864
+ const { nodeIds, endpoints } = deserializeMultiChannelAssociationDestination(raw.payload.subarray(1));
865
+ return new this({
866
+ nodeId: ctx.sourceNodeId,
867
+ groupId,
868
+ nodeIds,
869
+ endpoints,
870
+ });
871
+ }
872
+ groupId;
873
+ nodeIds;
874
+ endpoints;
875
+ serialize(ctx) {
876
+ this.payload = Bytes.concat([
877
+ Bytes.from([this.groupId || 0]),
878
+ serializeMultiChannelAssociationDestination(this.nodeIds || [], this.endpoints || []),
879
+ ]);
880
+ return super.serialize(ctx);
881
+ }
882
+ toLogEntry(ctx) {
883
+ const message = {
884
+ "group id": this.groupId || "(all groups)",
885
+ };
886
+ if (this.nodeIds) {
887
+ message["node ids"] = this.nodeIds.join(", ");
888
+ }
889
+ if (this.endpoints) {
890
+ message.endpoints = endpointAddressesToString(this.endpoints);
891
+ }
892
+ return {
893
+ ...super.toLogEntry(ctx),
894
+ message,
895
+ };
896
+ }
897
+ };
898
+ return MultiChannelAssociationCCRemove = _classThis;
899
+ })();
825
900
  export { MultiChannelAssociationCCRemove };
826
- let MultiChannelAssociationCCReport = MultiChannelAssociationCCReport_1 = class MultiChannelAssociationCCReport extends MultiChannelAssociationCC {
827
- constructor(options) {
828
- super(options);
829
- this.groupId = options.groupId;
830
- this.maxNodes = options.maxNodes;
831
- this.nodeIds = options.nodeIds;
832
- this.endpoints = options.endpoints;
833
- this.reportsToFollow = options.reportsToFollow;
834
- }
835
- static from(raw, ctx) {
836
- validatePayload(raw.payload.length >= 3);
837
- const groupId = raw.payload[0];
838
- const maxNodes = raw.payload[1];
839
- const reportsToFollow = raw.payload[2];
840
- const { nodeIds, endpoints } = deserializeMultiChannelAssociationDestination(raw.payload.subarray(3));
841
- return new MultiChannelAssociationCCReport_1({
842
- nodeId: ctx.sourceNodeId,
843
- groupId,
844
- maxNodes,
845
- nodeIds,
846
- endpoints,
847
- reportsToFollow,
848
- });
849
- }
850
- groupId;
851
- maxNodes;
852
- nodeIds;
853
- endpoints;
854
- reportsToFollow;
855
- getPartialCCSessionId() {
856
- // Distinguish sessions by the association group ID
857
- return { groupId: this.groupId };
858
- }
859
- expectMoreMessages() {
860
- return this.reportsToFollow > 0;
861
- }
862
- mergePartialCCs(partials, _ctx) {
863
- // Concat the list of nodes
864
- this.nodeIds = [...partials, this]
865
- .map((report) => [...report.nodeIds])
866
- .reduce((prev, cur) => prev.concat(...cur), []);
867
- // Concat the list of endpoints
868
- this.endpoints = [...partials, this]
869
- .map((report) => [...report.endpoints])
870
- .reduce((prev, cur) => prev.concat(...cur), []);
871
- }
872
- serialize(ctx) {
873
- const destinations = serializeMultiChannelAssociationDestination(this.nodeIds, this.endpoints);
874
- this.payload = Bytes.concat([
875
- Bytes.from([
876
- this.groupId,
877
- this.maxNodes,
878
- this.reportsToFollow,
879
- ]),
880
- destinations,
881
- ]);
882
- return super.serialize(ctx);
883
- }
884
- toLogEntry(ctx) {
885
- return {
886
- ...super.toLogEntry(ctx),
887
- message: {
888
- "group id": this.groupId,
889
- "maximum # of nodes": this.maxNodes,
890
- "node ids": this.nodeIds.join(", "),
891
- endpoints: endpointAddressesToString(this.endpoints),
892
- },
893
- };
894
- }
895
- };
896
- __decorate([
897
- ccValue(MultiChannelAssociationCCValues.maxNodes, (self) => [self.groupId])
898
- ], MultiChannelAssociationCCReport.prototype, "maxNodes", void 0);
899
- __decorate([
900
- ccValue(MultiChannelAssociationCCValues.nodeIds, (self) => [self.groupId])
901
- ], MultiChannelAssociationCCReport.prototype, "nodeIds", void 0);
902
- __decorate([
903
- ccValue(MultiChannelAssociationCCValues.endpoints, (self) => [self.groupId])
904
- ], MultiChannelAssociationCCReport.prototype, "endpoints", void 0);
905
- MultiChannelAssociationCCReport = MultiChannelAssociationCCReport_1 = __decorate([
906
- CCCommand(MultiChannelAssociationCommand.Report)
907
- ], MultiChannelAssociationCCReport);
901
+ let MultiChannelAssociationCCReport = (() => {
902
+ let _classDecorators = [CCCommand(MultiChannelAssociationCommand.Report), ccValueProperty("maxNodes", MultiChannelAssociationCCValues.maxNodes, (self) => [self.groupId]), ccValueProperty("nodeIds", MultiChannelAssociationCCValues.nodeIds, (self) => [self.groupId]), ccValueProperty("endpoints", MultiChannelAssociationCCValues.endpoints, (self) => [self.groupId])];
903
+ let _classDescriptor;
904
+ let _classExtraInitializers = [];
905
+ let _classThis;
906
+ let _classSuper = MultiChannelAssociationCC;
907
+ var MultiChannelAssociationCCReport = class extends _classSuper {
908
+ static { _classThis = this; }
909
+ static {
910
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
911
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
912
+ MultiChannelAssociationCCReport = _classThis = _classDescriptor.value;
913
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
914
+ __runInitializers(_classThis, _classExtraInitializers);
915
+ }
916
+ constructor(options) {
917
+ super(options);
918
+ this.groupId = options.groupId;
919
+ this.maxNodes = options.maxNodes;
920
+ this.nodeIds = options.nodeIds;
921
+ this.endpoints = options.endpoints;
922
+ this.reportsToFollow = options.reportsToFollow;
923
+ }
924
+ static from(raw, ctx) {
925
+ validatePayload(raw.payload.length >= 3);
926
+ const groupId = raw.payload[0];
927
+ const maxNodes = raw.payload[1];
928
+ const reportsToFollow = raw.payload[2];
929
+ const { nodeIds, endpoints } = deserializeMultiChannelAssociationDestination(raw.payload.subarray(3));
930
+ return new this({
931
+ nodeId: ctx.sourceNodeId,
932
+ groupId,
933
+ maxNodes,
934
+ nodeIds,
935
+ endpoints,
936
+ reportsToFollow,
937
+ });
938
+ }
939
+ groupId;
940
+ maxNodes;
941
+ nodeIds;
942
+ endpoints;
943
+ reportsToFollow;
944
+ getPartialCCSessionId() {
945
+ // Distinguish sessions by the association group ID
946
+ return { groupId: this.groupId };
947
+ }
948
+ expectMoreMessages() {
949
+ return this.reportsToFollow > 0;
950
+ }
951
+ mergePartialCCs(partials, _ctx) {
952
+ // Concat the list of nodes
953
+ this.nodeIds = [...partials, this]
954
+ .map((report) => [...report.nodeIds])
955
+ .reduce((prev, cur) => prev.concat(...cur), []);
956
+ // Concat the list of endpoints
957
+ this.endpoints = [...partials, this]
958
+ .map((report) => [...report.endpoints])
959
+ .reduce((prev, cur) => prev.concat(...cur), []);
960
+ }
961
+ serialize(ctx) {
962
+ const destinations = serializeMultiChannelAssociationDestination(this.nodeIds, this.endpoints);
963
+ this.payload = Bytes.concat([
964
+ Bytes.from([
965
+ this.groupId,
966
+ this.maxNodes,
967
+ this.reportsToFollow,
968
+ ]),
969
+ destinations,
970
+ ]);
971
+ return super.serialize(ctx);
972
+ }
973
+ toLogEntry(ctx) {
974
+ return {
975
+ ...super.toLogEntry(ctx),
976
+ message: {
977
+ "group id": this.groupId,
978
+ "maximum # of nodes": this.maxNodes,
979
+ "node ids": this.nodeIds.join(", "),
980
+ endpoints: endpointAddressesToString(this.endpoints),
981
+ },
982
+ };
983
+ }
984
+ };
985
+ return MultiChannelAssociationCCReport = _classThis;
986
+ })();
908
987
  export { MultiChannelAssociationCCReport };
909
- let MultiChannelAssociationCCGet = MultiChannelAssociationCCGet_1 = class MultiChannelAssociationCCGet extends MultiChannelAssociationCC {
910
- constructor(options) {
911
- super(options);
912
- if (options.groupId < 1) {
913
- throw new ZWaveError("The group id must be positive!", ZWaveErrorCodes.Argument_Invalid);
914
- }
915
- this.groupId = options.groupId;
916
- }
917
- static from(raw, ctx) {
918
- validatePayload(raw.payload.length >= 1);
919
- const groupId = raw.payload[0];
920
- return new MultiChannelAssociationCCGet_1({
921
- nodeId: ctx.sourceNodeId,
922
- groupId,
923
- });
924
- }
925
- groupId;
926
- serialize(ctx) {
927
- this.payload = Bytes.from([this.groupId]);
928
- return super.serialize(ctx);
929
- }
930
- toLogEntry(ctx) {
931
- return {
932
- ...super.toLogEntry(ctx),
933
- message: { "group id": this.groupId },
934
- };
935
- }
936
- };
937
- MultiChannelAssociationCCGet = MultiChannelAssociationCCGet_1 = __decorate([
938
- CCCommand(MultiChannelAssociationCommand.Get),
939
- expectedCCResponse(MultiChannelAssociationCCReport)
940
- ], MultiChannelAssociationCCGet);
988
+ let MultiChannelAssociationCCGet = (() => {
989
+ let _classDecorators = [CCCommand(MultiChannelAssociationCommand.Get), expectedCCResponse(MultiChannelAssociationCCReport)];
990
+ let _classDescriptor;
991
+ let _classExtraInitializers = [];
992
+ let _classThis;
993
+ let _classSuper = MultiChannelAssociationCC;
994
+ var MultiChannelAssociationCCGet = class extends _classSuper {
995
+ static { _classThis = this; }
996
+ static {
997
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
998
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
999
+ MultiChannelAssociationCCGet = _classThis = _classDescriptor.value;
1000
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1001
+ __runInitializers(_classThis, _classExtraInitializers);
1002
+ }
1003
+ constructor(options) {
1004
+ super(options);
1005
+ if (options.groupId < 1) {
1006
+ throw new ZWaveError("The group id must be positive!", ZWaveErrorCodes.Argument_Invalid);
1007
+ }
1008
+ this.groupId = options.groupId;
1009
+ }
1010
+ static from(raw, ctx) {
1011
+ validatePayload(raw.payload.length >= 1);
1012
+ const groupId = raw.payload[0];
1013
+ return new this({
1014
+ nodeId: ctx.sourceNodeId,
1015
+ groupId,
1016
+ });
1017
+ }
1018
+ groupId;
1019
+ serialize(ctx) {
1020
+ this.payload = Bytes.from([this.groupId]);
1021
+ return super.serialize(ctx);
1022
+ }
1023
+ toLogEntry(ctx) {
1024
+ return {
1025
+ ...super.toLogEntry(ctx),
1026
+ message: { "group id": this.groupId },
1027
+ };
1028
+ }
1029
+ };
1030
+ return MultiChannelAssociationCCGet = _classThis;
1031
+ })();
941
1032
  export { MultiChannelAssociationCCGet };
942
- let MultiChannelAssociationCCSupportedGroupingsReport = MultiChannelAssociationCCSupportedGroupingsReport_1 = class MultiChannelAssociationCCSupportedGroupingsReport extends MultiChannelAssociationCC {
943
- constructor(options) {
944
- super(options);
945
- this.groupCount = options.groupCount;
946
- }
947
- static from(raw, ctx) {
948
- validatePayload(raw.payload.length >= 1);
949
- const groupCount = raw.payload[0];
950
- return new MultiChannelAssociationCCSupportedGroupingsReport_1({
951
- nodeId: ctx.sourceNodeId,
952
- groupCount,
953
- });
954
- }
955
- groupCount;
956
- serialize(ctx) {
957
- this.payload = Bytes.from([this.groupCount]);
958
- return super.serialize(ctx);
959
- }
960
- toLogEntry(ctx) {
961
- return {
962
- ...super.toLogEntry(ctx),
963
- message: { "group count": this.groupCount },
964
- };
965
- }
966
- };
967
- __decorate([
968
- ccValue(MultiChannelAssociationCCValues.groupCount)
969
- ], MultiChannelAssociationCCSupportedGroupingsReport.prototype, "groupCount", void 0);
970
- MultiChannelAssociationCCSupportedGroupingsReport = MultiChannelAssociationCCSupportedGroupingsReport_1 = __decorate([
971
- CCCommand(MultiChannelAssociationCommand.SupportedGroupingsReport)
972
- ], MultiChannelAssociationCCSupportedGroupingsReport);
1033
+ let MultiChannelAssociationCCSupportedGroupingsReport = (() => {
1034
+ let _classDecorators = [CCCommand(MultiChannelAssociationCommand.SupportedGroupingsReport), ccValueProperty("groupCount", MultiChannelAssociationCCValues.groupCount)];
1035
+ let _classDescriptor;
1036
+ let _classExtraInitializers = [];
1037
+ let _classThis;
1038
+ let _classSuper = MultiChannelAssociationCC;
1039
+ var MultiChannelAssociationCCSupportedGroupingsReport = class extends _classSuper {
1040
+ static { _classThis = this; }
1041
+ static {
1042
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1043
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1044
+ MultiChannelAssociationCCSupportedGroupingsReport = _classThis = _classDescriptor.value;
1045
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1046
+ __runInitializers(_classThis, _classExtraInitializers);
1047
+ }
1048
+ constructor(options) {
1049
+ super(options);
1050
+ this.groupCount = options.groupCount;
1051
+ }
1052
+ static from(raw, ctx) {
1053
+ validatePayload(raw.payload.length >= 1);
1054
+ const groupCount = raw.payload[0];
1055
+ return new this({
1056
+ nodeId: ctx.sourceNodeId,
1057
+ groupCount,
1058
+ });
1059
+ }
1060
+ groupCount;
1061
+ serialize(ctx) {
1062
+ this.payload = Bytes.from([this.groupCount]);
1063
+ return super.serialize(ctx);
1064
+ }
1065
+ toLogEntry(ctx) {
1066
+ return {
1067
+ ...super.toLogEntry(ctx),
1068
+ message: { "group count": this.groupCount },
1069
+ };
1070
+ }
1071
+ };
1072
+ return MultiChannelAssociationCCSupportedGroupingsReport = _classThis;
1073
+ })();
973
1074
  export { MultiChannelAssociationCCSupportedGroupingsReport };
974
- let MultiChannelAssociationCCSupportedGroupingsGet = class MultiChannelAssociationCCSupportedGroupingsGet extends MultiChannelAssociationCC {
975
- };
976
- MultiChannelAssociationCCSupportedGroupingsGet = __decorate([
977
- CCCommand(MultiChannelAssociationCommand.SupportedGroupingsGet),
978
- expectedCCResponse(MultiChannelAssociationCCSupportedGroupingsReport)
979
- ], MultiChannelAssociationCCSupportedGroupingsGet);
1075
+ let MultiChannelAssociationCCSupportedGroupingsGet = (() => {
1076
+ let _classDecorators = [CCCommand(MultiChannelAssociationCommand.SupportedGroupingsGet), expectedCCResponse(MultiChannelAssociationCCSupportedGroupingsReport)];
1077
+ let _classDescriptor;
1078
+ let _classExtraInitializers = [];
1079
+ let _classThis;
1080
+ let _classSuper = MultiChannelAssociationCC;
1081
+ var MultiChannelAssociationCCSupportedGroupingsGet = class extends _classSuper {
1082
+ static { _classThis = this; }
1083
+ static {
1084
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1085
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1086
+ MultiChannelAssociationCCSupportedGroupingsGet = _classThis = _classDescriptor.value;
1087
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1088
+ __runInitializers(_classThis, _classExtraInitializers);
1089
+ }
1090
+ };
1091
+ return MultiChannelAssociationCCSupportedGroupingsGet = _classThis;
1092
+ })();
980
1093
  export { MultiChannelAssociationCCSupportedGroupingsGet };
981
1094
  //# sourceMappingURL=MultiChannelAssociationCC.js.map