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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -39,13 +39,45 @@ var import_Values = require("../lib/Values.js");
39
39
  var import_Types = require("../lib/_Types.js");
40
40
  var import_AssociationCC = require("./AssociationCC.js");
41
41
  var import_MultiChannelAssociationCC = require("./MultiChannelAssociationCC.js");
42
- var __decorate = function(decorators, target, key, desc) {
43
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
44
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
45
- 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;
46
- return c > 3 && r && Object.defineProperty(target, key, r), r;
42
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
43
+ function accept(f) {
44
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
45
+ return f;
46
+ }
47
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
48
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
49
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
50
+ var _, done = false;
51
+ for (var i = decorators.length - 1; i >= 0; i--) {
52
+ var context = {};
53
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
54
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
55
+ context.addInitializer = function(f) {
56
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
57
+ extraInitializers.push(accept(f || null));
58
+ };
59
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
60
+ if (kind === "accessor") {
61
+ if (result === void 0) continue;
62
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
63
+ if (_ = accept(result.get)) descriptor.get = _;
64
+ if (_ = accept(result.set)) descriptor.set = _;
65
+ if (_ = accept(result.init)) initializers.unshift(_);
66
+ } else if (_ = accept(result)) {
67
+ if (kind === "field") initializers.unshift(_);
68
+ else descriptor[key] = _;
69
+ }
70
+ }
71
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
72
+ done = true;
73
+ };
74
+ var __runInitializers = function(thisArg, initializers, value) {
75
+ var useValue = arguments.length > 2;
76
+ for (var i = 0; i < initializers.length; i++) {
77
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
78
+ }
79
+ return useValue ? value : void 0;
47
80
  };
48
- var AssociationGroupInfoCC_1, AssociationGroupInfoCCNameReport_1, AssociationGroupInfoCCNameGet_1, AssociationGroupInfoCCInfoReport_1, AssociationGroupInfoCCInfoGet_1, AssociationGroupInfoCCCommandListReport_1, AssociationGroupInfoCCCommandListGet_1;
49
81
  function __assertType(argName, typeName, boundHasError) {
50
82
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
51
83
  if (boundHasError()) {
@@ -217,520 +249,629 @@ const AssociationGroupInfoCCValues = Object.freeze({
217
249
  ...import_Values.V.dynamicPropertyAndKeyWithName("commands", "issuedCommands", (groupId) => groupId, ({ property, propertyKey }) => property === "issuedCommands" && typeof propertyKey === "number", void 0, { internal: true })
218
250
  })
219
251
  });
