@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 AssociationGroupInfoCC_1, AssociationGroupInfoCCNameReport_1, AssociationGroupInfoCCNameGet_1, AssociationGroupInfoCCInfoReport_1, AssociationGroupInfoCCInfoGet_1, AssociationGroupInfoCCCommandListReport_1, AssociationGroupInfoCCCommandListGet_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -183,7 +210,7 @@ import { Bytes } from "@zwave-js/shared/safe";
183
210
  import { cpp2js, getEnumMemberName, num2hex } from "@zwave-js/shared/safe";
184
211
  import { CCAPI, PhysicalCCAPI } from "../lib/API.js";
185
212
  import { CommandClass, } from "../lib/CommandClass.js";
186
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, } from "../lib/CommandClassDecorators.js";
213
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, } from "../lib/CommandClassDecorators.js";
187
214
  import { V } from "../lib/Values.js";
188
215
  import { AssociationGroupInfoCommand, AssociationGroupInfoProfile, } from "../lib/_Types.js";
189
216
  import { AssociationCC } from "./AssociationCC.js";
@@ -202,568 +229,661 @@ export const AssociationGroupInfoCCValues = Object.freeze({
202
229
  }),
203
230
  });
204
231
  // @noSetValueAPI This CC only has get-type commands
205
- let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends PhysicalCCAPI {
206
- supportsCommand(cmd) {
207
- switch (cmd) {
208
- case AssociationGroupInfoCommand.NameGet:
209
- case AssociationGroupInfoCommand.NameReport:
210
- case AssociationGroupInfoCommand.InfoGet:
211
- case AssociationGroupInfoCommand.InfoReport:
212
- case AssociationGroupInfoCommand.CommandListGet:
213
- case AssociationGroupInfoCommand.CommandListReport:
214
- return true; // This is mandatory
215
- }
216
- return super.supportsCommand(cmd);
217
- }
218
- async getGroupName(groupId) {
219
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
220
- this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.NameGet);
221
- const cc = new AssociationGroupInfoCCNameGet({
222
- nodeId: this.endpoint.nodeId,
223
- endpointIndex: this.endpoint.index,
224
- groupId,
225
- });
226
- const response = await this.host.sendCommand(cc, this.commandOptions);
227
- if (response)
228
- return response.name;
229
- }
230
- async reportGroupName(groupId, name) {
231
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
232
- __assertType("name", "string", __assertType__string.bind(void 0, name));
233
- this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.NameReport);
234
- const cc = new AssociationGroupInfoCCNameReport({
235
- nodeId: this.endpoint.nodeId,
236
- endpointIndex: this.endpoint.index,
237
- groupId,
238
- name,
239
- });
240
- await this.host.sendCommand(cc, this.commandOptions);
241
- }
242
- async getGroupInfo(groupId, refreshCache = false) {
243
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
244
- __assertType("refreshCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, refreshCache));
245
- this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.InfoGet);
246
- const cc = new AssociationGroupInfoCCInfoGet({
247
- nodeId: this.endpoint.nodeId,
248
- endpointIndex: this.endpoint.index,
249
- groupId,
250
- refreshCache,
251
- });
252
- const response = await this.host.sendCommand(cc, this.commandOptions);
253
- // SDS13782 says: If List Mode is set to 0, the Group Count field MUST be set to 1.
254
- // But that's not always the case. Apparently some endpoints return 0 groups
255
- // although they support AGI CC
256
- if (response && response.groups.length > 0) {
257
- const { groupId: _, ...info } = response.groups[0];
258
- return {
259
- hasDynamicInfo: response.hasDynamicInfo,
260
- ...info,
261
- };
232
+ let AssociationGroupInfoCCAPI = (() => {
233
+ let _classDecorators = [API(CommandClasses["Association Group Information"])];
234
+ let _classDescriptor;
235
+ let _classExtraInitializers = [];
236
+ let _classThis;
237
+ let _classSuper = PhysicalCCAPI;
238
+ var AssociationGroupInfoCCAPI = class extends _classSuper {
239
+ static { _classThis = this; }
240
+ static {
241
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
242
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
243
+ AssociationGroupInfoCCAPI = _classThis = _classDescriptor.value;
244
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
245
+ __runInitializers(_classThis, _classExtraInitializers);
262
246
  }
263
- }
264
- async reportGroupInfo(options) {
265
- __assertType("options", "AssociationGroupInfoCCInfoReportOptions", __assertType__AssociationGroupInfoCCInfoReportOptions.bind(void 0, options));
266
- this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.InfoReport);
267
- const cc = new AssociationGroupInfoCCInfoReport({
268
- nodeId: this.endpoint.nodeId,
269
- endpointIndex: this.endpoint.index,
270
- ...options,
271
- });
272
- await this.host.sendCommand(cc, this.commandOptions);
273
- }
274
- async getCommands(groupId, allowCache = true) {
275
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
276
- __assertType("allowCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, allowCache));
277
- this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.CommandListGet);
278
- const cc = new AssociationGroupInfoCCCommandListGet({
279
- nodeId: this.endpoint.nodeId,
280
- endpointIndex: this.endpoint.index,
281
- groupId,
282
- allowCache,
283
- });
284
- const response = await this.host.sendCommand(cc, this.commandOptions);
285
- if (response)
286
- return response.commands;
287
- }
288
- async reportCommands(groupId, commands) {
289
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
290
- __assertType("commands", undefined, __assertType___0_1_2.bind(void 0, commands));
291
- this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.CommandListReport);
292
- const cc = new AssociationGroupInfoCCCommandListReport({
293
- nodeId: this.endpoint.nodeId,
294
- endpointIndex: this.endpoint.index,
295
- groupId,
296
- commands,
297
- });
298
- await this.host.sendCommand(cc, this.commandOptions);
299
- }
300
- };
301
- AssociationGroupInfoCCAPI = __decorate([
302
- API(CommandClasses["Association Group Information"])
303
- ], AssociationGroupInfoCCAPI);
247
+ supportsCommand(cmd) {
248
+ switch (cmd) {
249
+ case AssociationGroupInfoCommand.NameGet:
250
+ case AssociationGroupInfoCommand.NameReport:
251
+ case AssociationGroupInfoCommand.InfoGet:
252
+ case AssociationGroupInfoCommand.InfoReport:
253
+ case AssociationGroupInfoCommand.CommandListGet:
254
+ case AssociationGroupInfoCommand.CommandListReport:
255
+ return true; // This is mandatory
256
+ }
257
+ return super.supportsCommand(cmd);
258
+ }
259
+ async getGroupName(groupId) {
260
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
261
+ this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.NameGet);
262
+ const cc = new AssociationGroupInfoCCNameGet({
263
+ nodeId: this.endpoint.nodeId,
264
+ endpointIndex: this.endpoint.index,
265
+ groupId,
266
+ });
267
+ const response = await this.host.sendCommand(cc, this.commandOptions);
268
+ if (response)
269
+ return response.name;
270
+ }
271
+ async reportGroupName(groupId, name) {
272
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
273
+ __assertType("name", "string", __assertType__string.bind(void 0, name));
274
+ this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.NameReport);
275
+ const cc = new AssociationGroupInfoCCNameReport({
276
+ nodeId: this.endpoint.nodeId,
277
+ endpointIndex: this.endpoint.index,
278
+ groupId,
279
+ name,
280
+ });
281
+ await this.host.sendCommand(cc, this.commandOptions);
282
+ }
283
+ async getGroupInfo(groupId, refreshCache = false) {
284
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
285
+ __assertType("refreshCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, refreshCache));
286
+ this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.InfoGet);
287
+ const cc = new AssociationGroupInfoCCInfoGet({
288
+ nodeId: this.endpoint.nodeId,
289
+ endpointIndex: this.endpoint.index,
290
+ groupId,
291
+ refreshCache,
292
+ });
293
+ const response = await this.host.sendCommand(cc, this.commandOptions);
294
+ // SDS13782 says: If List Mode is set to 0, the Group Count field MUST be set to 1.
295
+ // But that's not always the case. Apparently some endpoints return 0 groups
296
+ // although they support AGI CC
297
+ if (response && response.groups.length > 0) {
298
+ const { groupId: _, ...info } = response.groups[0];
299
+ return {
300
+ hasDynamicInfo: response.hasDynamicInfo,
301
+ ...info,
302
+ };
303
+ }
304
+ }
305
+ async reportGroupInfo(options) {
306
+ __assertType("options", "AssociationGroupInfoCCInfoReportOptions", __assertType__AssociationGroupInfoCCInfoReportOptions.bind(void 0, options));
307
+ this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.InfoReport);
308
+ const cc = new AssociationGroupInfoCCInfoReport({
309
+ nodeId: this.endpoint.nodeId,
310
+ endpointIndex: this.endpoint.index,
311
+ ...options,
312
+ });
313
+ await this.host.sendCommand(cc, this.commandOptions);
314
+ }
315
+ async getCommands(groupId, allowCache = true) {
316
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
317
+ __assertType("allowCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, allowCache));
318
+ this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.CommandListGet);
319
+ const cc = new AssociationGroupInfoCCCommandListGet({
320
+ nodeId: this.endpoint.nodeId,
321
+ endpointIndex: this.endpoint.index,
322
+ groupId,
323
+ allowCache,
324
+ });
325
+ const response = await this.host.sendCommand(cc, this.commandOptions);
326
+ if (response)
327
+ return response.commands;
328
+ }
329
+ async reportCommands(groupId, commands) {
330
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
331
+ __assertType("commands", undefined, __assertType___0_1_2.bind(void 0, commands));
332
+ this.assertSupportsCommand(AssociationGroupInfoCommand, AssociationGroupInfoCommand.CommandListReport);
333
+ const cc = new AssociationGroupInfoCCCommandListReport({
334
+ nodeId: this.endpoint.nodeId,
335
+ endpointIndex: this.endpoint.index,
336
+ groupId,
337
+ commands,
338
+ });
339
+ await this.host.sendCommand(cc, this.commandOptions);
340
+ }
341
+ };
342
+ return AssociationGroupInfoCCAPI = _classThis;
343
+ })();
304
344
  export { AssociationGroupInfoCCAPI };
305
- let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupInfoCC extends CommandClass {
306
- determineRequiredCCInterviews() {
307
- // AssociationCC must be interviewed after Z-Wave+ if that is supported
308
- return [
309
- ...super.determineRequiredCCInterviews(),
310
- CommandClasses.Association,
311
- CommandClasses["Multi Channel Association"],
312
- ];
313
- }
314
- /** Returns the name of an association group */
315
- static getGroupNameCached(ctx, endpoint, groupId) {
316
- return ctx
317
- .getValueDB(endpoint.nodeId)
318
- .getValue(AssociationGroupInfoCCValues.groupName(groupId).endpoint(endpoint.index));
319
- }
320
- /** Returns the association profile for an association group */
321
- static getGroupProfileCached(ctx, endpoint, groupId) {
322
- return ctx.getValueDB(endpoint.nodeId).getValue(AssociationGroupInfoCCValues.groupInfo(groupId).endpoint(endpoint.index))
323
- ?.profile;
324
- }
325
- /** Returns the dictionary of all commands issued by the given association group */
326
- static getIssuedCommandsCached(ctx, endpoint, groupId) {
327
- return ctx
328
- .getValueDB(endpoint.nodeId)
329
- .getValue(AssociationGroupInfoCCValues.commands(groupId).endpoint(endpoint.index));
330
- }
331
- static findGroupsForIssuedCommand(ctx, endpoint, ccId, command) {
332
- const ret = [];
333
- const associationGroupCount = this.getAssociationGroupCountCached(ctx, endpoint);
334
- for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
335
- // Scan the issued commands of all groups if there's a match
336
- const issuedCommands = this.getIssuedCommandsCached(ctx, endpoint, groupId);
337
- if (!issuedCommands)
338
- continue;
339
- if (issuedCommands.has(ccId)
340
- && issuedCommands.get(ccId).includes(command)) {
341
- ret.push(groupId);
342
- continue;
345
+ let AssociationGroupInfoCC = (() => {
346
+ let _classDecorators = [commandClass(CommandClasses["Association Group Information"]), implementedVersion(3), ccValues(AssociationGroupInfoCCValues)];
347
+ let _classDescriptor;
348
+ let _classExtraInitializers = [];
349
+ let _classThis;
350
+ let _classSuper = CommandClass;
351
+ var AssociationGroupInfoCC = class extends _classSuper {
352
+ static { _classThis = this; }
353
+ static {
354
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
355
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
356
+ AssociationGroupInfoCC = _classThis = _classDescriptor.value;
357
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
358
+ __runInitializers(_classThis, _classExtraInitializers);
359
+ }
360
+ determineRequiredCCInterviews() {
361
+ // AssociationCC must be interviewed after Z-Wave+ if that is supported
362
+ return [
363
+ ...super.determineRequiredCCInterviews(),
364
+ CommandClasses.Association,
365
+ CommandClasses["Multi Channel Association"],
366
+ ];
367
+ }
368
+ /** Returns the name of an association group */
369
+ static getGroupNameCached(ctx, endpoint, groupId) {
370
+ return ctx
371
+ .getValueDB(endpoint.nodeId)
372
+ .getValue(AssociationGroupInfoCCValues.groupName(groupId).endpoint(endpoint.index));
373
+ }
374
+ /** Returns the association profile for an association group */
375
+ static getGroupProfileCached(ctx, endpoint, groupId) {
376
+ return ctx.getValueDB(endpoint.nodeId).getValue(AssociationGroupInfoCCValues.groupInfo(groupId).endpoint(endpoint.index))
377
+ ?.profile;
378
+ }
379
+ /** Returns the dictionary of all commands issued by the given association group */
380
+ static getIssuedCommandsCached(ctx, endpoint, groupId) {
381
+ return ctx
382
+ .getValueDB(endpoint.nodeId)
383
+ .getValue(AssociationGroupInfoCCValues.commands(groupId).endpoint(endpoint.index));
384
+ }
385
+ static findGroupsForIssuedCommand(ctx, endpoint, ccId, command) {
386
+ const ret = [];
387
+ const associationGroupCount = this.getAssociationGroupCountCached(ctx, endpoint);
388
+ for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
389
+ // Scan the issued commands of all groups if there's a match
390
+ const issuedCommands = this.getIssuedCommandsCached(ctx, endpoint, groupId);
391
+ if (!issuedCommands)
392
+ continue;
393
+ if (issuedCommands.has(ccId)
394
+ && issuedCommands.get(ccId).includes(command)) {
395
+ ret.push(groupId);
396
+ continue;
397
+ }
343
398
  }
399
+ return ret;
344
400
  }
345
- return ret;
346
- }
347
- static getAssociationGroupCountCached(ctx, endpoint) {
348
- // The association group count is either determined by the
349
- // Association CC or the Multi Channel Association CC
350
- return (
351
- // First query the Multi Channel Association CC
352
- // And fall back to 0
353
- (endpoint.supportsCC(CommandClasses["Multi Channel Association"])
354
- && MultiChannelAssociationCC.getGroupCountCached(ctx, endpoint))
355
- // Then the Association CC
356
- || (endpoint.supportsCC(CommandClasses.Association)
357
- && AssociationCC.getGroupCountCached(ctx, endpoint))
358
- || 0);
359
- }
360
- async interview(ctx) {
361
- const node = this.getNode(ctx);
362
- const endpoint = this.getEndpoint(ctx);
363
- const api = CCAPI.create(CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: MessagePriority.NodeQuery });
364
- ctx.logNode(node.id, {
365
- endpoint: this.endpointIndex,
366
- message: `Interviewing ${this.ccName}...`,
367
- direction: "none",
368
- });
369
- const associationGroupCount = AssociationGroupInfoCC_1
370
- .getAssociationGroupCountCached(ctx, endpoint);
371
- for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
372
- // First get the group's name
401
+ static getAssociationGroupCountCached(ctx, endpoint) {
402
+ // The association group count is either determined by the
403
+ // Association CC or the Multi Channel Association CC
404
+ return (
405
+ // First query the Multi Channel Association CC
406
+ // And fall back to 0
407
+ (endpoint.supportsCC(CommandClasses["Multi Channel Association"])
408
+ && MultiChannelAssociationCC.getGroupCountCached(ctx, endpoint))
409
+ // Then the Association CC
410
+ || (endpoint.supportsCC(CommandClasses.Association)
411
+ && AssociationCC.getGroupCountCached(ctx, endpoint))
412
+ || 0);
413
+ }
414
+ async interview(ctx) {
415
+ const node = this.getNode(ctx);
416
+ const endpoint = this.getEndpoint(ctx);
417
+ const api = CCAPI.create(CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: MessagePriority.NodeQuery });
373
418
  ctx.logNode(node.id, {
374
419
  endpoint: this.endpointIndex,
375
- message: `Association group #${groupId}: Querying name...`,
376
- direction: "outbound",
420
+ message: `Interviewing ${this.ccName}...`,
421
+ direction: "none",
377
422
  });
378
- const name = await api.getGroupName(groupId);
379
- if (name) {
380
- const logMessage = `Association group #${groupId} has name "${name}"`;
423
+ const associationGroupCount = AssociationGroupInfoCC
424
+ .getAssociationGroupCountCached(ctx, endpoint);
425
+ for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
426
+ // First get the group's name
427
+ ctx.logNode(node.id, {
428
+ endpoint: this.endpointIndex,
429
+ message: `Association group #${groupId}: Querying name...`,
430
+ direction: "outbound",
431
+ });
432
+ const name = await api.getGroupName(groupId);
433
+ if (name) {
434
+ const logMessage = `Association group #${groupId} has name "${name}"`;
435
+ ctx.logNode(node.id, {
436
+ endpoint: this.endpointIndex,
437
+ message: logMessage,
438
+ direction: "inbound",
439
+ });
440
+ }
441
+ // Then the command list
381
442
  ctx.logNode(node.id, {
382
443
  endpoint: this.endpointIndex,
383
- message: logMessage,
384
- direction: "inbound",
444
+ message: `Association group #${groupId}: Querying command list...`,
445
+ direction: "outbound",
385
446
  });
447
+ await api.getCommands(groupId);
448
+ // Not sure how to log this
386
449
  }
387
- // Then the command list
388
- ctx.logNode(node.id, {
389
- endpoint: this.endpointIndex,
390
- message: `Association group #${groupId}: Querying command list...`,
391
- direction: "outbound",
392
- });
393
- await api.getCommands(groupId);
394
- // Not sure how to log this
450
+ // Finally query each group for its information
451
+ await this.refreshValues(ctx);
452
+ // Remember that the interview is complete
453
+ this.setInterviewComplete(ctx, true);
395
454
  }
396
- // Finally query each group for its information
397
- await this.refreshValues(ctx);
398
- // Remember that the interview is complete
399
- this.setInterviewComplete(ctx, true);
400
- }
401
- async refreshValues(ctx) {
402
- const node = this.getNode(ctx);
403
- const endpoint = this.getEndpoint(ctx);
404
- const api = CCAPI.create(CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: MessagePriority.NodeQuery });
405
- // Query the information for each group (this is the only thing that could be dynamic)
406
- const associationGroupCount = AssociationGroupInfoCC_1
407
- .getAssociationGroupCountCached(ctx, endpoint);
408
- const hasDynamicInfo = this.getValue(ctx, AssociationGroupInfoCCValues.hasDynamicInfo);
409
- for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
410
- // Then its information
411
- ctx.logNode(node.id, {
412
- endpoint: this.endpointIndex,
413
- message: `Association group #${groupId}: Querying info...`,
414
- direction: "outbound",
415
- });
416
- const info = await api.getGroupInfo(groupId, !!hasDynamicInfo);
417
- if (info) {
418
- const logMessage = `Received info for association group #${groupId}:
419
- info is dynamic: ${info.hasDynamicInfo}
420
- profile: ${getEnumMemberName(AssociationGroupInfoProfile, info.profile)}`;
455
+ async refreshValues(ctx) {
456
+ const node = this.getNode(ctx);
457
+ const endpoint = this.getEndpoint(ctx);
458
+ const api = CCAPI.create(CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: MessagePriority.NodeQuery });
459
+ // Query the information for each group (this is the only thing that could be dynamic)
460
+ const associationGroupCount = AssociationGroupInfoCC
461
+ .getAssociationGroupCountCached(ctx, endpoint);
462
+ const hasDynamicInfo = this.getValue(ctx, AssociationGroupInfoCCValues.hasDynamicInfo);
463
+ for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
464
+ // Then its information
421
465
  ctx.logNode(node.id, {
422
466
  endpoint: this.endpointIndex,
423
- message: logMessage,
424
- direction: "inbound",
467
+ message: `Association group #${groupId}: Querying info...`,
468
+ direction: "outbound",
425
469
  });
470
+ const info = await api.getGroupInfo(groupId, !!hasDynamicInfo);
471
+ if (info) {
472
+ const logMessage = `Received info for association group #${groupId}:
473
+ info is dynamic: ${info.hasDynamicInfo}
474
+ profile: ${getEnumMemberName(AssociationGroupInfoProfile, info.profile)}`;
475
+ ctx.logNode(node.id, {
476
+ endpoint: this.endpointIndex,
477
+ message: logMessage,
478
+ direction: "inbound",
479
+ });
480
+ }
426
481
  }
427
482
  }
428
- }
429
- };
430
- AssociationGroupInfoCC = AssociationGroupInfoCC_1 = __decorate([
431
- commandClass(CommandClasses["Association Group Information"]),
432
- implementedVersion(3),
433
- ccValues(AssociationGroupInfoCCValues)
434
- ], AssociationGroupInfoCC);
483
+ };
484
+ return AssociationGroupInfoCC = _classThis;
485
+ })();
435
486
  export { AssociationGroupInfoCC };