220
- let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI2 extends import_API.PhysicalCCAPI {
221
- supportsCommand(cmd) {
222
- switch (cmd) {
223
- case import_Types.AssociationGroupInfoCommand.NameGet:
224
- case import_Types.AssociationGroupInfoCommand.NameReport:
225
- case import_Types.AssociationGroupInfoCommand.InfoGet:
226
- case import_Types.AssociationGroupInfoCommand.InfoReport:
227
- case import_Types.AssociationGroupInfoCommand.CommandListGet:
228
- case import_Types.AssociationGroupInfoCommand.CommandListReport:
229
- return true;
230
- }
231
- return super.supportsCommand(cmd);
232
- }
233
- async getGroupName(groupId) {
234
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
235
- this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.NameGet);
236
- const cc = new AssociationGroupInfoCCNameGet({
237
- nodeId: this.endpoint.nodeId,
238
- endpointIndex: this.endpoint.index,
239
- groupId
240
- });
241
- const response = await this.host.sendCommand(cc, this.commandOptions);
242
- if (response)
243
- return response.name;
244
- }
245
- async reportGroupName(groupId, name) {
246
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
247
- __assertType("name", "string", __assertType__string.bind(void 0, name));
248
- this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.NameReport);
249
- const cc = new AssociationGroupInfoCCNameReport({
250
- nodeId: this.endpoint.nodeId,
251
- endpointIndex: this.endpoint.index,
252
- groupId,
253
- name
254
- });
255
- await this.host.sendCommand(cc, this.commandOptions);
256
- }
257
- async getGroupInfo(groupId, refreshCache = false) {
258
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
259
- __assertType("refreshCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, refreshCache));
260
- this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.InfoGet);
261
- const cc = new AssociationGroupInfoCCInfoGet({
262
- nodeId: this.endpoint.nodeId,
263
- endpointIndex: this.endpoint.index,
264
- groupId,
265
- refreshCache
266
- });
267
- const response = await this.host.sendCommand(cc, this.commandOptions);
268
- if (response && response.groups.length > 0) {
269
- const { groupId: _, ...info } = response.groups[0];
270
- return {
271
- hasDynamicInfo: response.hasDynamicInfo,
272
- ...info
273
- };
252
+ let AssociationGroupInfoCCAPI = (() => {
253
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Association Group Information"])];
254
+ let _classDescriptor;
255
+ let _classExtraInitializers = [];
256
+ let _classThis;
257
+ let _classSuper = import_API.PhysicalCCAPI;
258
+ var AssociationGroupInfoCCAPI2 = class extends _classSuper {
259
+ static {
260
+ _classThis = this;
274
261
  }
275
- }
276
- async reportGroupInfo(options) {
277
- __assertType("options", "AssociationGroupInfoCCInfoReportOptions", __assertType__AssociationGroupInfoCCInfoReportOptions.bind(void 0, options));
278
- this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.InfoReport);
279
- const cc = new AssociationGroupInfoCCInfoReport({
280
- nodeId: this.endpoint.nodeId,
281
- endpointIndex: this.endpoint.index,
282
- ...options
283
- });
284
- await this.host.sendCommand(cc, this.commandOptions);
285
- }
286
- async getCommands(groupId, allowCache = true) {
287
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
288
- __assertType("allowCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, allowCache));
289
- this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.CommandListGet);
290
- const cc = new AssociationGroupInfoCCCommandListGet({
291
- nodeId: this.endpoint.nodeId,
292
- endpointIndex: this.endpoint.index,
293
- groupId,
294
- allowCache
295
- });
296
- const response = await this.host.sendCommand(cc, this.commandOptions);
297
- if (response)
298
- return response.commands;
299
- }
300
- async reportCommands(groupId, commands) {
301
- __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
302
- __assertType("commands", void 0, __assertType___0_1_2.bind(void 0, commands));
303
- this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.CommandListReport);
304
- const cc = new AssociationGroupInfoCCCommandListReport({
305
- nodeId: this.endpoint.nodeId,
306
- endpointIndex: this.endpoint.index,
307
- groupId,
308
- commands
309
- });
310
- await this.host.sendCommand(cc, this.commandOptions);
311
- }
312
- };
313
- AssociationGroupInfoCCAPI = __decorate([
314
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Association Group Information"])
315
- ], AssociationGroupInfoCCAPI);
316
- let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupInfoCC2 extends import_CommandClass.CommandClass {
317
- determineRequiredCCInterviews() {
318
- return [
319
- ...super.determineRequiredCCInterviews(),
320
- import_safe.CommandClasses.Association,
321
- import_safe.CommandClasses["Multi Channel Association"]
322
- ];
323
- }
324
- /** Returns the name of an association group */
325
- static getGroupNameCached(ctx, endpoint, groupId) {
326
- return ctx.getValueDB(endpoint.nodeId).getValue(AssociationGroupInfoCCValues.groupName(groupId).endpoint(endpoint.index));
327
- }
328
- /** Returns the association profile for an association group */
329
- static getGroupProfileCached(ctx, endpoint, groupId) {
330
- return ctx.getValueDB(endpoint.nodeId).getValue(AssociationGroupInfoCCValues.groupInfo(groupId).endpoint(endpoint.index))?.profile;
331
- }
332
- /** Returns the dictionary of all commands issued by the given association group */
333
- static getIssuedCommandsCached(ctx, endpoint, groupId) {
334
- return ctx.getValueDB(endpoint.nodeId).getValue(AssociationGroupInfoCCValues.commands(groupId).endpoint(endpoint.index));
335
- }
336
- static findGroupsForIssuedCommand(ctx, endpoint, ccId, command) {
337
- const ret = [];
338
- const associationGroupCount = this.getAssociationGroupCountCached(ctx, endpoint);
339
- for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
340
- const issuedCommands = this.getIssuedCommandsCached(ctx, endpoint, groupId);
341
- if (!issuedCommands)
342
- continue;
343
- if (issuedCommands.has(ccId) && issuedCommands.get(ccId).includes(command)) {
344
- ret.push(groupId);
345
- continue;
262
+ static {
263
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
264
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
265
+ AssociationGroupInfoCCAPI2 = _classThis = _classDescriptor.value;
266
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
267
+ __runInitializers(_classThis, _classExtraInitializers);
268
+ }
269
+ supportsCommand(cmd) {
270
+ switch (cmd) {
271
+ case import_Types.AssociationGroupInfoCommand.NameGet:
272
+ case import_Types.AssociationGroupInfoCommand.NameReport:
273
+ case import_Types.AssociationGroupInfoCommand.InfoGet:
274
+ case import_Types.AssociationGroupInfoCommand.InfoReport:
275
+ case import_Types.AssociationGroupInfoCommand.CommandListGet:
276
+ case import_Types.AssociationGroupInfoCommand.CommandListReport:
277
+ return true;
346
278
  }
279
+ return super.supportsCommand(cmd);
347
280
  }
348
- return ret;
349
- }
350
- static getAssociationGroupCountCached(ctx, endpoint) {
351
- return (
352
- // First query the Multi Channel Association CC
353
- // And fall back to 0
354
- endpoint.supportsCC(import_safe.CommandClasses["Multi Channel Association"]) && import_MultiChannelAssociationCC.MultiChannelAssociationCC.getGroupCountCached(ctx, endpoint) || endpoint.supportsCC(import_safe.CommandClasses.Association) && import_AssociationCC.AssociationCC.getGroupCountCached(ctx, endpoint) || 0
355
- );
356
- }
357
- async interview(ctx) {
358
- const node = this.getNode(ctx);
359
- const endpoint = this.getEndpoint(ctx);
360
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: import_safe.MessagePriority.NodeQuery });
361
- ctx.logNode(node.id, {
362
- endpoint: this.endpointIndex,
363
- message: `Interviewing ${this.ccName}...`,
364
- direction: "none"
365
- });
366
- const associationGroupCount = AssociationGroupInfoCC_1.getAssociationGroupCountCached(ctx, endpoint);
367
- for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
281
+ async getGroupName(groupId) {
282
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
283
+ this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.NameGet);
284
+ const cc = new AssociationGroupInfoCCNameGet({
285
+ nodeId: this.endpoint.nodeId,
286
+ endpointIndex: this.endpoint.index,
287
+ groupId
288
+ });
289
+ const response = await this.host.sendCommand(cc, this.commandOptions);
290
+ if (response)
291
+ return response.name;
292
+ }
293
+ async reportGroupName(groupId, name) {
294
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
295
+ __assertType("name", "string", __assertType__string.bind(void 0, name));
296
+ this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.NameReport);
297
+ const cc = new AssociationGroupInfoCCNameReport({
298
+ nodeId: this.endpoint.nodeId,
299
+ endpointIndex: this.endpoint.index,
300
+ groupId,
301
+ name
302
+ });
303
+ await this.host.sendCommand(cc, this.commandOptions);
304
+ }
305
+ async getGroupInfo(groupId, refreshCache = false) {
306
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
307
+ __assertType("refreshCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, refreshCache));
308
+ this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.InfoGet);
309
+ const cc = new AssociationGroupInfoCCInfoGet({
310
+ nodeId: this.endpoint.nodeId,
311
+ endpointIndex: this.endpoint.index,
312
+ groupId,
313
+ refreshCache
314
+ });
315
+ const response = await this.host.sendCommand(cc, this.commandOptions);
316
+ if (response && response.groups.length > 0) {
317
+ const { groupId: _, ...info } = response.groups[0];
318
+ return {
319
+ hasDynamicInfo: response.hasDynamicInfo,
320
+ ...info
321
+ };
322
+ }
323
+ }
324
+ async reportGroupInfo(options) {
325
+ __assertType("options", "AssociationGroupInfoCCInfoReportOptions", __assertType__AssociationGroupInfoCCInfoReportOptions.bind(void 0, options));
326
+ this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.InfoReport);
327
+ const cc = new AssociationGroupInfoCCInfoReport({
328
+ nodeId: this.endpoint.nodeId,
329
+ endpointIndex: this.endpoint.index,
330
+ ...options
331
+ });
332
+ await this.host.sendCommand(cc, this.commandOptions);
333
+ }
334
+ async getCommands(groupId, allowCache = true) {
335
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
336
+ __assertType("allowCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, allowCache));
337
+ this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.CommandListGet);
338
+ const cc = new AssociationGroupInfoCCCommandListGet({
339
+ nodeId: this.endpoint.nodeId,
340
+ endpointIndex: this.endpoint.index,
341
+ groupId,
342
+ allowCache
343
+ });
344
+ const response = await this.host.sendCommand(cc, this.commandOptions);
345
+ if (response)
346
+ return response.commands;
347
+ }
348
+ async reportCommands(groupId, commands) {
349
+ __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
350
+ __assertType("commands", void 0, __assertType___0_1_2.bind(void 0, commands));
351
+ this.assertSupportsCommand(import_Types.AssociationGroupInfoCommand, import_Types.AssociationGroupInfoCommand.CommandListReport);
352
+ const cc = new AssociationGroupInfoCCCommandListReport({
353
+ nodeId: this.endpoint.nodeId,
354
+ endpointIndex: this.endpoint.index,
355
+ groupId,
356
+ commands
357
+ });
358
+ await this.host.sendCommand(cc, this.commandOptions);
359
+ }
360
+ };
361
+ return AssociationGroupInfoCCAPI2 = _classThis;
362
+ })();
363
+ let AssociationGroupInfoCC = (() => {
364
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Association Group Information"]), (0, import_CommandClassDecorators.implementedVersion)(3), (0, import_CommandClassDecorators.ccValues)(AssociationGroupInfoCCValues)];
365
+ let _classDescriptor;
366
+ let _classExtraInitializers = [];
367
+ let _classThis;
368
+ let _classSuper = import_CommandClass.CommandClass;
369
+ var AssociationGroupInfoCC2 = class extends _classSuper {
370
+ static {
371
+ _classThis = this;
372
+ }
373
+ static {
374
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
375
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
376
+ AssociationGroupInfoCC2 = _classThis = _classDescriptor.value;
377
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
378
+ __runInitializers(_classThis, _classExtraInitializers);
379
+ }
380
+ determineRequiredCCInterviews() {
381
+ return [
382
+ ...super.determineRequiredCCInterviews(),
383
+ import_safe.CommandClasses.Association,
384
+ import_safe.CommandClasses["Multi Channel Association"]
385
+ ];
386
+ }
387
+ /** Returns the name of an association group */
388
+ static getGroupNameCached(ctx, endpoint, groupId) {
389
+ return ctx.getValueDB(endpoint.nodeId).getValue(AssociationGroupInfoCCValues.groupName(groupId).endpoint(endpoint.index));
390
+ }
391
+ /** Returns the association profile for an association group */
392
+ static getGroupProfileCached(ctx, endpoint, groupId) {
393
+ return ctx.getValueDB(endpoint.nodeId).getValue(AssociationGroupInfoCCValues.groupInfo(groupId).endpoint(endpoint.index))?.profile;
394
+ }
395
+ /** Returns the dictionary of all commands issued by the given association group */
396
+ static getIssuedCommandsCached(ctx, endpoint, groupId) {
397
+ return ctx.getValueDB(endpoint.nodeId).getValue(AssociationGroupInfoCCValues.commands(groupId).endpoint(endpoint.index));
398
+ }
399
+ static findGroupsForIssuedCommand(ctx, endpoint, ccId, command) {
400
+ const ret = [];
401
+ const associationGroupCount = this.getAssociationGroupCountCached(ctx, endpoint);
402
+ for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
403
+ const issuedCommands = this.getIssuedCommandsCached(ctx, endpoint, groupId);
404
+ if (!issuedCommands)
405
+ continue;
406
+ if (issuedCommands.has(ccId) && issuedCommands.get(ccId).includes(command)) {
407
+ ret.push(groupId);
408
+ continue;
409
+ }
410
+ }
411
+ return ret;
412
+ }
413
+ static getAssociationGroupCountCached(ctx, endpoint) {
414
+ return (
415
+ // First query the Multi Channel Association CC
416
+ // And fall back to 0
417
+ endpoint.supportsCC(import_safe.CommandClasses["Multi Channel Association"]) && import_MultiChannelAssociationCC.MultiChannelAssociationCC.getGroupCountCached(ctx, endpoint) || endpoint.supportsCC(import_safe.CommandClasses.Association) && import_AssociationCC.AssociationCC.getGroupCountCached(ctx, endpoint) || 0
418
+ );
419
+ }
420
+ async interview(ctx) {
421
+ const node = this.getNode(ctx);
422
+ const endpoint = this.getEndpoint(ctx);
423
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: import_safe.MessagePriority.NodeQuery });
368
424
  ctx.logNode(node.id, {
369
425
  endpoint: this.endpointIndex,
370
- message: `Association group #${groupId}: Querying name...`,
371
- direction: "outbound"
426
+ message: `Interviewing ${this.ccName}...`,
427
+ direction: "none"
372
428
  });
373
- const name = await api.getGroupName(groupId);
374
- if (name) {
375
- const logMessage = `Association group #${groupId} has name "${name}"`;
429
+ const associationGroupCount = AssociationGroupInfoCC2.getAssociationGroupCountCached(ctx, endpoint);
430
+ for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
431
+ ctx.logNode(node.id, {
432
+ endpoint: this.endpointIndex,
433
+ message: `Association group #${groupId}: Querying name...`,
434
+ direction: "outbound"
435
+ });
436
+ const name = await api.getGroupName(groupId);
437
+ if (name) {
438
+ const logMessage = `Association group #${groupId} has name "${name}"`;
439
+ ctx.logNode(node.id, {
440
+ endpoint: this.endpointIndex,
441
+ message: logMessage,
442
+ direction: "inbound"
443
+ });
444
+ }
376
445
  ctx.logNode(node.id, {
377
446
  endpoint: this.endpointIndex,
378
- message: logMessage,
379
- direction: "inbound"
447
+ message: `Association group #${groupId}: Querying command list...`,
448
+ direction: "outbound"
380
449
  });
450
+ await api.getCommands(groupId);
381
451
  }
382
- ctx.logNode(node.id, {
383
- endpoint: this.endpointIndex,
384
- message: `Association group #${groupId}: Querying command list...`,
385
- direction: "outbound"
386
- });
387
- await api.getCommands(groupId);
452
+ await this.refreshValues(ctx);
453
+ this.setInterviewComplete(ctx, true);
388
454
  }