436
- let AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport_1 = class AssociationGroupInfoCCNameReport extends AssociationGroupInfoCC {
437
- constructor(options) {
438
- super(options);
439
- this.groupId = options.groupId;
440
- this.name = options.name;
441
- }
442
- static from(raw, ctx) {
443
- validatePayload(raw.payload.length >= 2);
444
- const groupId = raw.payload[0];
445
- const nameLength = raw.payload[1];
446
- validatePayload(raw.payload.length >= 2 + nameLength);
447
- // The specs don't allow 0-terminated string, but some devices use them
448
- // So we need to cut them off
449
- const name = cpp2js(raw.payload.subarray(2, 2 + nameLength).toString("utf8"));
450
- return new AssociationGroupInfoCCNameReport_1({
451
- nodeId: ctx.sourceNodeId,
452
- groupId,
453
- name,
454
- });
455
- }
456
- groupId;
457
- name;
458
- persistValues(ctx) {
459
- if (!super.persistValues(ctx))
460
- return false;
461
- const valueDB = this.getValueDB(ctx);
462
- valueDB.setValue(AssociationGroupInfoCCValues.groupName(this.groupId).endpoint(this.endpointIndex), this.name);
463
- return true;
464
- }
465
- serialize(ctx) {
466
- this.payload = Bytes.concat([
467
- Bytes.from([this.groupId, this.name.length]),
468
- Bytes.from(this.name, "utf8"),
469
- ]);
470
- return super.serialize(ctx);
471
- }
472
- toLogEntry(ctx) {
473
- return {
474
- ...super.toLogEntry(ctx),
475
- message: {
476
- "group id": this.groupId,
477
- name: this.name,
478
- },
479
- };
480
- }
481
- };
482
- AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport_1 = __decorate([
483
- CCCommand(AssociationGroupInfoCommand.NameReport)
484
- ], AssociationGroupInfoCCNameReport);
487
+ let AssociationGroupInfoCCNameReport = (() => {
488
+ let _classDecorators = [CCCommand(AssociationGroupInfoCommand.NameReport)];
489
+ let _classDescriptor;
490
+ let _classExtraInitializers = [];
491
+ let _classThis;
492
+ let _classSuper = AssociationGroupInfoCC;
493
+ var AssociationGroupInfoCCNameReport = class extends _classSuper {
494
+ static { _classThis = this; }
495
+ static {
496
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
497
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
498
+ AssociationGroupInfoCCNameReport = _classThis = _classDescriptor.value;
499
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
500
+ __runInitializers(_classThis, _classExtraInitializers);
501
+ }
502
+ constructor(options) {
503
+ super(options);
504
+ this.groupId = options.groupId;
505
+ this.name = options.name;
506
+ }
507
+ static from(raw, ctx) {
508
+ validatePayload(raw.payload.length >= 2);
509
+ const groupId = raw.payload[0];
510
+ const nameLength = raw.payload[1];
511
+ validatePayload(raw.payload.length >= 2 + nameLength);
512
+ // The specs don't allow 0-terminated string, but some devices use them
513
+ // So we need to cut them off
514
+ const name = cpp2js(raw.payload.subarray(2, 2 + nameLength).toString("utf8"));
515
+ return new this({
516
+ nodeId: ctx.sourceNodeId,
517
+ groupId,
518
+ name,
519
+ });
520
+ }
521
+ groupId;
522
+ name;
523
+ persistValues(ctx) {
524
+ if (!super.persistValues(ctx))
525
+ return false;
526
+ const valueDB = this.getValueDB(ctx);
527
+ valueDB.setValue(AssociationGroupInfoCCValues.groupName(this.groupId).endpoint(this.endpointIndex), this.name);
528
+ return true;
529
+ }
530
+ serialize(ctx) {
531
+ this.payload = Bytes.concat([
532
+ Bytes.from([this.groupId, this.name.length]),
533
+ Bytes.from(this.name, "utf8"),
534
+ ]);
535
+ return super.serialize(ctx);
536
+ }
537
+ toLogEntry(ctx) {
538
+ return {
539
+ ...super.toLogEntry(ctx),
540
+ message: {
541
+ "group id": this.groupId,
542
+ name: this.name,
543
+ },
544
+ };
545
+ }
546
+ };
547
+ return AssociationGroupInfoCCNameReport = _classThis;
548
+ })();
485
549
  export { AssociationGroupInfoCCNameReport };