389
- await this.refreshValues(ctx);
390
- this.setInterviewComplete(ctx, true);
391
- }
392
- async refreshValues(ctx) {
393
- const node = this.getNode(ctx);
394
- const endpoint = this.getEndpoint(ctx);
395
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: import_safe.MessagePriority.NodeQuery });
396
- const associationGroupCount = AssociationGroupInfoCC_1.getAssociationGroupCountCached(ctx, endpoint);
397
- const hasDynamicInfo = this.getValue(ctx, AssociationGroupInfoCCValues.hasDynamicInfo);
398
- for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
399
- ctx.logNode(node.id, {
400
- endpoint: this.endpointIndex,
401
- message: `Association group #${groupId}: Querying info...`,
402
- direction: "outbound"
403
- });
404
- const info = await api.getGroupInfo(groupId, !!hasDynamicInfo);
405
- if (info) {
406
- const logMessage = `Received info for association group #${groupId}:
407
- info is dynamic: ${info.hasDynamicInfo}
408
- profile: ${(0, import_safe3.getEnumMemberName)(import_Types.AssociationGroupInfoProfile, info.profile)}`;
455
+ async refreshValues(ctx) {
456
+ const node = this.getNode(ctx);
457
+ const endpoint = this.getEndpoint(ctx);
458
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: import_safe.MessagePriority.NodeQuery });
459
+ const associationGroupCount = AssociationGroupInfoCC2.getAssociationGroupCountCached(ctx, endpoint);
460
+ const hasDynamicInfo = this.getValue(ctx, AssociationGroupInfoCCValues.hasDynamicInfo);
461
+ for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
409
462
  ctx.logNode(node.id, {
410
463
  endpoint: this.endpointIndex,
411
- message: logMessage,
412
- direction: "inbound"
464
+ message: `Association group #${groupId}: Querying info...`,
465
+ direction: "outbound"
413
466
  });
467
+ const info = await api.getGroupInfo(groupId, !!hasDynamicInfo);
468
+ if (info) {
469
+ const logMessage = `Received info for association group #${groupId}:
470
+ info is dynamic: ${info.hasDynamicInfo}
471
+ profile: ${(0, import_safe3.getEnumMemberName)(import_Types.AssociationGroupInfoProfile, info.profile)}`;
472
+ ctx.logNode(node.id, {
473
+ endpoint: this.endpointIndex,
474
+ message: logMessage,
475
+ direction: "inbound"
476
+ });
477
+ }
414
478
  }
415
479
  }
416
- }
417
- };
418
- AssociationGroupInfoCC = AssociationGroupInfoCC_1 = __decorate([
419
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Association Group Information"]),
420
- (0, import_CommandClassDecorators.implementedVersion)(3),
421
- (0, import_CommandClassDecorators.ccValues)(AssociationGroupInfoCCValues)
422
- ], AssociationGroupInfoCC);
423
- let AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport_1 = class AssociationGroupInfoCCNameReport2 extends AssociationGroupInfoCC {
424
- constructor(options) {
425
- super(options);
426
- this.groupId = options.groupId;
427
- this.name = options.name;
428
- }
429
- static from(raw, ctx) {
430
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
431
- const groupId = raw.payload[0];
432
- const nameLength = raw.payload[1];
433
- (0, import_safe.validatePayload)(raw.payload.length >= 2 + nameLength);
434
- const name = (0, import_safe3.cpp2js)(raw.payload.subarray(2, 2 + nameLength).toString("utf8"));
435
- return new AssociationGroupInfoCCNameReport_1({
436
- nodeId: ctx.sourceNodeId,
437
- groupId,
438
- name
439
- });
440
- }
441
- groupId;
442
- name;
443
- persistValues(ctx) {
444
- if (!super.persistValues(ctx))
445
- return false;
446
- const valueDB = this.getValueDB(ctx);
447
- valueDB.setValue(AssociationGroupInfoCCValues.groupName(this.groupId).endpoint(this.endpointIndex), this.name);
448
- return true;
449
- }
450
- serialize(ctx) {
451
- this.payload = import_safe2.Bytes.concat([
452
- import_safe2.Bytes.from([this.groupId, this.name.length]),
453
- import_safe2.Bytes.from(this.name, "utf8")
454
- ]);
455
- return super.serialize(ctx);
456
- }
457
- toLogEntry(ctx) {
458
- return {
459
- ...super.toLogEntry(ctx),
460
- message: {
461
- "group id": this.groupId,
462
- name: this.name
480
+ };
481
+ return AssociationGroupInfoCC2 = _classThis;
482
+ })();
483
+ let AssociationGroupInfoCCNameReport = (() => {
484
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.NameReport)];
485
+ let _classDescriptor;
486
+ let _classExtraInitializers = [];
487
+ let _classThis;
488
+ let _classSuper = AssociationGroupInfoCC;
489
+ var AssociationGroupInfoCCNameReport2 = class extends _classSuper {
490
+ static {
491
+ _classThis = this;
492
+ }
493
+ static {
494
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
495
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
496
+ AssociationGroupInfoCCNameReport2 = _classThis = _classDescriptor.value;
497
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
498
+ __runInitializers(_classThis, _classExtraInitializers);
499
+ }
500
+ constructor(options) {
501
+ super(options);
502
+ this.groupId = options.groupId;
503
+ this.name = options.name;
504
+ }
505
+ static from(raw, ctx) {
506
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
507
+ const groupId = raw.payload[0];
508
+ const nameLength = raw.payload[1];
509
+ (0, import_safe.validatePayload)(raw.payload.length >= 2 + nameLength);
510
+ const name = (0, import_safe3.cpp2js)(raw.payload.subarray(2, 2 + nameLength).toString("utf8"));
511
+ return new this({
512
+ nodeId: ctx.sourceNodeId,
513
+ groupId,
514
+ name
515
+ });
516
+ }
517
+ groupId;
518
+ name;
519
+ persistValues(ctx) {
520
+ if (!super.persistValues(ctx))
521
+ return false;
522
+ const valueDB = this.getValueDB(ctx);
523
+ valueDB.setValue(AssociationGroupInfoCCValues.groupName(this.groupId).endpoint(this.endpointIndex), this.name);
524
+ return true;
525
+ }
526
+ serialize(ctx) {
527
+ this.payload = import_safe2.Bytes.concat([
528
+ import_safe2.Bytes.from([this.groupId, this.name.length]),
529
+ import_safe2.Bytes.from(this.name, "utf8")
530
+ ]);
531
+ return super.serialize(ctx);
532
+ }
533
+ toLogEntry(ctx) {
534
+ return {
535
+ ...super.toLogEntry(ctx),
536
+ message: {
537
+ "group id": this.groupId,
538
+ name: this.name
539
+ }
540
+ };
541
+ }
542
+ };
543
+ return AssociationGroupInfoCCNameReport2 = _classThis;
544
+ })();
545
+ let AssociationGroupInfoCCNameGet = (() => {
546
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.NameGet), (0, import_CommandClassDecorators.expectedCCResponse)(AssociationGroupInfoCCNameReport)];
547
+ let _classDescriptor;
548
+ let _classExtraInitializers = [];
549
+ let _classThis;
550
+ let _classSuper = AssociationGroupInfoCC;
551
+ var AssociationGroupInfoCCNameGet2 = class extends _classSuper {
552
+ static {
553
+ _classThis = this;
554
+ }
555
+ static {
556
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
557
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
558
+ AssociationGroupInfoCCNameGet2 = _classThis = _classDescriptor.value;
559
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
560
+ __runInitializers(_classThis, _classExtraInitializers);
561
+ }
562
+ constructor(options) {
563
+ super(options);
564
+ this.groupId = options.groupId;
565
+ }
566
+ static from(raw, ctx) {
567
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
568
+ const groupId = raw.payload[0];
569
+ return new this({
570
+ nodeId: ctx.sourceNodeId,
571
+ groupId
572
+ });
573
+ }
574
+ groupId;
575
+ serialize(ctx) {
576
+ this.payload = import_safe2.Bytes.from([this.groupId]);
577
+ return super.serialize(ctx);
578
+ }
579
+ toLogEntry(ctx) {
580
+ return {
581
+ ...super.toLogEntry(ctx),
582
+ message: { "group id": this.groupId }
583
+ };
584
+ }
585
+ };
586
+ return AssociationGroupInfoCCNameGet2 = _classThis;
587
+ })();
588
+ let AssociationGroupInfoCCInfoReport = (() => {
589
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.InfoReport), (0, import_CommandClassDecorators.ccValueProperty)("hasDynamicInfo", AssociationGroupInfoCCValues.hasDynamicInfo)];
590
+ let _classDescriptor;
591
+ let _classExtraInitializers = [];
592
+ let _classThis;
593
+ let _classSuper = AssociationGroupInfoCC;
594
+ var AssociationGroupInfoCCInfoReport2 = class extends _classSuper {
595
+ static {
596
+ _classThis = this;
597
+ }
598
+ static {
599
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
600
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
601
+ AssociationGroupInfoCCInfoReport2 = _classThis = _classDescriptor.value;
602
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
603
+ __runInitializers(_classThis, _classExtraInitializers);
604
+ }
605
+ constructor(options) {
606
+ super(options);
607
+ this.isListMode = options.isListMode;
608
+ this.hasDynamicInfo = options.hasDynamicInfo;
609
+ this.groups = options.groups;
610
+ }
611
+ static from(raw, ctx) {
612
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
613
+ const isListMode = !!(raw.payload[0] & 128);
614
+ const hasDynamicInfo = !!(raw.payload[0] & 64);
615
+ const groupCount = raw.payload[0] & 63;
616
+ (0, import_safe.validatePayload)(raw.payload.length >= 1 + groupCount * 7);
617
+ const groups = [];
618
+ for (let i = 0; i < groupCount; i++) {
619
+ const offset = 1 + i * 7;
620
+ const groupBytes = raw.payload.subarray(offset, offset + 7);
621
+ const groupId = groupBytes[0];
622
+ const mode = 0;
623
+ const profile = groupBytes.readUInt16BE(2);
624
+ const eventCode = 0;
625
+ groups.push({ groupId, mode, profile, eventCode });
463
626
  }
464
- };
465
- }
466
- };
467
- AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport_1 = __decorate([
468
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.NameReport)
469
- ], AssociationGroupInfoCCNameReport);
470
- let AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet_1 = class AssociationGroupInfoCCNameGet2 extends AssociationGroupInfoCC {
471
- constructor(options) {
472
- super(options);
473
- this.groupId = options.groupId;
474
- }
475
- static from(raw, ctx) {
476
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
477
- const groupId = raw.payload[0];
478
- return new AssociationGroupInfoCCNameGet_1({
479
- nodeId: ctx.sourceNodeId,
480
- groupId
481
- });
482
- }
483
- groupId;
484
- serialize(ctx) {
485
- this.payload = import_safe2.Bytes.from([this.groupId]);
486
- return super.serialize(ctx);
487
- }
488
- toLogEntry(ctx) {
489
- return {
490
- ...super.toLogEntry(ctx),
491
- message: { "group id": this.groupId }
492
- };
493
- }
494
- };
495
- AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet_1 = __decorate([
496
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.NameGet),
497
- (0, import_CommandClassDecorators.expectedCCResponse)(AssociationGroupInfoCCNameReport)
498
- ], AssociationGroupInfoCCNameGet);
499
- let AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport_1 = class AssociationGroupInfoCCInfoReport2 extends AssociationGroupInfoCC {
500
- constructor(options) {
501
- super(options);
502
- this.isListMode = options.isListMode;
503
- this.hasDynamicInfo = options.hasDynamicInfo;
504
- this.groups = options.groups;
505
- }
506
- static from(raw, ctx) {
507
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
508
- const isListMode = !!(raw.payload[0] & 128);
509
- const hasDynamicInfo = !!(raw.payload[0] & 64);
510
- const groupCount = raw.payload[0] & 63;
511
- (0, import_safe.validatePayload)(raw.payload.length >= 1 + groupCount * 7);
512
- const groups = [];
513
- for (let i = 0; i < groupCount; i++) {
514
- const offset = 1 + i * 7;
515
- const groupBytes = raw.payload.subarray(offset, offset + 7);
516
- const groupId = groupBytes[0];
517
- const mode = 0;
518
- const profile = groupBytes.readUInt16BE(2);
519
- const eventCode = 0;
520
- groups.push({ groupId, mode, profile, eventCode });
521
- }
522
- return new AssociationGroupInfoCCInfoReport_1({
523
- nodeId: ctx.sourceNodeId,
524
- isListMode,
525
- hasDynamicInfo,
526
- groups
527
- });
528
- }
529
- isListMode;
530
- hasDynamicInfo;
531
- groups;
532
- persistValues(ctx) {
533
- if (!super.persistValues(ctx))
534
- return false;
535
- for (const group of this.groups) {
536
- const { groupId, mode, profile, eventCode } = group;
537
- this.setValue(ctx, AssociationGroupInfoCCValues.groupInfo(groupId), {
538
- mode,
539
- profile,
540
- eventCode
627
+ return new this({
628
+ nodeId: ctx.sourceNodeId,
629
+ isListMode,
630
+ hasDynamicInfo,
631
+ groups
541
632
  });
542
633
  }
543
- return true;
544
- }
545
- serialize(ctx) {
546
- this.payload = import_safe2.Bytes.alloc(1 + this.groups.length * 7, 0);
547
- this.payload[0] = (this.isListMode ? 128 : 0) | (this.hasDynamicInfo ? 64 : 0) | this.groups.length & 63;
548
- for (let i = 0; i < this.groups.length; i++) {
549
- const offset = 1 + i * 7;
550
- this.payload[offset] = this.groups[i].groupId;
551
- this.payload.writeUInt16BE(this.groups[i].profile, offset + 2);
552
- }
553
- return super.serialize(ctx);
554
- }
555
- toLogEntry(ctx) {
556
- return {
557
- ...super.toLogEntry(ctx),
558
- message: {
559
- "is list mode": this.isListMode,
560
- "has dynamic info": this.hasDynamicInfo,
561
- groups: `${this.groups.map((g) => `
634
+ isListMode;
635
+ hasDynamicInfo;
636
+ groups;
637
+ persistValues(ctx) {
638
+ if (!super.persistValues(ctx))
639
+ return false;
640
+ for (const group of this.groups) {
641
+ const { groupId, mode, profile, eventCode } = group;
642
+ this.setValue(ctx, AssociationGroupInfoCCValues.groupInfo(groupId), {
643
+ mode,
644
+ profile,
645
+ eventCode
646
+ });
647
+ }
648
+ return true;
649
+ }
650
+ serialize(ctx) {
651
+ this.payload = import_safe2.Bytes.alloc(1 + this.groups.length * 7, 0);
652
+ this.payload[0] = (this.isListMode ? 128 : 0) | (this.hasDynamicInfo ? 64 : 0) | this.groups.length & 63;
653
+ for (let i = 0; i < this.groups.length; i++) {
654
+ const offset = 1 + i * 7;
655
+ this.payload[offset] = this.groups[i].groupId;
656
+ this.payload.writeUInt16BE(this.groups[i].profile, offset + 2);
657
+ }
658
+ return super.serialize(ctx);
659
+ }
660
+ toLogEntry(ctx) {
661
+ return {
662
+ ...super.toLogEntry(ctx),
663
+ message: {
664
+ "is list mode": this.isListMode,
665
+ "has dynamic info": this.hasDynamicInfo,
666
+ groups: `${this.groups.map((g) => `
562
667
  \xB7 Group #${g.groupId}
563
668
  mode: ${g.mode}
564
669
  profile: ${g.profile}
565
670
  event code: ${g.eventCode}`).join("")}`
671
+ }
672
+ };
673
+ }
674
+ };
675
+ return AssociationGroupInfoCCInfoReport2 = _classThis;
676
+ })();
677
+ let AssociationGroupInfoCCInfoGet = (() => {
678
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.InfoGet), (0, import_CommandClassDecorators.expectedCCResponse)(AssociationGroupInfoCCInfoReport)];
679
+ let _classDescriptor;
680
+ let _classExtraInitializers = [];
681
+ let _classThis;
682
+ let _classSuper = AssociationGroupInfoCC;
683
+ var AssociationGroupInfoCCInfoGet2 = class extends _classSuper {
684
+ static {
685
+ _classThis = this;
686
+ }
687
+ static {
688
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
689
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
690
+ AssociationGroupInfoCCInfoGet2 = _classThis = _classDescriptor.value;
691
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
692
+ __runInitializers(_classThis, _classExtraInitializers);
693
+ }
694
+ constructor(options) {
695
+ super(options);
696
+ this.refreshCache = options.refreshCache;
697
+ if ("listMode" in options)
698
+ this.listMode = options.listMode;
699
+ if ("groupId" in options)
700
+ this.groupId = options.groupId;
701
+ }
702
+ static from(raw, ctx) {
703
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
704
+ const optionByte = raw.payload[0];
705
+ const refreshCache = !!(optionByte & 128);
706
+ const listMode = !!(optionByte & 64);
707
+ let groupId;
708
+ if (!listMode) {
709
+ groupId = raw.payload[1];
566
710
  }
567
- };
568
- }
569
- };
570
- __decorate([
571
- (0, import_CommandClassDecorators.ccValue)(AssociationGroupInfoCCValues.hasDynamicInfo)
572
- ], AssociationGroupInfoCCInfoReport.prototype, "hasDynamicInfo", void 0);
573
- AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport_1 = __decorate([
574
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.InfoReport)
575
- ], AssociationGroupInfoCCInfoReport);
576
- let AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet_1 = class AssociationGroupInfoCCInfoGet2 extends AssociationGroupInfoCC {
577
- constructor(options) {
578
- super(options);
579
- this.refreshCache = options.refreshCache;
580
- if ("listMode" in options)
581
- this.listMode = options.listMode;
582
- if ("groupId" in options)
583
- this.groupId = options.groupId;
584
- }
585
- static from(raw, ctx) {
586
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
587
- const optionByte = raw.payload[0];
588
- const refreshCache = !!(optionByte & 128);
589
- const listMode = !!(optionByte & 64);
590
- let groupId;
591
- if (!listMode) {
592
- groupId = raw.payload[1];
593
- }
594
- return new AssociationGroupInfoCCInfoGet_1({
595
- nodeId: ctx.sourceNodeId,
596
- refreshCache,
597
- listMode,
598
- groupId
599
- });
600
- }
601
- refreshCache;
602
- listMode;
603
- groupId;
604
- serialize(ctx) {
605
- const isListMode = this.listMode === true;
606
- const optionByte = (this.refreshCache ? 128 : 0) | (isListMode ? 64 : 0);
607
- this.payload = import_safe2.Bytes.from([
608
- optionByte,
609
- isListMode ? 0 : this.groupId
610
- ]);
611
- return super.serialize(ctx);
612
- }
613
- toLogEntry(ctx) {
614
- const message = {};
615
- if (this.groupId != void 0) {
616
- message["group id"] = this.groupId;
617
- }
618
- if (this.listMode != void 0) {
619
- message["list mode"] = this.listMode;
620
- }
621
- message["refresh cache"] = this.refreshCache;
622
- return {
623
- ...super.toLogEntry(ctx),
624
- message
625
- };
626
- }
627
- };
628
- AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet_1 = __decorate([
629
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.InfoGet),
630
- (0, import_CommandClassDecorators.expectedCCResponse)(AssociationGroupInfoCCInfoReport)
631
- ], AssociationGroupInfoCCInfoGet);
632
- let AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport_1 = class AssociationGroupInfoCCCommandListReport2 extends AssociationGroupInfoCC {
633
- constructor(options) {
634
- super(options);
635
- this.groupId = options.groupId;
636
- this.commands = options.commands;
637
- }
638
- static from(raw, ctx) {
639
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
640
- const groupId = raw.payload[0];
641
- const listLength = raw.payload[1];
642
- (0, import_safe.validatePayload)(raw.payload.length >= 2 + listLength);
643
- const listBytes = raw.payload.subarray(2, 2 + listLength);
644
- let offset = 0;
645
- const commands = /* @__PURE__ */ new Map();
646
- while (offset < listLength) {
647
- const { ccId, bytesRead } = (0, import_safe.parseCCId)(listBytes, offset);
648
- const command = listBytes[offset + bytesRead];
649
- if (!commands.has(ccId))
650
- commands.set(ccId, []);
651
- commands.get(ccId).push(command);
652
- offset += bytesRead + 1;
653
- }
654
- return new AssociationGroupInfoCCCommandListReport_1({
655
- nodeId: ctx.sourceNodeId,
656
- groupId,
657
- commands
658
- });
659
- }
660
- groupId;
661
- commands;
662
- serialize(ctx) {
663
- this.payload = new import_safe2.Bytes(2 + this.commands.size * 3);
664
- this.payload[0] = this.groupId;
665
- let offset = 2;
666
- for (const [ccId, commands] of this.commands) {
667
- for (const command of commands) {
668
- offset += (0, import_safe.encodeCCId)(ccId, this.payload, offset);
669
- this.payload[offset] = command;
670
- offset++;
711
+ return new this({
712
+ nodeId: ctx.sourceNodeId,
713
+ refreshCache,
714
+ listMode,
715
+ groupId
716
+ });
717
+ }
718
+ refreshCache;
719
+ listMode;
720
+ groupId;
721
+ serialize(ctx) {
722
+ const isListMode = this.listMode === true;
723
+ const optionByte = (this.refreshCache ? 128 : 0) | (isListMode ? 64 : 0);
724
+ this.payload = import_safe2.Bytes.from([
725
+ optionByte,
726
+ isListMode ? 0 : this.groupId
727
+ ]);
728
+ return super.serialize(ctx);
729
+ }
730
+ toLogEntry(ctx) {
731
+ const message = {};
732
+ if (this.groupId != void 0) {
733
+ message["group id"] = this.groupId;
671
734
  }
735
+ if (this.listMode != void 0) {
736
+ message["list mode"] = this.listMode;
737
+ }
738
+ message["refresh cache"] = this.refreshCache;
739
+ return {
740
+ ...super.toLogEntry(ctx),
741
+ message
742
+ };
672
743
  }
673
- this.payload[1] = offset - 2;
674
- return super.serialize(ctx);
675
- }
676
- toLogEntry(ctx) {
677
- return {
678
- ...super.toLogEntry(ctx),
679
- message: {
680
- "group id": this.groupId,
681
- commands: `${[...this.commands].map(([cc, cmds]) => {
682
- return `
683
- \xB7 ${(0, import_safe.getCCName)(cc)}: ${cmds.map((cmd) => (0, import_safe3.num2hex)(cmd)).join(", ")}`;
684
- }).join("")}`
744
+ };
745
+ return AssociationGroupInfoCCInfoGet2 = _classThis;
746
+ })();
747
+ let AssociationGroupInfoCCCommandListReport = (() => {
748
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.CommandListReport), (0, import_CommandClassDecorators.ccValueProperty)("commands", AssociationGroupInfoCCValues.commands, (self) => [self.groupId])];
749
+ let _classDescriptor;
750
+ let _classExtraInitializers = [];
751
+ let _classThis;
752
+ let _classSuper = AssociationGroupInfoCC;
753
+ var AssociationGroupInfoCCCommandListReport2 = class extends _classSuper {
754
+ static {
755
+ _classThis = this;
756
+ }
757
+ static {
758
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
759
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
760
+ AssociationGroupInfoCCCommandListReport2 = _classThis = _classDescriptor.value;
761
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
762
+ __runInitializers(_classThis, _classExtraInitializers);
763
+ }
764
+ constructor(options) {
765
+ super(options);
766
+ this.groupId = options.groupId;
767
+ this.commands = options.commands;
768
+ }
769
+ static from(raw, ctx) {
770
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
771
+ const groupId = raw.payload[0];
772
+ const listLength = raw.payload[1];
773
+ (0, import_safe.validatePayload)(raw.payload.length >= 2 + listLength);
774
+ const listBytes = raw.payload.subarray(2, 2 + listLength);
775
+ let offset = 0;
776
+ const commands = /* @__PURE__ */ new Map();
777
+ while (offset < listLength) {
778
+ const { ccId, bytesRead } = (0, import_safe.parseCCId)(listBytes, offset);
779
+ const command = listBytes[offset + bytesRead];
780
+ if (!commands.has(ccId))
781
+ commands.set(ccId, []);
782
+ commands.get(ccId).push(command);
783
+ offset += bytesRead + 1;
685
784
  }
686
- };
687
- }
688
- };
689
- __decorate([
690
- (0, import_CommandClassDecorators.ccValue)(AssociationGroupInfoCCValues.commands, (self) => [self.groupId])
691
- ], AssociationGroupInfoCCCommandListReport.prototype, "commands", void 0);
692
- AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport_1 = __decorate([
693
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.CommandListReport)
694
- ], AssociationGroupInfoCCCommandListReport);
695
- let AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet_1 = class AssociationGroupInfoCCCommandListGet2 extends AssociationGroupInfoCC {
696
- constructor(options) {
697
- super(options);
698
- this.allowCache = options.allowCache;
699
- this.groupId = options.groupId;
700
- }
701
- static from(raw, ctx) {
702
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
703
- const allowCache = !!(raw.payload[0] & 128);
704
- const groupId = raw.payload[1];
705
- return new AssociationGroupInfoCCCommandListGet_1({
706
- nodeId: ctx.sourceNodeId,
707
- allowCache,
708
- groupId
709
- });
710
- }
711
- allowCache;
712
- groupId;
713
- serialize(ctx) {
714
- this.payload = import_safe2.Bytes.from([
715
- this.allowCache ? 128 : 0,
716
- this.groupId
717
- ]);
718
- return super.serialize(ctx);
719
- }
720
- toLogEntry(ctx) {
721
- return {
722
- ...super.toLogEntry(ctx),
723
- message: {
724
- "group id": this.groupId,
725
- "allow cache": this.allowCache
785
+ return new this({
786
+ nodeId: ctx.sourceNodeId,
787
+ groupId,
788
+ commands
789
+ });
790
+ }
791
+ groupId;
792
+ commands;
793
+ serialize(ctx) {
794
+ this.payload = new import_safe2.Bytes(2 + this.commands.size * 3);
795
+ this.payload[0] = this.groupId;
796
+ let offset = 2;
797
+ for (const [ccId, commands] of this.commands) {
798
+ for (const command of commands) {
799
+ offset += (0, import_safe.encodeCCId)(ccId, this.payload, offset);
800
+ this.payload[offset] = command;
801
+ offset++;
802
+ }
726
803
  }
727
- };
728
- }
729
- };
730
- AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet_1 = __decorate([
731
- (0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.CommandListGet),
732
- (0, import_CommandClassDecorators.expectedCCResponse)(AssociationGroupInfoCCCommandListReport)
733
- ], AssociationGroupInfoCCCommandListGet);
804
+ this.payload[1] = offset - 2;
805
+ return super.serialize(ctx);
806
+ }
807
+ toLogEntry(ctx) {
808
+ return {
809
+ ...super.toLogEntry(ctx),
810
+ message: {
811
+ "group id": this.groupId,
812
+ commands: `${[...this.commands].map(([cc, cmds]) => {
813
+ return `
814
+ \xB7 ${(0, import_safe.getCCName)(cc)}: ${cmds.map((cmd) => (0, import_safe3.num2hex)(cmd)).join(", ")}`;
815
+ }).join("")}`
816
+ }
817
+ };
818
+ }
819
+ };
820
+ return AssociationGroupInfoCCCommandListReport2 = _classThis;
821
+ })();
822
+ let AssociationGroupInfoCCCommandListGet = (() => {
823
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AssociationGroupInfoCommand.CommandListGet), (0, import_CommandClassDecorators.expectedCCResponse)(AssociationGroupInfoCCCommandListReport)];
824
+ let _classDescriptor;
825
+ let _classExtraInitializers = [];
826
+ let _classThis;
827
+ let _classSuper = AssociationGroupInfoCC;
828
+ var AssociationGroupInfoCCCommandListGet2 = class extends _classSuper {
829
+ static {
830
+ _classThis = this;
831
+ }
832
+ static {
833
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
834
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
835
+ AssociationGroupInfoCCCommandListGet2 = _classThis = _classDescriptor.value;
836
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
837
+ __runInitializers(_classThis, _classExtraInitializers);
838
+ }
839
+ constructor(options) {
840
+ super(options);
841
+ this.allowCache = options.allowCache;
842
+ this.groupId = options.groupId;
843
+ }
844
+ static from(raw, ctx) {
845
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
846
+ const allowCache = !!(raw.payload[0] & 128);
847
+ const groupId = raw.payload[1];
848
+ return new this({
849
+ nodeId: ctx.sourceNodeId,
850
+ allowCache,
851
+ groupId
852
+ });
853
+ }
854
+ allowCache;
855
+ groupId;
856
+ serialize(ctx) {
857
+ this.payload = import_safe2.Bytes.from([
858
+ this.allowCache ? 128 : 0,
859
+ this.groupId
860
+ ]);
861
+ return super.serialize(ctx);
862
+ }
863
+ toLogEntry(ctx) {
864
+ return {
865
+ ...super.toLogEntry(ctx),
866
+ message: {
867
+ "group id": this.groupId,
868
+ "allow cache": this.allowCache
869
+ }
870
+ };
871
+ }
872
+ };
873
+ return AssociationGroupInfoCCCommandListGet2 = _classThis;
874
+ })();
734
875
  // Annotate the CommonJS export names for ESM import in node:
735
876
  0 && (module.exports = {
736
877
  AssociationGroupInfoCC,