486
- let AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet_1 = class AssociationGroupInfoCCNameGet extends AssociationGroupInfoCC {
487
- constructor(options) {
488
- super(options);
489
- this.groupId = options.groupId;
490
- }
491
- static from(raw, ctx) {
492
- validatePayload(raw.payload.length >= 1);
493
- const groupId = raw.payload[0];
494
- return new AssociationGroupInfoCCNameGet_1({
495
- nodeId: ctx.sourceNodeId,
496
- groupId,
497
- });
498
- }
499
- groupId;
500
- serialize(ctx) {
501
- this.payload = Bytes.from([this.groupId]);
502
- return super.serialize(ctx);
503
- }
504
- toLogEntry(ctx) {
505
- return {
506
- ...super.toLogEntry(ctx),
507
- message: { "group id": this.groupId },
508
- };
509
- }
510
- };
511
- AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet_1 = __decorate([
512
- CCCommand(AssociationGroupInfoCommand.NameGet),
513
- expectedCCResponse(AssociationGroupInfoCCNameReport)
514
- ], AssociationGroupInfoCCNameGet);
550
+ let AssociationGroupInfoCCNameGet = (() => {
551
+ let _classDecorators = [CCCommand(AssociationGroupInfoCommand.NameGet), expectedCCResponse(AssociationGroupInfoCCNameReport)];
552
+ let _classDescriptor;
553
+ let _classExtraInitializers = [];
554
+ let _classThis;
555
+ let _classSuper = AssociationGroupInfoCC;
556
+ var AssociationGroupInfoCCNameGet = class extends _classSuper {
557
+ static { _classThis = this; }
558
+ static {
559
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
560
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
561
+ AssociationGroupInfoCCNameGet = _classThis = _classDescriptor.value;
562
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
563
+ __runInitializers(_classThis, _classExtraInitializers);
564
+ }
565
+ constructor(options) {
566
+ super(options);
567
+ this.groupId = options.groupId;
568
+ }
569
+ static from(raw, ctx) {
570
+ validatePayload(raw.payload.length >= 1);
571
+ const groupId = raw.payload[0];
572
+ return new this({
573
+ nodeId: ctx.sourceNodeId,
574
+ groupId,
575
+ });
576
+ }
577
+ groupId;
578
+ serialize(ctx) {
579
+ this.payload = Bytes.from([this.groupId]);
580
+ return super.serialize(ctx);
581
+ }
582
+ toLogEntry(ctx) {
583
+ return {
584
+ ...super.toLogEntry(ctx),
585
+ message: { "group id": this.groupId },
586
+ };
587
+ }
588
+ };
589
+ return AssociationGroupInfoCCNameGet = _classThis;
590
+ })();
515
591
  export { AssociationGroupInfoCCNameGet };
516
- let AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport_1 = class AssociationGroupInfoCCInfoReport extends AssociationGroupInfoCC {
517
- constructor(options) {
518
- super(options);
519
- this.isListMode = options.isListMode;
520
- this.hasDynamicInfo = options.hasDynamicInfo;
521
- this.groups = options.groups;
522
- }
523
- static from(raw, ctx) {
524
- validatePayload(raw.payload.length >= 1);
525
- const isListMode = !!(raw.payload[0] & 0b1000_0000);
526
- const hasDynamicInfo = !!(raw.payload[0] & 0b0100_0000);
527
- const groupCount = raw.payload[0] & 0b0011_1111;
528
- // each group requires 7 bytes of payload
529
- validatePayload(raw.payload.length >= 1 + groupCount * 7);
530
- const groups = [];
531
- for (let i = 0; i < groupCount; i++) {
532
- const offset = 1 + i * 7;
533
- // Parse the payload
534
- const groupBytes = raw.payload.subarray(offset, offset + 7);
535
- const groupId = groupBytes[0];
536
- const mode = 0; // groupBytes[1];
537
- const profile = groupBytes.readUInt16BE(2);
538
- const eventCode = 0; // groupBytes.readUInt16BE(5);
539
- groups.push({ groupId, mode, profile, eventCode });
540
- }
541
- return new AssociationGroupInfoCCInfoReport_1({
542
- nodeId: ctx.sourceNodeId,
543
- isListMode,
544
- hasDynamicInfo,
545
- groups,
546
- });
547
- }
548
- isListMode;
549
- hasDynamicInfo;
550
- groups;
551
- persistValues(ctx) {
552
- if (!super.persistValues(ctx))
553
- return false;
554
- for (const group of this.groups) {
555
- const { groupId, mode, profile, eventCode } = group;
556
- this.setValue(ctx, AssociationGroupInfoCCValues.groupInfo(groupId), {
557
- mode,
558
- profile,
559
- eventCode,
592
+ let AssociationGroupInfoCCInfoReport = (() => {
593
+ let _classDecorators = [CCCommand(AssociationGroupInfoCommand.InfoReport), ccValueProperty("hasDynamicInfo", AssociationGroupInfoCCValues.hasDynamicInfo)];
594
+ let _classDescriptor;
595
+ let _classExtraInitializers = [];
596
+ let _classThis;
597
+ let _classSuper = AssociationGroupInfoCC;
598
+ var AssociationGroupInfoCCInfoReport = class extends _classSuper {
599
+ static { _classThis = this; }
600
+ static {
601
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
602
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
603
+ AssociationGroupInfoCCInfoReport = _classThis = _classDescriptor.value;
604
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
605
+ __runInitializers(_classThis, _classExtraInitializers);
606
+ }
607
+ constructor(options) {
608
+ super(options);
609
+ this.isListMode = options.isListMode;
610
+ this.hasDynamicInfo = options.hasDynamicInfo;
611
+ this.groups = options.groups;
612
+ }
613
+ static from(raw, ctx) {
614
+ validatePayload(raw.payload.length >= 1);
615
+ const isListMode = !!(raw.payload[0] & 0b1000_0000);
616
+ const hasDynamicInfo = !!(raw.payload[0] & 0b0100_0000);
617
+ const groupCount = raw.payload[0] & 0b0011_1111;
618
+ // each group requires 7 bytes of payload
619
+ validatePayload(raw.payload.length >= 1 + groupCount * 7);
620
+ const groups = [];
621
+ for (let i = 0; i < groupCount; i++) {
622
+ const offset = 1 + i * 7;
623
+ // Parse the payload
624
+ const groupBytes = raw.payload.subarray(offset, offset + 7);
625
+ const groupId = groupBytes[0];
626
+ const mode = 0; // groupBytes[1];
627
+ const profile = groupBytes.readUInt16BE(2);
628
+ const eventCode = 0; // groupBytes.readUInt16BE(5);
629
+ groups.push({ groupId, mode, profile, eventCode });
630
+ }
631
+ return new this({
632
+ nodeId: ctx.sourceNodeId,
633
+ isListMode,
634
+ hasDynamicInfo,
635
+ groups,
560
636
  });
561
637
  }
562
- return true;
563
- }
564
- serialize(ctx) {
565
- this.payload = Bytes.alloc(1 + this.groups.length * 7, 0);
566
- this.payload[0] = (this.isListMode ? 0b1000_0000 : 0)
567
- | (this.hasDynamicInfo ? 0b0100_0000 : 0)
568
- | (this.groups.length & 0b0011_1111);
569
- for (let i = 0; i < this.groups.length; i++) {
570
- const offset = 1 + i * 7;
571
- this.payload[offset] = this.groups[i].groupId;
572
- this.payload.writeUInt16BE(this.groups[i].profile, offset + 2);
573
- // The remaining bytes are zero
574
- }
575
- return super.serialize(ctx);
576
- }
577
- toLogEntry(ctx) {
578
- return {
579
- ...super.toLogEntry(ctx),
580
- message: {
581
- "is list mode": this.isListMode,
582
- "has dynamic info": this.hasDynamicInfo,
583
- groups: `${this.groups
584
- .map((g) => `
638
+ isListMode;
639
+ hasDynamicInfo;
640
+ groups;
641
+ persistValues(ctx) {
642
+ if (!super.persistValues(ctx))
643
+ return false;
644
+ for (const group of this.groups) {
645
+ const { groupId, mode, profile, eventCode } = group;
646
+ this.setValue(ctx, AssociationGroupInfoCCValues.groupInfo(groupId), {
647
+ mode,
648
+ profile,
649
+ eventCode,
650
+ });
651
+ }
652
+ return true;
653
+ }
654
+ serialize(ctx) {
655
+ this.payload = Bytes.alloc(1 + this.groups.length * 7, 0);
656
+ this.payload[0] = (this.isListMode ? 0b1000_0000 : 0)
657
+ | (this.hasDynamicInfo ? 0b0100_0000 : 0)
658
+ | (this.groups.length & 0b0011_1111);
659
+ for (let i = 0; i < this.groups.length; i++) {
660
+ const offset = 1 + i * 7;
661
+ this.payload[offset] = this.groups[i].groupId;
662
+ this.payload.writeUInt16BE(this.groups[i].profile, offset + 2);
663
+ // The remaining bytes are zero
664
+ }
665
+ return super.serialize(ctx);
666
+ }
667
+ toLogEntry(ctx) {
668
+ return {
669
+ ...super.toLogEntry(ctx),
670
+ message: {
671
+ "is list mode": this.isListMode,
672
+ "has dynamic info": this.hasDynamicInfo,
673
+ groups: `${this.groups
674
+ .map((g) => `
585
675
  · Group #${g.groupId}
586
676
  mode: ${g.mode}
587
677
  profile: ${g.profile}
588
678
  event code: ${g.eventCode}`)
589
- .join("")}`,
590
- },
591
- };
592
- }
593
- };
594
- __decorate([
595
- ccValue(AssociationGroupInfoCCValues.hasDynamicInfo)
596
- ], AssociationGroupInfoCCInfoReport.prototype, "hasDynamicInfo", void 0);
597
- AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport_1 = __decorate([
598
- CCCommand(AssociationGroupInfoCommand.InfoReport)
599
- ], AssociationGroupInfoCCInfoReport);
679
+ .join("")}`,
680
+ },
681
+ };
682
+ }
683
+ };
684
+ return AssociationGroupInfoCCInfoReport = _classThis;
685
+ })();
600
686
  export { AssociationGroupInfoCCInfoReport };
601
- let AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet_1 = class AssociationGroupInfoCCInfoGet extends AssociationGroupInfoCC {
602
- constructor(options) {
603
- super(options);
604
- this.refreshCache = options.refreshCache;
605
- if ("listMode" in options)
606
- this.listMode = options.listMode;
607
- if ("groupId" in options)
608
- this.groupId = options.groupId;
609
- }
610
- static from(raw, ctx) {
611
- validatePayload(raw.payload.length >= 2);
612
- const optionByte = raw.payload[0];
613
- const refreshCache = !!(optionByte & 0b1000_0000);
614
- const listMode = !!(optionByte & 0b0100_0000);
615
- let groupId;
616
- if (!listMode) {
617
- groupId = raw.payload[1];
618
- }
619
- return new AssociationGroupInfoCCInfoGet_1({
620
- nodeId: ctx.sourceNodeId,
621
- refreshCache,
622
- listMode,
623
- groupId,
624
- });
625
- }
626
- refreshCache;
627
- listMode;
628
- groupId;
629
- serialize(ctx) {
630
- const isListMode = this.listMode === true;
631
- const optionByte = (this.refreshCache ? 0b1000_0000 : 0)
632
- | (isListMode ? 0b0100_0000 : 0);
633
- this.payload = Bytes.from([
634
- optionByte,
635
- isListMode ? 0 : this.groupId,
636
- ]);
637
- return super.serialize(ctx);
638
- }
639
- toLogEntry(ctx) {
640
- const message = {};
641
- if (this.groupId != undefined) {
642
- message["group id"] = this.groupId;
643
- }
644
- if (this.listMode != undefined) {
645
- message["list mode"] = this.listMode;
646
- }
647
- message["refresh cache"] = this.refreshCache;
648
- return {
649
- ...super.toLogEntry(ctx),
650
- message,
651
- };
652
- }
653
- };
654
- AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet_1 = __decorate([
655
- CCCommand(AssociationGroupInfoCommand.InfoGet),
656
- expectedCCResponse(AssociationGroupInfoCCInfoReport)
657
- ], AssociationGroupInfoCCInfoGet);
687
+ let AssociationGroupInfoCCInfoGet = (() => {
688
+ let _classDecorators = [CCCommand(AssociationGroupInfoCommand.InfoGet), expectedCCResponse(AssociationGroupInfoCCInfoReport)];
689
+ let _classDescriptor;
690
+ let _classExtraInitializers = [];
691
+ let _classThis;
692
+ let _classSuper = AssociationGroupInfoCC;
693
+ var AssociationGroupInfoCCInfoGet = class extends _classSuper {
694
+ static { _classThis = this; }
695
+ static {
696
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
697
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
698
+ AssociationGroupInfoCCInfoGet = _classThis = _classDescriptor.value;
699
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
700
+ __runInitializers(_classThis, _classExtraInitializers);
701
+ }
702
+ constructor(options) {
703
+ super(options);
704
+ this.refreshCache = options.refreshCache;
705
+ if ("listMode" in options)
706
+ this.listMode = options.listMode;
707
+ if ("groupId" in options)
708
+ this.groupId = options.groupId;
709
+ }
710
+ static from(raw, ctx) {
711
+ validatePayload(raw.payload.length >= 2);
712
+ const optionByte = raw.payload[0];
713
+ const refreshCache = !!(optionByte & 0b1000_0000);
714
+ const listMode = !!(optionByte & 0b0100_0000);
715
+ let groupId;
716
+ if (!listMode) {
717
+ groupId = raw.payload[1];
718
+ }
719
+ return new this({
720
+ nodeId: ctx.sourceNodeId,
721
+ refreshCache,
722
+ listMode,
723
+ groupId,
724
+ });
725
+ }
726
+ refreshCache;
727
+ listMode;
728
+ groupId;
729
+ serialize(ctx) {
730
+ const isListMode = this.listMode === true;
731
+ const optionByte = (this.refreshCache ? 0b1000_0000 : 0)
732
+ | (isListMode ? 0b0100_0000 : 0);
733
+ this.payload = Bytes.from([
734
+ optionByte,
735
+ isListMode ? 0 : this.groupId,
736
+ ]);
737
+ return super.serialize(ctx);
738
+ }
739
+ toLogEntry(ctx) {
740
+ const message = {};
741
+ if (this.groupId != undefined) {
742
+ message["group id"] = this.groupId;
743
+ }
744
+ if (this.listMode != undefined) {
745
+ message["list mode"] = this.listMode;
746
+ }
747
+ message["refresh cache"] = this.refreshCache;
748
+ return {
749
+ ...super.toLogEntry(ctx),
750
+ message,
751
+ };
752
+ }
753
+ };
754
+ return AssociationGroupInfoCCInfoGet = _classThis;
755
+ })();
658
756
  export { AssociationGroupInfoCCInfoGet };
659
- let AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport_1 = class AssociationGroupInfoCCCommandListReport extends AssociationGroupInfoCC {
660
- constructor(options) {
661
- super(options);
662
- this.groupId = options.groupId;
663
- this.commands = options.commands;
664
- }
665
- static from(raw, ctx) {
666
- validatePayload(raw.payload.length >= 2);
667
- const groupId = raw.payload[0];
668
- const listLength = raw.payload[1];
669
- validatePayload(raw.payload.length >= 2 + listLength);
670
- const listBytes = raw.payload.subarray(2, 2 + listLength);
671
- // Parse all CC ids and commands
672
- let offset = 0;
673
- const commands = new Map();
674
- while (offset < listLength) {
675
- const { ccId, bytesRead } = parseCCId(listBytes, offset);
676
- const command = listBytes[offset + bytesRead];
677
- if (!commands.has(ccId))
678
- commands.set(ccId, []);
679
- commands.get(ccId).push(command);
680
- offset += bytesRead + 1;
681
- }
682
- return new AssociationGroupInfoCCCommandListReport_1({
683
- nodeId: ctx.sourceNodeId,
684
- groupId,
685
- commands,
686
- });
687
- }
688
- groupId;
689
- commands;
690
- serialize(ctx) {
691
- // To make it easier to encode possible extended CCs, we first
692
- // allocate as much space as we may need, then trim it again
693
- this.payload = new Bytes(2 + this.commands.size * 3);
694
- this.payload[0] = this.groupId;
695
- let offset = 2;
696
- for (const [ccId, commands] of this.commands) {
697
- for (const command of commands) {
698
- offset += encodeCCId(ccId, this.payload, offset);
699
- this.payload[offset] = command;
700
- offset++;
757
+ let AssociationGroupInfoCCCommandListReport = (() => {
758
+ let _classDecorators = [CCCommand(AssociationGroupInfoCommand.CommandListReport), ccValueProperty("commands", AssociationGroupInfoCCValues.commands, (self) => [self.groupId])];
759
+ let _classDescriptor;
760
+ let _classExtraInitializers = [];
761
+ let _classThis;
762
+ let _classSuper = AssociationGroupInfoCC;
763
+ var AssociationGroupInfoCCCommandListReport = class extends _classSuper {
764
+ static { _classThis = this; }
765
+ static {
766
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
767
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
768
+ AssociationGroupInfoCCCommandListReport = _classThis = _classDescriptor.value;
769
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
770
+ __runInitializers(_classThis, _classExtraInitializers);
771
+ }
772
+ constructor(options) {
773
+ super(options);
774
+ this.groupId = options.groupId;
775
+ this.commands = options.commands;
776
+ }
777
+ static from(raw, ctx) {
778
+ validatePayload(raw.payload.length >= 2);
779
+ const groupId = raw.payload[0];
780
+ const listLength = raw.payload[1];
781
+ validatePayload(raw.payload.length >= 2 + listLength);
782
+ const listBytes = raw.payload.subarray(2, 2 + listLength);
783
+ // Parse all CC ids and commands
784
+ let offset = 0;
785
+ const commands = new Map();
786
+ while (offset < listLength) {
787
+ const { ccId, bytesRead } = parseCCId(listBytes, offset);
788
+ const command = listBytes[offset + bytesRead];
789
+ if (!commands.has(ccId))
790
+ commands.set(ccId, []);
791
+ commands.get(ccId).push(command);
792
+ offset += bytesRead + 1;
701
793
  }
794
+ return new this({
795
+ nodeId: ctx.sourceNodeId,
796
+ groupId,
797
+ commands,
798
+ });
702
799
  }
703
- this.payload[1] = offset - 2; // list length
704
- return super.serialize(ctx);
705
- }
706
- toLogEntry(ctx) {
707
- return {
708
- ...super.toLogEntry(ctx),
709
- message: {
710
- "group id": this.groupId,
711
- commands: `${[...this.commands]
712
- .map(([cc, cmds]) => {
713
- return `\n· ${getCCName(cc)}: ${cmds
714
- .map((cmd) => num2hex(cmd))
715
- .join(", ")}`;
716
- })
717
- .join("")}`,
718
- },
719
- };
720
- }
721
- };
722
- __decorate([
723
- ccValue(AssociationGroupInfoCCValues.commands, (self) => [self.groupId])
724
- ], AssociationGroupInfoCCCommandListReport.prototype, "commands", void 0);
725
- AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport_1 = __decorate([
726
- CCCommand(AssociationGroupInfoCommand.CommandListReport)
727
- ], AssociationGroupInfoCCCommandListReport);
800
+ groupId;
801
+ commands;
802
+ serialize(ctx) {
803
+ // To make it easier to encode possible extended CCs, we first
804
+ // allocate as much space as we may need, then trim it again
805
+ this.payload = new Bytes(2 + this.commands.size * 3);
806
+ this.payload[0] = this.groupId;
807
+ let offset = 2;
808
+ for (const [ccId, commands] of this.commands) {
809
+ for (const command of commands) {
810
+ offset += encodeCCId(ccId, this.payload, offset);
811
+ this.payload[offset] = command;
812
+ offset++;
813
+ }
814
+ }
815
+ this.payload[1] = offset - 2; // list length
816
+ return super.serialize(ctx);
817
+ }
818
+ toLogEntry(ctx) {
819
+ return {
820
+ ...super.toLogEntry(ctx),
821
+ message: {
822
+ "group id": this.groupId,
823
+ commands: `${[...this.commands]
824
+ .map(([cc, cmds]) => {
825
+ return `\n· ${getCCName(cc)}: ${cmds
826
+ .map((cmd) => num2hex(cmd))
827
+ .join(", ")}`;
828
+ })
829
+ .join("")}`,
830
+ },
831
+ };
832
+ }
833
+ };
834
+ return AssociationGroupInfoCCCommandListReport = _classThis;
835
+ })();
728
836
  export { AssociationGroupInfoCCCommandListReport };
729
- let AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet_1 = class AssociationGroupInfoCCCommandListGet extends AssociationGroupInfoCC {
730
- constructor(options) {
731
- super(options);
732
- this.allowCache = options.allowCache;
733
- this.groupId = options.groupId;
734
- }
735
- static from(raw, ctx) {
736
- validatePayload(raw.payload.length >= 2);
737
- const allowCache = !!(raw.payload[0] & 0b1000_0000);
738
- const groupId = raw.payload[1];
739
- return new AssociationGroupInfoCCCommandListGet_1({
740
- nodeId: ctx.sourceNodeId,
741
- allowCache,
742
- groupId,
743
- });
744
- }
745
- allowCache;
746
- groupId;
747
- serialize(ctx) {
748
- this.payload = Bytes.from([
749
- this.allowCache ? 0b1000_0000 : 0,
750
- this.groupId,
751
- ]);
752
- return super.serialize(ctx);
753
- }
754
- toLogEntry(ctx) {
755
- return {
756
- ...super.toLogEntry(ctx),
757
- message: {
758
- "group id": this.groupId,
759
- "allow cache": this.allowCache,
760
- },
761
- };
762
- }
763
- };
764
- AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet_1 = __decorate([
765
- CCCommand(AssociationGroupInfoCommand.CommandListGet),
766
- expectedCCResponse(AssociationGroupInfoCCCommandListReport)
767
- ], AssociationGroupInfoCCCommandListGet);
837
+ let AssociationGroupInfoCCCommandListGet = (() => {
838
+ let _classDecorators = [CCCommand(AssociationGroupInfoCommand.CommandListGet), expectedCCResponse(AssociationGroupInfoCCCommandListReport)];
839
+ let _classDescriptor;
840
+ let _classExtraInitializers = [];
841
+ let _classThis;
842
+ let _classSuper = AssociationGroupInfoCC;
843
+ var AssociationGroupInfoCCCommandListGet = class extends _classSuper {
844
+ static { _classThis = this; }
845
+ static {
846
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
847
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
848
+ AssociationGroupInfoCCCommandListGet = _classThis = _classDescriptor.value;
849
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
850
+ __runInitializers(_classThis, _classExtraInitializers);
851
+ }
852
+ constructor(options) {
853
+ super(options);
854
+ this.allowCache = options.allowCache;
855
+ this.groupId = options.groupId;
856
+ }
857
+ static from(raw, ctx) {
858
+ validatePayload(raw.payload.length >= 2);
859
+ const allowCache = !!(raw.payload[0] & 0b1000_0000);
860
+ const groupId = raw.payload[1];
861
+ return new this({
862
+ nodeId: ctx.sourceNodeId,
863
+ allowCache,
864
+ groupId,
865
+ });
866
+ }
867
+ allowCache;
868
+ groupId;
869
+ serialize(ctx) {
870
+ this.payload = Bytes.from([
871
+ this.allowCache ? 0b1000_0000 : 0,
872
+ this.groupId,
873
+ ]);
874
+ return super.serialize(ctx);
875
+ }
876
+ toLogEntry(ctx) {
877
+ return {
878
+ ...super.toLogEntry(ctx),
879
+ message: {
880
+ "group id": this.groupId,
881
+ "allow cache": this.allowCache,
882
+ },
883
+ };
884
+ }
885
+ };
886
+ return AssociationGroupInfoCCCommandListGet = _classThis;
887
+ })();
768
888
  export { AssociationGroupInfoCCCommandListGet };
769
889
  //# sourceMappingURL=AssociationGroupInfoCC.js.map