@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
@@ -44,13 +44,45 @@ var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
44
44
  var import_EncapsulatingCommandClass = require("../lib/EncapsulatingCommandClass.js");
45
45
  var import_Values = require("../lib/Values.js");
46
46
  var import_Types = require("../lib/_Types.js");
47
- var __decorate = function(decorators, target, key, desc) {
48
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
49
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
50
- 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;
51
- return c > 3 && r && Object.defineProperty(target, key, r), r;
47
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
48
+ function accept(f) {
49
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
50
+ return f;
51
+ }
52
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
53
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
54
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
55
+ var _, done = false;
56
+ for (var i = decorators.length - 1; i >= 0; i--) {
57
+ var context = {};
58
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
59
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
60
+ context.addInitializer = function(f) {
61
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
62
+ extraInitializers.push(accept(f || null));
63
+ };
64
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
65
+ if (kind === "accessor") {
66
+ if (result === void 0) continue;
67
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
68
+ if (_ = accept(result.get)) descriptor.get = _;
69
+ if (_ = accept(result.set)) descriptor.set = _;
70
+ if (_ = accept(result.init)) initializers.unshift(_);
71
+ } else if (_ = accept(result)) {
72
+ if (kind === "field") initializers.unshift(_);
73
+ else descriptor[key] = _;
74
+ }
75
+ }
76
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
77
+ done = true;
78
+ };
79
+ var __runInitializers = function(thisArg, initializers, value) {
80
+ var useValue = arguments.length > 2;
81
+ for (var i = 0; i < initializers.length; i++) {
82
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
83
+ }
84
+ return useValue ? value : void 0;
52
85
  };
53
- var MultiChannelCCEndPointReport_1, MultiChannelCCCapabilityReport_1, MultiChannelCCCapabilityGet_1, MultiChannelCCEndPointFindReport_1, MultiChannelCCEndPointFind_1, MultiChannelCCAggregatedMembersReport_1, MultiChannelCCCommandEncapsulation_1, MultiChannelCCV1Report_1, MultiChannelCCV1CommandEncapsulation_1;
54
86
  function __assertType(argName, typeName, boundHasError) {
55
87
  const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
56
88
  if (boundHasError()) {
@@ -123,713 +155,842 @@ function areEndpointsUnnecessary(ctx, nodeId, endpointIndizes) {
123
155
  return false;
124
156
  return true;
125
157
  }
126
- let MultiChannelCCAPI = class MultiChannelCCAPI2 extends import_API.CCAPI {
127
- supportsCommand(cmd) {
128
- switch (cmd) {
129
- // Legacy commands:
130
- case import_Types.MultiChannelCommand.GetV1:
131
- return this.isSinglecast() && this.version === 1;
132
- case import_Types.MultiChannelCommand.CommandEncapsulationV1:
133
- return this.version === 1;
134
- // The specs start at version 3 but according to OZW,
135
- // these do seem to be supported in version 2
136
- case import_Types.MultiChannelCommand.EndPointGet:
137
- case import_Types.MultiChannelCommand.CapabilityGet:
138
- return this.version >= 2 && this.isSinglecast();
139
- case import_Types.MultiChannelCommand.CommandEncapsulation:
140
- return this.version >= 2;
141
- case import_Types.MultiChannelCommand.EndPointFind:
142
- return this.version >= 3 && this.isSinglecast();
143
- case import_Types.MultiChannelCommand.AggregatedMembersGet:
144
- return this.version >= 4 && this.isSinglecast();
145
- }
146
- return super.supportsCommand(cmd);
147
- }
148
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
149
- async getEndpoints() {
150
- this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.EndPointGet);
151
- const cc = new MultiChannelCCEndPointGet({
152
- nodeId: this.endpoint.nodeId,
153
- endpointIndex: this.endpoint.index
154
- });
155
- const response = await this.host.sendCommand(cc, this.commandOptions);
156
- if (response) {
157
- return {
158
- isDynamicEndpointCount: response.countIsDynamic,
159
- identicalCapabilities: response.identicalCapabilities,
160
- individualEndpointCount: response.individualCount,
161
- aggregatedEndpointCount: response.aggregatedCount
162
- };
158
+ let MultiChannelCCAPI = (() => {
159
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multi Channel"])];
160
+ let _classDescriptor;
161
+ let _classExtraInitializers = [];
162
+ let _classThis;
163
+ let _classSuper = import_API.CCAPI;
164
+ var MultiChannelCCAPI2 = class extends _classSuper {
165
+ static {
166
+ _classThis = this;
163
167
  }
164
- }
165
- async getEndpointCapabilities(endpoint) {
166
- __assertType("endpoint", "number", __assertType__number.bind(void 0, endpoint));
167
- this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.CapabilityGet);
168
- const cc = new MultiChannelCCCapabilityGet({
169
- nodeId: this.endpoint.nodeId,
170
- endpointIndex: this.endpoint.index,
171
- requestedEndpoint: endpoint
172
- });
173
- const response = await this.host.sendCommand(cc, this.commandOptions);
174
- if (response) {
175
- const generic = (0, import_safe.getGenericDeviceClass)(response.genericDeviceClass);
176
- const specific = (0, import_safe.getSpecificDeviceClass)(response.genericDeviceClass, response.specificDeviceClass);
177
- return {
178
- isDynamic: response.isDynamic,
179
- wasRemoved: response.wasRemoved,
180
- supportedCCs: response.supportedCCs,
181
- generic,
182
- specific
183
- };
168
+ static {
169
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
170
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
171
+ MultiChannelCCAPI2 = _classThis = _classDescriptor.value;
172
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
173
+ __runInitializers(_classThis, _classExtraInitializers);
184
174
  }
185
- }
186
- async findEndpoints(genericClass, specificClass) {
187
- __assertType("genericClass", "number", __assertType__number.bind(void 0, genericClass));
188
- __assertType("specificClass", "number", __assertType__number.bind(void 0, specificClass));
189
- this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.EndPointFind);
190
- const cc = new MultiChannelCCEndPointFind({
191
- nodeId: this.endpoint.nodeId,
192
- endpointIndex: this.endpoint.index,
193
- genericClass,
194
- specificClass
195
- });
196
- const response = await this.host.sendCommand(cc, this.commandOptions);
197
- return response?.foundEndpoints;
198
- }
199
- async getAggregatedMembers(endpoint) {
200
- __assertType("endpoint", "number", __assertType__number.bind(void 0, endpoint));
201
- this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.AggregatedMembersGet);
202
- const cc = new MultiChannelCCAggregatedMembersGet({
203
- nodeId: this.endpoint.nodeId,
204
- endpointIndex: this.endpoint.index,
205
- requestedEndpoint: endpoint
206
- });
207
- const response = await this.host.sendCommand(cc, this.commandOptions);
208
- return response?.members;
209
- }
210
- // Encapsulation is used internally and too frequently that we
211
- // want to pay the cost of validating each call
212
- // eslint-disable-next-line @zwave-js/ccapi-validate-args
213
- async sendEncapsulated(options) {
214
- this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.CommandEncapsulation);
215
- const cc = new MultiChannelCCCommandEncapsulation({
216
- nodeId: this.endpoint.nodeId,
217
- ...options
218
- });
219
- await this.host.sendCommand(cc, this.commandOptions);
220
- }
221
- async getEndpointCountV1(ccId) {
222
- __assertType("ccId", "CommandClasses", __assertType__number.bind(void 0, ccId));
223
- this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.GetV1);
224
- const cc = new MultiChannelCCV1Get({
225
- nodeId: this.endpoint.nodeId,
226
- requestedCC: ccId
227
- });
228
- const response = await this.host.sendCommand(cc, this.commandOptions);
229
- return response?.endpointCount;
230
- }
231
- // Encapsulation is used internally and too frequently that we
232
- // want to pay the cost of validating each call
233
- // eslint-disable-next-line @zwave-js/ccapi-validate-args
234
- async sendEncapsulatedV1(encapsulated) {
235
- this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.CommandEncapsulationV1);
236
- const cc = new MultiChannelCCV1CommandEncapsulation({
237
- nodeId: this.endpoint.nodeId,
238
- encapsulated
239
- });
240
- await this.host.sendCommand(cc, this.commandOptions);
241
- }
242
- };
243
- MultiChannelCCAPI = __decorate([
244
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multi Channel"])
245
- ], MultiChannelCCAPI);
246
- let MultiChannelCC = class MultiChannelCC2 extends import_CommandClass.CommandClass {
247
- /** Tests if a command targets a specific endpoint and thus requires encapsulation */
248
- static requiresEncapsulation(cc) {
249
- return cc.endpointIndex !== 0 && !(cc instanceof MultiChannelCCCommandEncapsulation) && !(cc instanceof MultiChannelCCV1CommandEncapsulation);
250
- }
251
- /** Encapsulates a command that targets a specific endpoint, with version 2+ of the Multi Channel CC */
252
- static encapsulate(cc) {
253
- const ret = new MultiChannelCCCommandEncapsulation({
254
- nodeId: cc.nodeId,
255
- encapsulated: cc,
256
- destination: cc.endpointIndex
257
- });
258
- ret.encapsulationFlags = cc.encapsulationFlags;
259
- return ret;
260
- }
261
- /** Encapsulates a command that targets a specific endpoint, with version 1 of the Multi Channel CC */
262
- static encapsulateV1(cc) {
263
- const ret = new MultiChannelCCV1CommandEncapsulation({
264
- nodeId: cc.nodeId,
265
- encapsulated: cc
266
- });
267
- ret.encapsulationFlags = cc.encapsulationFlags;
268
- return ret;
269
- }
270
- skipEndpointInterview() {
271
- return true;
272
- }
273
- async interview(ctx) {
274
- const node = this.getNode(ctx);
275
- const removeEndpoints = ctx.getDeviceConfig?.(node.id)?.compat?.removeEndpoints;
276
- if (removeEndpoints === "*") {
175
+ supportsCommand(cmd) {
176
+ switch (cmd) {
177
+ // Legacy commands:
178
+ case import_Types.MultiChannelCommand.GetV1:
179
+ return this.isSinglecast() && this.version === 1;
180
+ case import_Types.MultiChannelCommand.CommandEncapsulationV1:
181
+ return this.version === 1;
182
+ // The specs start at version 3 but according to OZW,
183
+ // these do seem to be supported in version 2
184
+ case import_Types.MultiChannelCommand.EndPointGet:
185
+ case import_Types.MultiChannelCommand.CapabilityGet:
186
+ return this.version >= 2 && this.isSinglecast();
187
+ case import_Types.MultiChannelCommand.CommandEncapsulation:
188
+ return this.version >= 2;
189
+ case import_Types.MultiChannelCommand.EndPointFind:
190
+ return this.version >= 3 && this.isSinglecast();
191
+ case import_Types.MultiChannelCommand.AggregatedMembersGet:
192
+ return this.version >= 4 && this.isSinglecast();
193
+ }
194
+ return super.supportsCommand(cmd);
195
+ }
196
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
197
+ async getEndpoints() {
198
+ this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.EndPointGet);
199
+ const cc = new MultiChannelCCEndPointGet({
200
+ nodeId: this.endpoint.nodeId,
201
+ endpointIndex: this.endpoint.index
202
+ });
203
+ const response = await this.host.sendCommand(cc, this.commandOptions);
204
+ if (response) {
205
+ return {
206
+ isDynamicEndpointCount: response.countIsDynamic,
207
+ identicalCapabilities: response.identicalCapabilities,
208
+ individualEndpointCount: response.individualCount,
209
+ aggregatedEndpointCount: response.aggregatedCount
210
+ };
211
+ }
212
+ }
213
+ async getEndpointCapabilities(endpoint) {
214
+ __assertType("endpoint", "number", __assertType__number.bind(void 0, endpoint));
215
+ this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.CapabilityGet);
216
+ const cc = new MultiChannelCCCapabilityGet({
217
+ nodeId: this.endpoint.nodeId,
218
+ endpointIndex: this.endpoint.index,
219
+ requestedEndpoint: endpoint
220
+ });
221
+ const response = await this.host.sendCommand(cc, this.commandOptions);
222
+ if (response) {
223
+ const generic = (0, import_safe.getGenericDeviceClass)(response.genericDeviceClass);
224
+ const specific = (0, import_safe.getSpecificDeviceClass)(response.genericDeviceClass, response.specificDeviceClass);
225
+ return {
226
+ isDynamic: response.isDynamic,
227
+ wasRemoved: response.wasRemoved,
228
+ supportedCCs: response.supportedCCs,
229
+ generic,
230
+ specific
231
+ };
232
+ }
233
+ }
234
+ async findEndpoints(genericClass, specificClass) {
235
+ __assertType("genericClass", "number", __assertType__number.bind(void 0, genericClass));
236
+ __assertType("specificClass", "number", __assertType__number.bind(void 0, specificClass));
237
+ this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.EndPointFind);
238
+ const cc = new MultiChannelCCEndPointFind({
239
+ nodeId: this.endpoint.nodeId,
240
+ endpointIndex: this.endpoint.index,
241
+ genericClass,
242
+ specificClass
243
+ });
244
+ const response = await this.host.sendCommand(cc, this.commandOptions);
245
+ return response?.foundEndpoints;
246
+ }
247
+ async getAggregatedMembers(endpoint) {
248
+ __assertType("endpoint", "number", __assertType__number.bind(void 0, endpoint));
249
+ this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.AggregatedMembersGet);
250
+ const cc = new MultiChannelCCAggregatedMembersGet({
251
+ nodeId: this.endpoint.nodeId,
252
+ endpointIndex: this.endpoint.index,
253
+ requestedEndpoint: endpoint
254
+ });
255
+ const response = await this.host.sendCommand(cc, this.commandOptions);
256
+ return response?.members;
257
+ }
258
+ // Encapsulation is used internally and too frequently that we
259
+ // want to pay the cost of validating each call
260
+ // eslint-disable-next-line @zwave-js/ccapi-validate-args
261
+ async sendEncapsulated(options) {
262
+ this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.CommandEncapsulation);
263
+ const cc = new MultiChannelCCCommandEncapsulation({
264
+ nodeId: this.endpoint.nodeId,
265
+ ...options
266
+ });
267
+ await this.host.sendCommand(cc, this.commandOptions);
268
+ }
269
+ async getEndpointCountV1(ccId) {
270
+ __assertType("ccId", "CommandClasses", __assertType__number.bind(void 0, ccId));
271
+ this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.GetV1);
272
+ const cc = new MultiChannelCCV1Get({
273
+ nodeId: this.endpoint.nodeId,
274
+ requestedCC: ccId
275
+ });
276
+ const response = await this.host.sendCommand(cc, this.commandOptions);
277
+ return response?.endpointCount;
278
+ }
279
+ // Encapsulation is used internally and too frequently that we
280
+ // want to pay the cost of validating each call
281
+ // eslint-disable-next-line @zwave-js/ccapi-validate-args
282
+ async sendEncapsulatedV1(encapsulated) {
283
+ this.assertSupportsCommand(import_Types.MultiChannelCommand, import_Types.MultiChannelCommand.CommandEncapsulationV1);
284
+ const cc = new MultiChannelCCV1CommandEncapsulation({
285
+ nodeId: this.endpoint.nodeId,
286
+ encapsulated
287
+ });
288
+ await this.host.sendCommand(cc, this.commandOptions);
289
+ }
290
+ };
291
+ return MultiChannelCCAPI2 = _classThis;
292
+ })();
293
+ let MultiChannelCC = (() => {
294
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multi Channel"]), (0, import_CommandClassDecorators.implementedVersion)(4), (0, import_CommandClassDecorators.ccValues)(MultiChannelCCValues)];
295
+ let _classDescriptor;
296
+ let _classExtraInitializers = [];
297
+ let _classThis;
298
+ let _classSuper = import_CommandClass.CommandClass;
299
+ var MultiChannelCC2 = class extends _classSuper {
300
+ static {
301
+ _classThis = this;
302
+ }
303
+ static {
304
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
305
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
306
+ MultiChannelCC2 = _classThis = _classDescriptor.value;
307
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
308
+ __runInitializers(_classThis, _classExtraInitializers);
309
+ }
310
+ /** Tests if a command targets a specific endpoint and thus requires encapsulation */
311
+ static requiresEncapsulation(cc) {
312
+ return cc.endpointIndex !== 0 && !(cc instanceof MultiChannelCCCommandEncapsulation) && !(cc instanceof MultiChannelCCV1CommandEncapsulation);
313
+ }
314
+ /** Encapsulates a command that targets a specific endpoint, with version 2+ of the Multi Channel CC */
315
+ static encapsulate(cc) {
316
+ const ret = new MultiChannelCCCommandEncapsulation({
317
+ nodeId: cc.nodeId,
318
+ encapsulated: cc,
319
+ destination: cc.endpointIndex
320
+ });
321
+ ret.encapsulationFlags = cc.encapsulationFlags;
322
+ return ret;
323
+ }
324
+ /** Encapsulates a command that targets a specific endpoint, with version 1 of the Multi Channel CC */
325
+ static encapsulateV1(cc) {
326
+ const ret = new MultiChannelCCV1CommandEncapsulation({
327
+ nodeId: cc.nodeId,
328
+ encapsulated: cc
329
+ });
330
+ ret.encapsulationFlags = cc.encapsulationFlags;
331
+ return ret;
332
+ }
333
+ skipEndpointInterview() {
334
+ return true;
335
+ }
336
+ async interview(ctx) {
337
+ const node = this.getNode(ctx);
338
+ const removeEndpoints = ctx.getDeviceConfig?.(node.id)?.compat?.removeEndpoints;
339
+ if (removeEndpoints === "*") {
340
+ ctx.logNode(node.id, {
341
+ endpoint: this.endpointIndex,
342
+ message: `Skipping ${this.ccName} interview b/c all endpoints are ignored by the device config file...`,
343
+ direction: "none"
344
+ });
345
+ return;
346
+ }
277
347
  ctx.logNode(node.id, {
278
348
  endpoint: this.endpointIndex,
279
- message: `Skipping ${this.ccName} interview b/c all endpoints are ignored by the device config file...`,
349
+ message: `Interviewing ${this.ccName}...`,
280
350
  direction: "none"
281
351
  });
282
- return;
283
- }
284
- ctx.logNode(node.id, {
285
- endpoint: this.endpointIndex,
286
- message: `Interviewing ${this.ccName}...`,
287
- direction: "none"
288
- });
289
- const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
290
- if (ccVersion === 1)
291
- return this.interviewV1(ctx);
292
- const endpoint = node.getEndpoint(this.endpointIndex);
293
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Multi Channel"], ctx, endpoint).withOptions({
294
- priority: import_safe.MessagePriority.NodeQuery
295
- });
296
- const valueDB = this.getValueDB(ctx);
297
- ctx.logNode(node.id, {
298
- endpoint: this.endpointIndex,
299
- message: "querying device endpoint information...",
300
- direction: "outbound"
301
- });
302
- const multiResponse = await api.getEndpoints();
303
- if (!multiResponse) {
352
+ const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
353
+ if (ccVersion === 1)
354
+ return this.interviewV1(ctx);
355
+ const endpoint = node.getEndpoint(this.endpointIndex);
356
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Multi Channel"], ctx, endpoint).withOptions({
357
+ priority: import_safe.MessagePriority.NodeQuery
358
+ });
359
+ const valueDB = this.getValueDB(ctx);
304
360
  ctx.logNode(node.id, {
305
361
  endpoint: this.endpointIndex,
306
- message: "Querying device endpoint information timed out, aborting interview...",
307
- level: "warn"
362
+ message: "querying device endpoint information...",
363
+ direction: "outbound"
308
364
  });
309
- return this.throwMissingCriticalInterviewResponse();
310
- }
311
- let logMessage = `received response for device endpoints:
365
+ const multiResponse = await api.getEndpoints();
366
+ if (!multiResponse) {
367
+ ctx.logNode(node.id, {
368
+ endpoint: this.endpointIndex,
369
+ message: "Querying device endpoint information timed out, aborting interview...",
370
+ level: "warn"
371
+ });
372
+ return this.throwMissingCriticalInterviewResponse();
373
+ }
374
+ let logMessage = `received response for device endpoints:
312
375
  endpoint count (individual): ${multiResponse.individualEndpointCount}
313
376
  count is dynamic: ${multiResponse.isDynamicEndpointCount}
314
377
  identical capabilities: ${multiResponse.identicalCapabilities}`;
315
- if (multiResponse.aggregatedEndpointCount != void 0) {
316
- logMessage += `
378
+ if (multiResponse.aggregatedEndpointCount != void 0) {
379
+ logMessage += `
317
380
  endpoint count (aggregated): ${multiResponse.aggregatedEndpointCount}`;
318
- }
319
- ctx.logNode(node.id, {
320
- endpoint: this.endpointIndex,
321
- message: logMessage,
322
- direction: "inbound"
323
- });
324
- let allEndpoints = [];
325
- const addSequentialEndpoints = () => {
326
- for (let i = 1; i <= multiResponse.individualEndpointCount + (multiResponse.aggregatedEndpointCount ?? 0); i++) {
327
- allEndpoints.push(i);
328
381
  }
329
- };
330
- if (api.supportsCommand(import_Types.MultiChannelCommand.EndPointFind)) {
331
382
  ctx.logNode(node.id, {
332
383
  endpoint: this.endpointIndex,
333
- message: "querying all endpoints...",
334
- direction: "outbound"
384
+ message: logMessage,
385
+ direction: "inbound"
335
386
  });
336
- const foundEndpoints = await api.findEndpoints(255, 255);
337
- if (foundEndpoints)
338
- allEndpoints.push(...foundEndpoints);
339
- if (!allEndpoints.length) {
387
+ let allEndpoints = [];
388
+ const addSequentialEndpoints = () => {
389
+ for (let i = 1; i <= multiResponse.individualEndpointCount + (multiResponse.aggregatedEndpointCount ?? 0); i++) {
390
+ allEndpoints.push(i);
391
+ }
392
+ };
393
+ if (api.supportsCommand(import_Types.MultiChannelCommand.EndPointFind)) {
340
394
  ctx.logNode(node.id, {
341
395
  endpoint: this.endpointIndex,
342
- message: `Endpoint query returned no results, assuming that endpoints are sequential`,
343
- direction: "inbound"
396
+ message: "querying all endpoints...",
397
+ direction: "outbound"
344
398
  });
345
- addSequentialEndpoints();
399
+ const foundEndpoints = await api.findEndpoints(255, 255);
400
+ if (foundEndpoints)
401
+ allEndpoints.push(...foundEndpoints);
402
+ if (!allEndpoints.length) {
403
+ ctx.logNode(node.id, {
404
+ endpoint: this.endpointIndex,
405
+ message: `Endpoint query returned no results, assuming that endpoints are sequential`,
406
+ direction: "inbound"
407
+ });
408
+ addSequentialEndpoints();
409
+ } else {
410
+ ctx.logNode(node.id, {
411
+ endpoint: this.endpointIndex,
412
+ message: `received endpoints: ${allEndpoints.map(String).join(", ")}`,
413
+ direction: "inbound"
414
+ });
415
+ }
346
416
  } else {
347
417
  ctx.logNode(node.id, {
348
418
  endpoint: this.endpointIndex,
349
- message: `received endpoints: ${allEndpoints.map(String).join(", ")}`,
350
- direction: "inbound"
419
+ message: `does not support EndPointFind, assuming that endpoints are sequential`,
420
+ direction: "none"
351
421
  });
422
+ addSequentialEndpoints();
352
423
  }
353
- } else {
354
- ctx.logNode(node.id, {
355
- endpoint: this.endpointIndex,
356
- message: `does not support EndPointFind, assuming that endpoints are sequential`,
357
- direction: "none"
358
- });
359
- addSequentialEndpoints();
360
- }
361
- if (removeEndpoints?.length) {
362
- ctx.logNode(node.id, {
363
- endpoint: this.endpointIndex,
364
- message: `The following endpoints are ignored through the config file: ${removeEndpoints.join(", ")}`,
365
- direction: "none"
366
- });
367
- allEndpoints = allEndpoints.filter((e) => !removeEndpoints.includes(e));
368
- }
369
- let hasQueriedCapabilities = false;
370
- for (const endpoint2 of allEndpoints) {
371
- if (endpoint2 > multiResponse.individualEndpointCount && ccVersion >= 4) {
424
+ if (removeEndpoints?.length) {
372
425
  ctx.logNode(node.id, {
373
426
  endpoint: this.endpointIndex,
374
- message: `querying members of aggregated endpoint #${endpoint2}...`,
375
- direction: "outbound"
427
+ message: `The following endpoints are ignored through the config file: ${removeEndpoints.join(", ")}`,
428
+ direction: "none"
376
429
  });
377
- const members = await api.getAggregatedMembers(endpoint2);
378
- if (members) {
430
+ allEndpoints = allEndpoints.filter((e) => !removeEndpoints.includes(e));
431
+ }
432
+ let hasQueriedCapabilities = false;
433
+ for (const endpoint2 of allEndpoints) {
434
+ if (endpoint2 > multiResponse.individualEndpointCount && ccVersion >= 4) {
379
435
  ctx.logNode(node.id, {
380
436
  endpoint: this.endpointIndex,
381
- message: `aggregated endpoint #${endpoint2} has members ${members.map(String).join(", ")}`,
382
- direction: "inbound"
437
+ message: `querying members of aggregated endpoint #${endpoint2}...`,
438
+ direction: "outbound"
383
439
  });
440
+ const members = await api.getAggregatedMembers(endpoint2);
441
+ if (members) {
442
+ ctx.logNode(node.id, {
443
+ endpoint: this.endpointIndex,
444
+ message: `aggregated endpoint #${endpoint2} has members ${members.map(String).join(", ")}`,
445
+ direction: "inbound"
446
+ });
447
+ }
448
+ }
449
+ if (multiResponse.identicalCapabilities && hasQueriedCapabilities) {
450
+ ctx.logNode(node.id, {
451
+ endpoint: this.endpointIndex,
452
+ message: `all endpoints identical, skipping capability query for endpoint #${endpoint2}...`,
453
+ direction: "none"
454
+ });
455
+ const devClass = valueDB.getValue(MultiChannelCCValues.endpointDeviceClass.endpoint(allEndpoints[0]));
456
+ valueDB.setValue(MultiChannelCCValues.endpointDeviceClass.endpoint(endpoint2), devClass);
457
+ const ep1Caps = valueDB.getValue(MultiChannelCCValues.endpointCCs.endpoint(allEndpoints[0]));
458
+ valueDB.setValue(MultiChannelCCValues.endpointCCs.endpoint(endpoint2), [...ep1Caps]);
459
+ continue;
384
460
  }
385
- }
386
- if (multiResponse.identicalCapabilities && hasQueriedCapabilities) {
387
461
  ctx.logNode(node.id, {
388
462
  endpoint: this.endpointIndex,
389
- message: `all endpoints identical, skipping capability query for endpoint #${endpoint2}...`,
390
- direction: "none"
463
+ message: `querying capabilities for endpoint #${endpoint2}...`,
464
+ direction: "outbound"
391
465
  });
392
- const devClass = valueDB.getValue(MultiChannelCCValues.endpointDeviceClass.endpoint(allEndpoints[0]));
393
- valueDB.setValue(MultiChannelCCValues.endpointDeviceClass.endpoint(endpoint2), devClass);
394
- const ep1Caps = valueDB.getValue(MultiChannelCCValues.endpointCCs.endpoint(allEndpoints[0]));
395
- valueDB.setValue(MultiChannelCCValues.endpointCCs.endpoint(endpoint2), [...ep1Caps]);
396
- continue;
397
- }
398
- ctx.logNode(node.id, {
399
- endpoint: this.endpointIndex,
400
- message: `querying capabilities for endpoint #${endpoint2}...`,
401
- direction: "outbound"
402
- });
403
- const caps = await api.getEndpointCapabilities(endpoint2);
404
- if (caps) {
405
- hasQueriedCapabilities = true;
406
- logMessage = `received response for endpoint capabilities (#${endpoint2}):
466
+ const caps = await api.getEndpointCapabilities(endpoint2);
467
+ if (caps) {
468
+ hasQueriedCapabilities = true;
469
+ logMessage = `received response for endpoint capabilities (#${endpoint2}):
407
470
  generic device class: ${caps.generic.label}
408
471
  specific device class: ${caps.specific.label}
409
472
  is dynamic end point: ${caps.isDynamic}
410
473
  supported CCs:`;
411
- for (const cc of caps.supportedCCs) {
412
- logMessage += `
474
+ for (const cc of caps.supportedCCs) {
475
+ logMessage += `
413
476
  \xB7 ${(0, import_safe.getCCName)(cc)}`;
477
+ }
478
+ ctx.logNode(node.id, {
479
+ endpoint: this.endpointIndex,
480
+ message: logMessage,
481
+ direction: "inbound"
482
+ });
483
+ } else {
484
+ ctx.logNode(node.id, {
485
+ endpoint: this.endpointIndex,
486
+ message: `Querying endpoint #${endpoint2} capabilities timed out, aborting interview...`,
487
+ level: "warn"
488
+ });
489
+ return this.throwMissingCriticalInterviewResponse();
490
+ }
491
+ }
492
+ if (!multiResponse.identicalCapabilities && areEndpointsUnnecessary(ctx, node.id, allEndpoints)) {
493
+ const preserve = ctx.getDeviceConfig?.(node.id)?.compat?.preserveEndpoints;
494
+ if (!preserve) {
495
+ allEndpoints = [];
496
+ ctx.logNode(node.id, {
497
+ message: `Endpoints seem unnecessary b/c they have different device classes, ignoring all...`
498
+ });
499
+ } else if (preserve === "*") {
500
+ ctx.logNode(node.id, {
501
+ message: `Endpoints seem unnecessary, but are configured to be preserved.`
502
+ });
503
+ } else {
504
+ allEndpoints = allEndpoints.filter((ep) => preserve.includes(ep));
505
+ ctx.logNode(node.id, {
506
+ message: `Endpoints seem unnecessary, but endpoints ${allEndpoints.join(", ")} are configured to be preserved.`
507
+ });
414
508
  }
415
- ctx.logNode(node.id, {
416
- endpoint: this.endpointIndex,
417
- message: logMessage,
418
- direction: "inbound"
419
- });
420
- } else {
421
- ctx.logNode(node.id, {
422
- endpoint: this.endpointIndex,
423
- message: `Querying endpoint #${endpoint2} capabilities timed out, aborting interview...`,
424
- level: "warn"
425
- });
426
- return this.throwMissingCriticalInterviewResponse();
427
509
  }
510
+ this.setValue(ctx, MultiChannelCCValues.endpointIndizes, allEndpoints);
511
+ this.setInterviewComplete(ctx, true);
428
512
  }
429
- if (!multiResponse.identicalCapabilities && areEndpointsUnnecessary(ctx, node.id, allEndpoints)) {
430
- const preserve = ctx.getDeviceConfig?.(node.id)?.compat?.preserveEndpoints;
431
- if (!preserve) {
432
- allEndpoints = [];
513
+ async interviewV1(ctx) {
514
+ const node = this.getNode(ctx);
515
+ const endpoint = this.getEndpoint(ctx);
516
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Multi Channel"], ctx, endpoint);
517
+ const valueDB = this.getValueDB(ctx);
518
+ const supportedCCs = [...node.getCCs()].filter(([, info]) => info.isSupported).map(([cc]) => cc).filter((cc) => !import_CommandClass.CommandClass.createInstanceUnchecked(node, cc)?.skipEndpointInterview());
519
+ const endpointCounts = /* @__PURE__ */ new Map();
520
+ for (const ccId of supportedCCs) {
433
521
  ctx.logNode(node.id, {
434
- message: `Endpoints seem unnecessary b/c they have different device classes, ignoring all...`
435
- });
436
- } else if (preserve === "*") {
437
- ctx.logNode(node.id, {
438
- message: `Endpoints seem unnecessary, but are configured to be preserved.`
439
- });
440
- } else {
441
- allEndpoints = allEndpoints.filter((ep) => preserve.includes(ep));
442
- ctx.logNode(node.id, {
443
- message: `Endpoints seem unnecessary, but endpoints ${allEndpoints.join(", ")} are configured to be preserved.`
522
+ message: `Querying endpoint count for CommandClass ${(0, import_safe.getCCName)(ccId)}...`,
523
+ direction: "outbound"
444
524
  });
525
+ const endpointCount = await api.getEndpointCountV1(ccId);
526
+ if (endpointCount != void 0) {
527
+ endpointCounts.set(ccId, endpointCount);
528
+ ctx.logNode(node.id, {
529
+ message: `CommandClass ${(0, import_safe.getCCName)(ccId)} has ${endpointCount} endpoints`,
530
+ direction: "inbound"
531
+ });
532
+ }
533
+ }
534
+ const numEndpoints = Math.max(...endpointCounts.values());
535
+ this.setValue(ctx, MultiChannelCCValues.endpointCountIsDynamic, false);
536
+ this.setValue(ctx, MultiChannelCCValues.aggregatedEndpointCount, 0);
537
+ this.setValue(ctx, MultiChannelCCValues.individualEndpointCount, numEndpoints);
538
+ this.setValue(ctx, MultiChannelCCValues.endpointsHaveIdenticalCapabilities, false);
539
+ for (let endpoint2 = 1; endpoint2 <= numEndpoints; endpoint2++) {
540
+ const endpointCCs = [...endpointCounts.entries()].filter(([, ccEndpoints]) => ccEndpoints >= endpoint2).map(([ccId]) => ccId);
541
+ valueDB.setValue(MultiChannelCCValues.endpointCCs.endpoint(endpoint2), endpointCCs);
445
542
  }
543
+ this.setInterviewComplete(ctx, true);
446
544
  }
447
- this.setValue(ctx, MultiChannelCCValues.endpointIndizes, allEndpoints);
448
- this.setInterviewComplete(ctx, true);
449
- }
450
- async interviewV1(ctx) {
451
- const node = this.getNode(ctx);
452
- const endpoint = this.getEndpoint(ctx);
453
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Multi Channel"], ctx, endpoint);
454
- const valueDB = this.getValueDB(ctx);
455
- const supportedCCs = [...node.getCCs()].filter(([, info]) => info.isSupported).map(([cc]) => cc).filter((cc) => !import_CommandClass.CommandClass.createInstanceUnchecked(node, cc)?.skipEndpointInterview());
456
- const endpointCounts = /* @__PURE__ */ new Map();
457
- for (const ccId of supportedCCs) {
458
- ctx.logNode(node.id, {
459
- message: `Querying endpoint count for CommandClass ${(0, import_safe.getCCName)(ccId)}...`,
460
- direction: "outbound"
545
+ };
546
+ return MultiChannelCC2 = _classThis;
547
+ })();
548
+ let MultiChannelCCEndPointReport = (() => {
549
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.EndPointReport), (0, import_CommandClassDecorators.ccValueProperty)("countIsDynamic", MultiChannelCCValues.endpointCountIsDynamic), (0, import_CommandClassDecorators.ccValueProperty)("identicalCapabilities", MultiChannelCCValues.endpointsHaveIdenticalCapabilities), (0, import_CommandClassDecorators.ccValueProperty)("individualCount", MultiChannelCCValues.individualEndpointCount), (0, import_CommandClassDecorators.ccValueProperty)("aggregatedCount", MultiChannelCCValues.aggregatedEndpointCount)];
550
+ let _classDescriptor;
551
+ let _classExtraInitializers = [];
552
+ let _classThis;
553
+ let _classSuper = MultiChannelCC;
554
+ var MultiChannelCCEndPointReport2 = class extends _classSuper {
555
+ static {
556
+ _classThis = this;
557
+ }
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
+ MultiChannelCCEndPointReport2 = _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.countIsDynamic = options.countIsDynamic;
568
+ this.identicalCapabilities = options.identicalCapabilities;
569
+ this.individualCount = options.individualCount;
570
+ this.aggregatedCount = options.aggregatedCount;
571
+ }
572
+ static from(raw, ctx) {
573
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
574
+ const countIsDynamic = !!(raw.payload[0] & 128);
575
+ const identicalCapabilities = !!(raw.payload[0] & 64);
576
+ const individualCount = raw.payload[1] & 127;
577
+ let aggregatedCount;
578
+ if (raw.payload.length >= 3) {
579
+ aggregatedCount = raw.payload[2] & 127;
580
+ }
581
+ return new this({
582
+ nodeId: ctx.sourceNodeId,
583
+ countIsDynamic,
584
+ identicalCapabilities,
585
+ individualCount,
586
+ aggregatedCount
461
587
  });
462
- const endpointCount = await api.getEndpointCountV1(ccId);
463
- if (endpointCount != void 0) {
464
- endpointCounts.set(ccId, endpointCount);
465
- ctx.logNode(node.id, {
466
- message: `CommandClass ${(0, import_safe.getCCName)(ccId)} has ${endpointCount} endpoints`,
467
- direction: "inbound"
468
- });
588
+ }
589
+ countIsDynamic;
590
+ identicalCapabilities;
591
+ individualCount;
592
+ aggregatedCount;
593
+ serialize(ctx) {
594
+ this.payload = import_safe2.Bytes.from([
595
+ (this.countIsDynamic ? 128 : 0) | (this.identicalCapabilities ? 64 : 0),
596
+ this.individualCount & 127,
597
+ this.aggregatedCount ?? 0
598
+ ]);
599
+ return super.serialize(ctx);
600
+ }
601
+ toLogEntry(ctx) {
602
+ const message = {
603
+ "endpoint count (individual)": this.individualCount,
604
+ "count is dynamic": this.countIsDynamic,
605
+ "identical capabilities": this.identicalCapabilities
606
+ };
607
+ if (this.aggregatedCount != void 0) {
608
+ message["endpoint count (aggregated)"] = this.aggregatedCount;
469
609
  }
610
+ const ret = {
611
+ ...super.toLogEntry(ctx),
612
+ message
613
+ };
614
+ return ret;
470
615
  }
471
- const numEndpoints = Math.max(...endpointCounts.values());
472
- this.setValue(ctx, MultiChannelCCValues.endpointCountIsDynamic, false);
473
- this.setValue(ctx, MultiChannelCCValues.aggregatedEndpointCount, 0);
474
- this.setValue(ctx, MultiChannelCCValues.individualEndpointCount, numEndpoints);
475
- this.setValue(ctx, MultiChannelCCValues.endpointsHaveIdenticalCapabilities, false);
476
- for (let endpoint2 = 1; endpoint2 <= numEndpoints; endpoint2++) {
477
- const endpointCCs = [...endpointCounts.entries()].filter(([, ccEndpoints]) => ccEndpoints >= endpoint2).map(([ccId]) => ccId);
478
- valueDB.setValue(MultiChannelCCValues.endpointCCs.endpoint(endpoint2), endpointCCs);
616
+ };
617
+ return MultiChannelCCEndPointReport2 = _classThis;
618
+ })();
619
+ let MultiChannelCCEndPointGet = (() => {
620
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.EndPointGet), (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCEndPointReport)];
621
+ let _classDescriptor;
622
+ let _classExtraInitializers = [];
623
+ let _classThis;
624
+ let _classSuper = MultiChannelCC;
625
+ var MultiChannelCCEndPointGet2 = class extends _classSuper {
626
+ static {
627
+ _classThis = this;
479
628
  }
480
- this.setInterviewComplete(ctx, true);
481
- }
482
- };
483
- MultiChannelCC = __decorate([
484
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multi Channel"]),
485
- (0, import_CommandClassDecorators.implementedVersion)(4),
486
- (0, import_CommandClassDecorators.ccValues)(MultiChannelCCValues)
487
- ], MultiChannelCC);
488
- let MultiChannelCCEndPointReport = MultiChannelCCEndPointReport_1 = class MultiChannelCCEndPointReport2 extends MultiChannelCC {
489
- constructor(options) {
490
- super(options);
491
- this.countIsDynamic = options.countIsDynamic;
492
- this.identicalCapabilities = options.identicalCapabilities;
493
- this.individualCount = options.individualCount;
494
- this.aggregatedCount = options.aggregatedCount;
495
- }
496
- static from(raw, ctx) {
497
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
498
- const countIsDynamic = !!(raw.payload[0] & 128);
499
- const identicalCapabilities = !!(raw.payload[0] & 64);
500
- const individualCount = raw.payload[1] & 127;
501
- let aggregatedCount;
502
- if (raw.payload.length >= 3) {
503
- aggregatedCount = raw.payload[2] & 127;
504
- }
505
- return new MultiChannelCCEndPointReport_1({
506
- nodeId: ctx.sourceNodeId,
507
- countIsDynamic,
508
- identicalCapabilities,
509
- individualCount,
510
- aggregatedCount
511
- });
512
- }
513
- countIsDynamic;
514
- identicalCapabilities;
515
- individualCount;
516
- aggregatedCount;
517
- serialize(ctx) {
518
- this.payload = import_safe2.Bytes.from([
519
- (this.countIsDynamic ? 128 : 0) | (this.identicalCapabilities ? 64 : 0),
520
- this.individualCount & 127,
521
- this.aggregatedCount ?? 0
522
- ]);
523
- return super.serialize(ctx);
524
- }
525
- toLogEntry(ctx) {
526
- const message = {
527
- "endpoint count (individual)": this.individualCount,
528
- "count is dynamic": this.countIsDynamic,
529
- "identical capabilities": this.identicalCapabilities
530
- };
531
- if (this.aggregatedCount != void 0) {
532
- message["endpoint count (aggregated)"] = this.aggregatedCount;
629
+ static {
630
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
631
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
632
+ MultiChannelCCEndPointGet2 = _classThis = _classDescriptor.value;
633
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
634
+ __runInitializers(_classThis, _classExtraInitializers);
533
635
  }
534
- const ret = {
535
- ...super.toLogEntry(ctx),
536
- message
537
- };
538
- return ret;
539
- }
540
- };
541
- __decorate([
542
- (0, import_CommandClassDecorators.ccValue)(MultiChannelCCValues.endpointCountIsDynamic)
543
- ], MultiChannelCCEndPointReport.prototype, "countIsDynamic", void 0);
544
- __decorate([
545
- (0, import_CommandClassDecorators.ccValue)(MultiChannelCCValues.endpointsHaveIdenticalCapabilities)
546
- ], MultiChannelCCEndPointReport.prototype, "identicalCapabilities", void 0);
547
- __decorate([
548
- (0, import_CommandClassDecorators.ccValue)(MultiChannelCCValues.individualEndpointCount)
549
- ], MultiChannelCCEndPointReport.prototype, "individualCount", void 0);
550
- __decorate([
551
- (0, import_CommandClassDecorators.ccValue)(MultiChannelCCValues.aggregatedEndpointCount)
552
- ], MultiChannelCCEndPointReport.prototype, "aggregatedCount", void 0);
553
- MultiChannelCCEndPointReport = MultiChannelCCEndPointReport_1 = __decorate([
554
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.EndPointReport)
555
- ], MultiChannelCCEndPointReport);
556
- let MultiChannelCCEndPointGet = class MultiChannelCCEndPointGet2 extends MultiChannelCC {
557
- };
558
- MultiChannelCCEndPointGet = __decorate([
559
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.EndPointGet),
560
- (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCEndPointReport)
561
- ], MultiChannelCCEndPointGet);
562
- let MultiChannelCCCapabilityReport = MultiChannelCCCapabilityReport_1 = class MultiChannelCCCapabilityReport2 extends MultiChannelCC {
563
- constructor(options) {
564
- super(options);
565
- this.endpointIndex = options.endpointIndex;
566
- this.genericDeviceClass = options.genericDeviceClass;
567
- this.specificDeviceClass = options.specificDeviceClass;
568
- this.supportedCCs = options.supportedCCs;
569
- this.isDynamic = options.isDynamic;
570
- this.wasRemoved = options.wasRemoved;
571
- }
572
- static from(raw, ctx) {
573
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
574
- const endpointIndex = raw.payload[0] & 127;
575
- const isDynamic = !!(raw.payload[0] & 128);
576
- const NIF = (0, import_safe.parseApplicationNodeInformation)(raw.payload.subarray(1));
577
- const genericDeviceClass = NIF.genericDeviceClass;
578
- const specificDeviceClass = NIF.specificDeviceClass;
579
- const supportedCCs = NIF.supportedCCs;
580
- const wasRemoved = isDynamic && genericDeviceClass === 255 && specificDeviceClass === 0;
581
- return new MultiChannelCCCapabilityReport_1({
582
- nodeId: ctx.sourceNodeId,
583
- endpointIndex,
584
- isDynamic,
585
- genericDeviceClass,
586
- specificDeviceClass,
587
- supportedCCs,
588
- wasRemoved
589
- });
590
- }
591
- persistValues(ctx) {
592
- if (!super.persistValues(ctx))
593
- return false;
594
- const deviceClassValue = MultiChannelCCValues.endpointDeviceClass;
595
- const ccsValue = MultiChannelCCValues.endpointCCs;
596
- if (this.wasRemoved) {
597
- this.removeValue(ctx, deviceClassValue);
598
- this.removeValue(ctx, ccsValue);
599
- } else {
600
- this.setValue(ctx, deviceClassValue, {
601
- generic: this.genericDeviceClass,
602
- specific: this.specificDeviceClass
636
+ };
637
+ return MultiChannelCCEndPointGet2 = _classThis;
638
+ })();
639
+ let MultiChannelCCCapabilityReport = (() => {
640
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.CapabilityReport)];
641
+ let _classDescriptor;
642
+ let _classExtraInitializers = [];
643
+ let _classThis;
644
+ let _classSuper = MultiChannelCC;
645
+ var MultiChannelCCCapabilityReport2 = class extends _classSuper {
646
+ static {
647
+ _classThis = this;
648
+ }
649
+ static {
650
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
651
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
652
+ MultiChannelCCCapabilityReport2 = _classThis = _classDescriptor.value;
653
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
654
+ __runInitializers(_classThis, _classExtraInitializers);
655
+ }
656
+ constructor(options) {
657
+ super(options);
658
+ this.endpointIndex = options.endpointIndex;
659
+ this.genericDeviceClass = options.genericDeviceClass;
660
+ this.specificDeviceClass = options.specificDeviceClass;
661
+ this.supportedCCs = options.supportedCCs;
662
+ this.isDynamic = options.isDynamic;
663
+ this.wasRemoved = options.wasRemoved;
664
+ }
665
+ static from(raw, ctx) {
666
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
667
+ const endpointIndex = raw.payload[0] & 127;
668
+ const isDynamic = !!(raw.payload[0] & 128);
669
+ const NIF = (0, import_safe.parseApplicationNodeInformation)(raw.payload.subarray(1));
670
+ const genericDeviceClass = NIF.genericDeviceClass;
671
+ const specificDeviceClass = NIF.specificDeviceClass;
672
+ const supportedCCs = NIF.supportedCCs;
673
+ const wasRemoved = isDynamic && genericDeviceClass === 255 && specificDeviceClass === 0;
674
+ return new this({
675
+ nodeId: ctx.sourceNodeId,
676
+ endpointIndex,
677
+ isDynamic,
678
+ genericDeviceClass,
679
+ specificDeviceClass,
680
+ supportedCCs,
681
+ wasRemoved
603
682
  });
604
- this.setValue(ctx, ccsValue, this.supportedCCs);
605
683
  }
606
- return true;
607
- }
608
- // The endpoint index must be overridden to be able to attribute the information to the correct endpoint
609
- genericDeviceClass;
610
- specificDeviceClass;
611
- supportedCCs;
612
- isDynamic;
613
- wasRemoved;
614
- serialize(ctx) {
615
- this.payload = import_safe2.Bytes.concat([
616
- import_safe2.Bytes.from([
617
- this.endpointIndex & 127 | (this.isDynamic ? 128 : 0)
618
- ]),
619
- (0, import_safe.encodeApplicationNodeInformation)(this)
620
- ]);
621
- return super.serialize(ctx);
622
- }
623
- toLogEntry(ctx) {
624
- return {
625
- ...super.toLogEntry(ctx),
626
- message: {
627
- "endpoint index": this.endpointIndex,
628
- "generic device class": (0, import_safe.getGenericDeviceClass)(this.genericDeviceClass).label,
629
- "specific device class": (0, import_safe.getSpecificDeviceClass)(this.genericDeviceClass, this.specificDeviceClass).label,
630
- "is dynamic end point": this.isDynamic,
631
- "supported CCs": this.supportedCCs.map((cc) => `
632
- \xB7 ${(0, import_safe.getCCName)(cc)}`).join("")
684
+ persistValues(ctx) {
685
+ if (!super.persistValues(ctx))
686
+ return false;
687
+ const deviceClassValue = MultiChannelCCValues.endpointDeviceClass;
688
+ const ccsValue = MultiChannelCCValues.endpointCCs;
689
+ if (this.wasRemoved) {
690
+ this.removeValue(ctx, deviceClassValue);
691
+ this.removeValue(ctx, ccsValue);
692
+ } else {
693
+ this.setValue(ctx, deviceClassValue, {
694
+ generic: this.genericDeviceClass,
695
+ specific: this.specificDeviceClass
696
+ });
697
+ this.setValue(ctx, ccsValue, this.supportedCCs);
633
698
  }
634
- };
635
- }
636
- };
637
- MultiChannelCCCapabilityReport = MultiChannelCCCapabilityReport_1 = __decorate([
638
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.CapabilityReport)
639
- ], MultiChannelCCCapabilityReport);
699
+ return true;
700
+ }
701
+ // The endpoint index must be overridden to be able to attribute the information to the correct endpoint
702
+ genericDeviceClass;
703
+ specificDeviceClass;
704
+ supportedCCs;
705
+ isDynamic;
706
+ wasRemoved;
707
+ serialize(ctx) {
708
+ this.payload = import_safe2.Bytes.concat([
709
+ import_safe2.Bytes.from([
710
+ this.endpointIndex & 127 | (this.isDynamic ? 128 : 0)
711
+ ]),
712
+ (0, import_safe.encodeApplicationNodeInformation)(this)
713
+ ]);
714
+ return super.serialize(ctx);
715
+ }
716
+ toLogEntry(ctx) {
717
+ return {
718
+ ...super.toLogEntry(ctx),
719
+ message: {
720
+ "endpoint index": this.endpointIndex,
721
+ "generic device class": (0, import_safe.getGenericDeviceClass)(this.genericDeviceClass).label,
722
+ "specific device class": (0, import_safe.getSpecificDeviceClass)(this.genericDeviceClass, this.specificDeviceClass).label,
723
+ "is dynamic end point": this.isDynamic,
724
+ "supported CCs": this.supportedCCs.map((cc) => `
725
+ \xB7 ${(0, import_safe.getCCName)(cc)}`).join("")
726
+ }
727
+ };
728
+ }
729
+ };
730
+ return MultiChannelCCCapabilityReport2 = _classThis;
731
+ })();
640
732
  function testResponseForMultiChannelCapabilityGet(sent, received) {
641
733
  return received.endpointIndex === sent.requestedEndpoint;
642
734
  }
643
- let MultiChannelCCCapabilityGet = MultiChannelCCCapabilityGet_1 = class MultiChannelCCCapabilityGet2 extends MultiChannelCC {
644
- constructor(options) {
645
- super(options);
646
- this.requestedEndpoint = options.requestedEndpoint;
647
- }
648
- static from(raw, ctx) {
649
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
650
- const requestedEndpoint = raw.payload[0] & 127;
651
- return new MultiChannelCCCapabilityGet_1({
652
- nodeId: ctx.sourceNodeId,
653
- requestedEndpoint
654
- });
655
- }
656
- requestedEndpoint;
657
- serialize(ctx) {
658
- this.payload = import_safe2.Bytes.from([this.requestedEndpoint & 127]);
659
- return super.serialize(ctx);
660
- }
661
- toLogEntry(ctx) {
662
- return {
663
- ...super.toLogEntry(ctx),
664
- message: { endpoint: this.requestedEndpoint }
665
- };
666
- }
667
- };
668
- MultiChannelCCCapabilityGet = MultiChannelCCCapabilityGet_1 = __decorate([
669
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.CapabilityGet),
670
- (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCCapabilityReport, testResponseForMultiChannelCapabilityGet)
671
- ], MultiChannelCCCapabilityGet);
672
- let MultiChannelCCEndPointFindReport = MultiChannelCCEndPointFindReport_1 = class MultiChannelCCEndPointFindReport2 extends MultiChannelCC {
673
- constructor(options) {
674
- super(options);
675
- this.genericClass = options.genericClass;
676
- this.specificClass = options.specificClass;
677
- this.foundEndpoints = options.foundEndpoints;
678
- this.reportsToFollow = options.reportsToFollow;
679
- }
680
- static from(raw, ctx) {
681
- (0, import_safe.validatePayload)(raw.payload.length >= 3);
682
- const reportsToFollow = raw.payload[0];
683
- const genericClass = raw.payload[1];
684
- const specificClass = raw.payload[2];
685
- const foundEndpoints = [...raw.payload.subarray(3)].map((e) => e & 127).filter((e) => e !== 0);
686
- return new MultiChannelCCEndPointFindReport_1({
687
- nodeId: ctx.sourceNodeId,
688
- reportsToFollow,
689
- genericClass,
690
- specificClass,
691
- foundEndpoints
692
- });
693
- }
694
- genericClass;
695
- specificClass;
696
- foundEndpoints;
697
- reportsToFollow;
698
- serialize(ctx) {
699
- this.payload = import_safe2.Bytes.concat([
700
- import_safe2.Bytes.from([
701
- this.reportsToFollow,
702
- this.genericClass,
703
- this.specificClass
704
- ]),
705
- import_safe2.Bytes.from(this.foundEndpoints.map((e) => e & 127))
706
- ]);
707
- return super.serialize(ctx);
708
- }
709
- getPartialCCSessionId() {
710
- return {
711
- genericClass: this.genericClass,
712
- specificClass: this.specificClass
713
- };
714
- }
715
- expectMoreMessages() {
716
- return this.reportsToFollow > 0;
717
- }
718
- mergePartialCCs(partials, _ctx) {
719
- this.foundEndpoints = [...partials, this].map((report) => report.foundEndpoints).reduce((prev, cur) => prev.concat(...cur), []);
720
- }
721
- toLogEntry(ctx) {
722
- return {
723
- ...super.toLogEntry(ctx),
724
- message: {
725
- "generic device class": (0, import_safe.getGenericDeviceClass)(this.genericClass).label,
726
- "specific device class": (0, import_safe.getSpecificDeviceClass)(this.genericClass, this.specificClass).label,
727
- "found endpoints": this.foundEndpoints.join(", "),
728
- "# of reports to follow": this.reportsToFollow
729
- }
730
- };
731
- }
732
- };
733
- MultiChannelCCEndPointFindReport = MultiChannelCCEndPointFindReport_1 = __decorate([
734
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.EndPointFindReport)
735
- ], MultiChannelCCEndPointFindReport);
736
- let MultiChannelCCEndPointFind = MultiChannelCCEndPointFind_1 = class MultiChannelCCEndPointFind2 extends MultiChannelCC {
737
- constructor(options) {
738
- super(options);
739
- this.genericClass = options.genericClass;
740
- this.specificClass = options.specificClass;
741
- }
742
- static from(raw, ctx) {
743
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
744
- const genericClass = raw.payload[0];
745
- const specificClass = raw.payload[1];
746
- return new MultiChannelCCEndPointFind_1({
747
- nodeId: ctx.sourceNodeId,
748
- genericClass,
749
- specificClass
750
- });
751
- }
752
- genericClass;
753
- specificClass;
754
- serialize(ctx) {
755
- this.payload = import_safe2.Bytes.from([this.genericClass, this.specificClass]);
756
- return super.serialize(ctx);
757
- }
758
- toLogEntry(ctx) {
759
- return {
760
- ...super.toLogEntry(ctx),
761
- message: {
762
- "generic device class": (0, import_safe.getGenericDeviceClass)(this.genericClass).label,
763
- "specific device class": (0, import_safe.getSpecificDeviceClass)(this.genericClass, this.specificClass).label
764
- }
765
- };
766
- }
767
- };
768
- MultiChannelCCEndPointFind = MultiChannelCCEndPointFind_1 = __decorate([
769
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.EndPointFind),
770
- (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCEndPointFindReport)
771
- ], MultiChannelCCEndPointFind);
772
- let MultiChannelCCAggregatedMembersReport = MultiChannelCCAggregatedMembersReport_1 = class MultiChannelCCAggregatedMembersReport2 extends MultiChannelCC {
773
- constructor(options) {
774
- super(options);
775
- this.aggregatedEndpointIndex = options.aggregatedEndpointIndex;
776
- this.members = options.members;
777
- }
778
- static from(raw, ctx) {
779
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
780
- const aggregatedEndpointIndex = raw.payload[0] & 127;
781
- const bitMaskLength = raw.payload[1];
782
- (0, import_safe.validatePayload)(raw.payload.length >= 2 + bitMaskLength);
783
- const bitMask = raw.payload.subarray(2, 2 + bitMaskLength);
784
- const members = (0, import_safe.parseBitMask)(bitMask);
785
- return new MultiChannelCCAggregatedMembersReport_1({
786
- nodeId: ctx.sourceNodeId,
787
- aggregatedEndpointIndex,
788
- members
789
- });
790
- }
791
- aggregatedEndpointIndex;
792
- members;
793
- toLogEntry(ctx) {
794
- return {
795
- ...super.toLogEntry(ctx),
796
- message: {
797
- "aggregated endpoint": this.aggregatedEndpointIndex,
798
- members: this.members.join(", ")
799
- }
800
- };
801
- }
802
- };
803
- __decorate([
804
- (0, import_CommandClassDecorators.ccValue)(MultiChannelCCValues.aggregatedEndpointMembers, (self) => [self.aggregatedEndpointIndex])
805
- ], MultiChannelCCAggregatedMembersReport.prototype, "members", void 0);
806
- MultiChannelCCAggregatedMembersReport = MultiChannelCCAggregatedMembersReport_1 = __decorate([
807
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.AggregatedMembersReport)
808
- ], MultiChannelCCAggregatedMembersReport);
809
- let MultiChannelCCAggregatedMembersGet = class MultiChannelCCAggregatedMembersGet2 extends MultiChannelCC {
810
- constructor(options) {
811
- super(options);
812
- this.requestedEndpoint = options.requestedEndpoint;
813
- }
814
- static from(_raw, _ctx) {
815
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
816
- }
817
- requestedEndpoint;
818
- serialize(ctx) {
819
- this.payload = import_safe2.Bytes.from([this.requestedEndpoint & 127]);
820
- return super.serialize(ctx);
821
- }
822
- toLogEntry(ctx) {
823
- return {
824
- ...super.toLogEntry(ctx),
825
- message: { endpoint: this.requestedEndpoint }
826
- };
827
- }
828
- };
829
- MultiChannelCCAggregatedMembersGet = __decorate([
830
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.AggregatedMembersGet),
831
- (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCAggregatedMembersReport)
832
- ], MultiChannelCCAggregatedMembersGet);
735
+ let MultiChannelCCCapabilityGet = (() => {
736
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.CapabilityGet), (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCCapabilityReport, testResponseForMultiChannelCapabilityGet)];
737
+ let _classDescriptor;
738
+ let _classExtraInitializers = [];
739
+ let _classThis;
740
+ let _classSuper = MultiChannelCC;
741
+ var MultiChannelCCCapabilityGet2 = class extends _classSuper {
742
+ static {
743
+ _classThis = this;
744
+ }
745
+ static {
746
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
747
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
748
+ MultiChannelCCCapabilityGet2 = _classThis = _classDescriptor.value;
749
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
750
+ __runInitializers(_classThis, _classExtraInitializers);
751
+ }
752
+ constructor(options) {
753
+ super(options);
754
+ this.requestedEndpoint = options.requestedEndpoint;
755
+ }
756
+ static from(raw, ctx) {
757
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
758
+ const requestedEndpoint = raw.payload[0] & 127;
759
+ return new this({
760
+ nodeId: ctx.sourceNodeId,
761
+ requestedEndpoint
762
+ });
763
+ }
764
+ requestedEndpoint;
765
+ serialize(ctx) {
766
+ this.payload = import_safe2.Bytes.from([this.requestedEndpoint & 127]);
767
+ return super.serialize(ctx);
768
+ }
769
+ toLogEntry(ctx) {
770
+ return {
771
+ ...super.toLogEntry(ctx),
772
+ message: { endpoint: this.requestedEndpoint }
773
+ };
774
+ }
775
+ };
776
+ return MultiChannelCCCapabilityGet2 = _classThis;
777
+ })();
778
+ let MultiChannelCCEndPointFindReport = (() => {
779
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.EndPointFindReport)];
780
+ let _classDescriptor;
781
+ let _classExtraInitializers = [];
782
+ let _classThis;
783
+ let _classSuper = MultiChannelCC;
784
+ var MultiChannelCCEndPointFindReport2 = class extends _classSuper {
785
+ static {
786
+ _classThis = this;
787
+ }
788
+ static {
789
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
790
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
791
+ MultiChannelCCEndPointFindReport2 = _classThis = _classDescriptor.value;
792
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
793
+ __runInitializers(_classThis, _classExtraInitializers);
794
+ }
795
+ constructor(options) {
796
+ super(options);
797
+ this.genericClass = options.genericClass;
798
+ this.specificClass = options.specificClass;
799
+ this.foundEndpoints = options.foundEndpoints;
800
+ this.reportsToFollow = options.reportsToFollow;
801
+ }
802
+ static from(raw, ctx) {
803
+ (0, import_safe.validatePayload)(raw.payload.length >= 3);
804
+ const reportsToFollow = raw.payload[0];
805
+ const genericClass = raw.payload[1];
806
+ const specificClass = raw.payload[2];
807
+ const foundEndpoints = [...raw.payload.subarray(3)].map((e) => e & 127).filter((e) => e !== 0);
808
+ return new this({
809
+ nodeId: ctx.sourceNodeId,
810
+ reportsToFollow,
811
+ genericClass,
812
+ specificClass,
813
+ foundEndpoints
814
+ });
815
+ }
816
+ genericClass;
817
+ specificClass;
818
+ foundEndpoints;
819
+ reportsToFollow;
820
+ serialize(ctx) {
821
+ this.payload = import_safe2.Bytes.concat([
822
+ import_safe2.Bytes.from([
823
+ this.reportsToFollow,
824
+ this.genericClass,
825
+ this.specificClass
826
+ ]),
827
+ import_safe2.Bytes.from(this.foundEndpoints.map((e) => e & 127))
828
+ ]);
829
+ return super.serialize(ctx);
830
+ }
831
+ getPartialCCSessionId() {
832
+ return {
833
+ genericClass: this.genericClass,
834
+ specificClass: this.specificClass
835
+ };
836
+ }
837
+ expectMoreMessages() {
838
+ return this.reportsToFollow > 0;
839
+ }
840
+ mergePartialCCs(partials, _ctx) {
841
+ this.foundEndpoints = [...partials, this].map((report) => report.foundEndpoints).reduce((prev, cur) => prev.concat(...cur), []);
842
+ }
843
+ toLogEntry(ctx) {
844
+ return {
845
+ ...super.toLogEntry(ctx),
846
+ message: {
847
+ "generic device class": (0, import_safe.getGenericDeviceClass)(this.genericClass).label,
848
+ "specific device class": (0, import_safe.getSpecificDeviceClass)(this.genericClass, this.specificClass).label,
849
+ "found endpoints": this.foundEndpoints.join(", "),
850
+ "# of reports to follow": this.reportsToFollow
851
+ }
852
+ };
853
+ }
854
+ };
855
+ return MultiChannelCCEndPointFindReport2 = _classThis;
856
+ })();
857
+ let MultiChannelCCEndPointFind = (() => {
858
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.EndPointFind), (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCEndPointFindReport)];
859
+ let _classDescriptor;
860
+ let _classExtraInitializers = [];
861
+ let _classThis;
862
+ let _classSuper = MultiChannelCC;
863
+ var MultiChannelCCEndPointFind2 = class extends _classSuper {
864
+ static {
865
+ _classThis = this;
866
+ }
867
+ static {
868
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
869
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
870
+ MultiChannelCCEndPointFind2 = _classThis = _classDescriptor.value;
871
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
872
+ __runInitializers(_classThis, _classExtraInitializers);
873
+ }
874
+ constructor(options) {
875
+ super(options);
876
+ this.genericClass = options.genericClass;
877
+ this.specificClass = options.specificClass;
878
+ }
879
+ static from(raw, ctx) {
880
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
881
+ const genericClass = raw.payload[0];
882
+ const specificClass = raw.payload[1];
883
+ return new this({
884
+ nodeId: ctx.sourceNodeId,
885
+ genericClass,
886
+ specificClass
887
+ });
888
+ }
889
+ genericClass;
890
+ specificClass;
891
+ serialize(ctx) {
892
+ this.payload = import_safe2.Bytes.from([this.genericClass, this.specificClass]);
893
+ return super.serialize(ctx);
894
+ }
895
+ toLogEntry(ctx) {
896
+ return {
897
+ ...super.toLogEntry(ctx),
898
+ message: {
899
+ "generic device class": (0, import_safe.getGenericDeviceClass)(this.genericClass).label,
900
+ "specific device class": (0, import_safe.getSpecificDeviceClass)(this.genericClass, this.specificClass).label
901
+ }
902
+ };
903
+ }
904
+ };
905
+ return MultiChannelCCEndPointFind2 = _classThis;
906
+ })();
907
+ let MultiChannelCCAggregatedMembersReport = (() => {
908
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.AggregatedMembersReport), (0, import_CommandClassDecorators.ccValueProperty)("members", MultiChannelCCValues.aggregatedEndpointMembers, (self) => [self.aggregatedEndpointIndex])];
909
+ let _classDescriptor;
910
+ let _classExtraInitializers = [];
911
+ let _classThis;
912
+ let _classSuper = MultiChannelCC;
913
+ var MultiChannelCCAggregatedMembersReport2 = class extends _classSuper {
914
+ static {
915
+ _classThis = this;
916
+ }
917
+ static {
918
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
919
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
920
+ MultiChannelCCAggregatedMembersReport2 = _classThis = _classDescriptor.value;
921
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
922
+ __runInitializers(_classThis, _classExtraInitializers);
923
+ }
924
+ constructor(options) {
925
+ super(options);
926
+ this.aggregatedEndpointIndex = options.aggregatedEndpointIndex;
927
+ this.members = options.members;
928
+ }
929
+ static from(raw, ctx) {
930
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
931
+ const aggregatedEndpointIndex = raw.payload[0] & 127;
932
+ const bitMaskLength = raw.payload[1];
933
+ (0, import_safe.validatePayload)(raw.payload.length >= 2 + bitMaskLength);
934
+ const bitMask = raw.payload.subarray(2, 2 + bitMaskLength);
935
+ const members = (0, import_safe.parseBitMask)(bitMask);
936
+ return new this({
937
+ nodeId: ctx.sourceNodeId,
938
+ aggregatedEndpointIndex,
939
+ members
940
+ });
941
+ }
942
+ aggregatedEndpointIndex;
943
+ members;
944
+ toLogEntry(ctx) {
945
+ return {
946
+ ...super.toLogEntry(ctx),
947
+ message: {
948
+ "aggregated endpoint": this.aggregatedEndpointIndex,
949
+ members: this.members.join(", ")
950
+ }
951
+ };
952
+ }
953
+ };
954
+ return MultiChannelCCAggregatedMembersReport2 = _classThis;
955
+ })();
956
+ let MultiChannelCCAggregatedMembersGet = (() => {
957
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.AggregatedMembersGet), (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCAggregatedMembersReport)];
958
+ let _classDescriptor;
959
+ let _classExtraInitializers = [];
960
+ let _classThis;
961
+ let _classSuper = MultiChannelCC;
962
+ var MultiChannelCCAggregatedMembersGet2 = class extends _classSuper {
963
+ static {
964
+ _classThis = this;
965
+ }
966
+ static {
967
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
968
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
969
+ MultiChannelCCAggregatedMembersGet2 = _classThis = _classDescriptor.value;
970
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
971
+ __runInitializers(_classThis, _classExtraInitializers);
972
+ }
973
+ constructor(options) {
974
+ super(options);
975
+ this.requestedEndpoint = options.requestedEndpoint;
976
+ }
977
+ static from(_raw, _ctx) {
978
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
979
+ }
980
+ requestedEndpoint;
981
+ serialize(ctx) {
982
+ this.payload = import_safe2.Bytes.from([this.requestedEndpoint & 127]);
983
+ return super.serialize(ctx);
984
+ }
985
+ toLogEntry(ctx) {
986
+ return {
987
+ ...super.toLogEntry(ctx),
988
+ message: { endpoint: this.requestedEndpoint }
989
+ };
990
+ }
991
+ };
992
+ return MultiChannelCCAggregatedMembersGet2 = _classThis;
993
+ })();
833
994
  function getCCResponseForCommandEncapsulation(sent) {
834
995
  if (typeof sent.destination === "number" && sent.encapsulated.expectsCCResponse()) {
835
996
  return [
@@ -844,141 +1005,184 @@ function testResponseForCommandEncapsulation(sent, received) {
844
1005
  }
845
1006
  return false;
846
1007
  }
847
- let MultiChannelCCCommandEncapsulation = MultiChannelCCCommandEncapsulation_1 = class MultiChannelCCCommandEncapsulation2 extends MultiChannelCC {
848
- constructor(options) {
849
- super(options);
850
- this.encapsulated = options.encapsulated;
851
- this.encapsulated.encapsulatingCC = this;
852
- let cur = this;
853
- while (cur) {
854
- if ((0, import_EncapsulatingCommandClass.isMultiEncapsulatingCommandClass)(cur)) {
855
- for (const cc of cur.encapsulated) {
856
- cc.endpointIndex = this.endpointIndex;
1008
+ let MultiChannelCCCommandEncapsulation = (() => {
1009
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.CommandEncapsulation), (0, import_CommandClassDecorators.expectedCCResponse)(getCCResponseForCommandEncapsulation, testResponseForCommandEncapsulation)];
1010
+ let _classDescriptor;
1011
+ let _classExtraInitializers = [];
1012
+ let _classThis;
1013
+ let _classSuper = MultiChannelCC;
1014
+ var MultiChannelCCCommandEncapsulation2 = class extends _classSuper {
1015
+ static {
1016
+ _classThis = this;
1017
+ }
1018
+ static {
1019
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1020
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1021
+ MultiChannelCCCommandEncapsulation2 = _classThis = _classDescriptor.value;
1022
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1023
+ __runInitializers(_classThis, _classExtraInitializers);
1024
+ }
1025
+ constructor(options) {
1026
+ super(options);
1027
+ this.encapsulated = options.encapsulated;
1028
+ this.encapsulated.encapsulatingCC = this;
1029
+ let cur = this;
1030
+ while (cur) {
1031
+ if ((0, import_EncapsulatingCommandClass.isMultiEncapsulatingCommandClass)(cur)) {
1032
+ for (const cc of cur.encapsulated) {
1033
+ cc.endpointIndex = this.endpointIndex;
1034
+ }
1035
+ break;
1036
+ } else if ((0, import_EncapsulatingCommandClass.isEncapsulatingCommandClass)(cur)) {
1037
+ cur.encapsulated.endpointIndex = this.endpointIndex;
1038
+ cur = cur.encapsulated;
1039
+ } else {
1040
+ break;
857
1041
  }
858
- break;
859
- } else if ((0, import_EncapsulatingCommandClass.isEncapsulatingCommandClass)(cur)) {
860
- cur.encapsulated.endpointIndex = this.endpointIndex;
861
- cur = cur.encapsulated;
862
- } else {
863
- break;
864
1042
  }
1043
+ this.destination = options.destination;
865
1044
  }
866
- this.destination = options.destination;
867
- }
868
- static from(raw, ctx) {
869
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
870
- let endpointIndex;
871
- let destination;
872
- if (ctx.getDeviceConfig?.(ctx.sourceNodeId)?.compat?.treatDestinationEndpointAsSource) {
873
- endpointIndex = raw.payload[1] & 127;
874
- destination = 0;
875
- } else {
876
- endpointIndex = raw.payload[0] & 127;
877
- const isBitMask = !!(raw.payload[1] & 128);
878
- destination = raw.payload[1] & 127;
879
- if (isBitMask) {
880
- destination = (0, import_safe.parseBitMask)(import_safe2.Bytes.from([destination]));
1045
+ static from(raw, ctx) {
1046
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
1047
+ let endpointIndex;
1048
+ let destination;
1049
+ if (ctx.getDeviceConfig?.(ctx.sourceNodeId)?.compat?.treatDestinationEndpointAsSource) {
1050
+ endpointIndex = raw.payload[1] & 127;
1051
+ destination = 0;
1052
+ } else {
1053
+ endpointIndex = raw.payload[0] & 127;
1054
+ const isBitMask = !!(raw.payload[1] & 128);
1055
+ destination = raw.payload[1] & 127;
1056
+ if (isBitMask) {
1057
+ destination = (0, import_safe.parseBitMask)(import_safe2.Bytes.from([destination]));
1058
+ }
881
1059
  }
1060
+ const encapsulated = import_CommandClass.CommandClass.parse(raw.payload.subarray(2), ctx);
1061
+ return new this({
1062
+ nodeId: ctx.sourceNodeId,
1063
+ endpointIndex,
1064
+ destination,
1065
+ encapsulated
1066
+ });
882
1067
  }
883
- const encapsulated = import_CommandClass.CommandClass.parse(raw.payload.subarray(2), ctx);
884
- return new MultiChannelCCCommandEncapsulation_1({
885
- nodeId: ctx.sourceNodeId,
886
- endpointIndex,
887
- destination,
888
- encapsulated
889
- });
890
- }
891
- encapsulated;
892
- /** The destination end point (0-127) or an array of destination end points (1-7) */
893
- destination;
894
- serialize(ctx) {
895
- if (ctx.getDeviceConfig?.(this.nodeId)?.compat?.treatDestinationEndpointAsSource) {
896
- if (typeof this.destination === "number") {
897
- this.endpointIndex = this.destination;
1068
+ encapsulated;
1069
+ /** The destination end point (0-127) or an array of destination end points (1-7) */
1070
+ destination;
1071
+ serialize(ctx) {
1072
+ if (ctx.getDeviceConfig?.(this.nodeId)?.compat?.treatDestinationEndpointAsSource) {
1073
+ if (typeof this.destination === "number") {
1074
+ this.endpointIndex = this.destination;
1075
+ }
898
1076
  }
1077
+ const destination = typeof this.destination === "number" ? this.destination & 127 : (0, import_safe.encodeBitMask)(this.destination, 7)[0] | 128;
1078
+ this.payload = import_safe2.Bytes.concat([
1079
+ import_safe2.Bytes.from([this.endpointIndex & 127, destination]),
1080
+ this.encapsulated.serialize(ctx)
1081
+ ]);
1082
+ return super.serialize(ctx);
899
1083
  }
900
- const destination = typeof this.destination === "number" ? this.destination & 127 : (0, import_safe.encodeBitMask)(this.destination, 7)[0] | 128;
901
- this.payload = import_safe2.Bytes.concat([
902
- import_safe2.Bytes.from([this.endpointIndex & 127, destination]),
903
- this.encapsulated.serialize(ctx)
904
- ]);
905
- return super.serialize(ctx);
906
- }
907
- toLogEntry(ctx) {
908
- return {
909
- ...super.toLogEntry(ctx),
910
- message: {
911
- source: this.endpointIndex,
912
- destination: typeof this.destination === "number" ? this.destination : this.destination.join(", ")
913
- }
914
- };
915
- }
916
- computeEncapsulationOverhead() {
917
- return super.computeEncapsulationOverhead() + 2;
918
- }
919
- };
920
- MultiChannelCCCommandEncapsulation = MultiChannelCCCommandEncapsulation_1 = __decorate([
921
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.CommandEncapsulation),
922
- (0, import_CommandClassDecorators.expectedCCResponse)(getCCResponseForCommandEncapsulation, testResponseForCommandEncapsulation)
923
- ], MultiChannelCCCommandEncapsulation);
924
- let MultiChannelCCV1Report = MultiChannelCCV1Report_1 = class MultiChannelCCV1Report2 extends MultiChannelCC {
925
- constructor(options) {
926
- super(options);
927
- this.requestedCC = options.requestedCC;
928
- this.endpointCount = options.endpointCount;
929
- }
930
- static from(raw, ctx) {
931
- (0, import_safe.validatePayload)(raw.payload.length === 2);
932
- const requestedCC = raw.payload[0];
933
- const endpointCount = raw.payload[1];
934
- return new MultiChannelCCV1Report_1({
935
- nodeId: ctx.sourceNodeId,
936
- requestedCC,
937
- endpointCount
938
- });
939
- }
940
- requestedCC;
941
- endpointCount;
942
- toLogEntry(ctx) {
943
- return {
944
- ...super.toLogEntry(ctx),
945
- message: {
946
- CC: (0, import_safe.getCCName)(this.requestedCC),
947
- "# of endpoints": this.endpointCount
948
- }
949
- };
950
- }
951
- };
952
- MultiChannelCCV1Report = MultiChannelCCV1Report_1 = __decorate([
953
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.ReportV1)
954
- ], MultiChannelCCV1Report);
1084
+ toLogEntry(ctx) {
1085
+ return {
1086
+ ...super.toLogEntry(ctx),
1087
+ message: {
1088
+ source: this.endpointIndex,
1089
+ destination: typeof this.destination === "number" ? this.destination : this.destination.join(", ")
1090
+ }
1091
+ };
1092
+ }
1093
+ computeEncapsulationOverhead() {
1094
+ return super.computeEncapsulationOverhead() + 2;
1095
+ }
1096
+ };
1097
+ return MultiChannelCCCommandEncapsulation2 = _classThis;
1098
+ })();
1099
+ let MultiChannelCCV1Report = (() => {
1100
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.ReportV1)];
1101
+ let _classDescriptor;
1102
+ let _classExtraInitializers = [];
1103
+ let _classThis;
1104
+ let _classSuper = MultiChannelCC;
1105
+ var MultiChannelCCV1Report2 = class extends _classSuper {
1106
+ static {
1107
+ _classThis = this;
1108
+ }
1109
+ static {
1110
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1111
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1112
+ MultiChannelCCV1Report2 = _classThis = _classDescriptor.value;
1113
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1114
+ __runInitializers(_classThis, _classExtraInitializers);
1115
+ }
1116
+ constructor(options) {
1117
+ super(options);
1118
+ this.requestedCC = options.requestedCC;
1119
+ this.endpointCount = options.endpointCount;
1120
+ }
1121
+ static from(raw, ctx) {
1122
+ (0, import_safe.validatePayload)(raw.payload.length === 2);
1123
+ const requestedCC = raw.payload[0];
1124
+ const endpointCount = raw.payload[1];
1125
+ return new this({
1126
+ nodeId: ctx.sourceNodeId,
1127
+ requestedCC,
1128
+ endpointCount
1129
+ });
1130
+ }
1131
+ requestedCC;
1132
+ endpointCount;
1133
+ toLogEntry(ctx) {
1134
+ return {
1135
+ ...super.toLogEntry(ctx),
1136
+ message: {
1137
+ CC: (0, import_safe.getCCName)(this.requestedCC),
1138
+ "# of endpoints": this.endpointCount
1139
+ }
1140
+ };
1141
+ }
1142
+ };
1143
+ return MultiChannelCCV1Report2 = _classThis;
1144
+ })();
955
1145
  function testResponseForMultiChannelV1Get(sent, received) {
956
1146
  return sent.requestedCC === received.requestedCC;
957
1147
  }
958
- let MultiChannelCCV1Get = class MultiChannelCCV1Get2 extends MultiChannelCC {
959
- constructor(options) {
960
- super(options);
961
- this.requestedCC = options.requestedCC;
962
- }
963
- static from(_raw, _ctx) {
964
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
965
- }
966
- requestedCC;
967
- serialize(ctx) {
968
- this.payload = import_safe2.Bytes.from([this.requestedCC]);
969
- return super.serialize(ctx);
970
- }
971
- toLogEntry(ctx) {
972
- return {
973
- ...super.toLogEntry(ctx),
974
- message: { CC: (0, import_safe.getCCName)(this.requestedCC) }
975
- };
976
- }
977
- };
978
- MultiChannelCCV1Get = __decorate([
979
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.GetV1),
980
- (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCV1Report, testResponseForMultiChannelV1Get)
981
- ], MultiChannelCCV1Get);
1148
+ let MultiChannelCCV1Get = (() => {
1149
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.GetV1), (0, import_CommandClassDecorators.expectedCCResponse)(MultiChannelCCV1Report, testResponseForMultiChannelV1Get)];
1150
+ let _classDescriptor;
1151
+ let _classExtraInitializers = [];
1152
+ let _classThis;
1153
+ let _classSuper = MultiChannelCC;
1154
+ var MultiChannelCCV1Get2 = class extends _classSuper {
1155
+ static {
1156
+ _classThis = this;
1157
+ }
1158
+ static {
1159
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1160
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1161
+ MultiChannelCCV1Get2 = _classThis = _classDescriptor.value;
1162
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1163
+ __runInitializers(_classThis, _classExtraInitializers);
1164
+ }
1165
+ constructor(options) {
1166
+ super(options);
1167
+ this.requestedCC = options.requestedCC;
1168
+ }
1169
+ static from(_raw, _ctx) {
1170
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1171
+ }
1172
+ requestedCC;
1173
+ serialize(ctx) {
1174
+ this.payload = import_safe2.Bytes.from([this.requestedCC]);
1175
+ return super.serialize(ctx);
1176
+ }
1177
+ toLogEntry(ctx) {
1178
+ return {
1179
+ ...super.toLogEntry(ctx),
1180
+ message: { CC: (0, import_safe.getCCName)(this.requestedCC) }
1181
+ };
1182
+ }
1183
+ };
1184
+ return MultiChannelCCV1Get2 = _classThis;
1185
+ })();
982
1186
  function getResponseForV1CommandEncapsulation(sent) {
983
1187
  if (sent.encapsulated.expectsCCResponse()) {
984
1188
  return MultiChannelCCV1CommandEncapsulation;
@@ -990,45 +1194,59 @@ function testResponseForV1CommandEncapsulation(sent, received) {
990
1194
  }
991
1195
  return false;
992
1196
  }
993
- let MultiChannelCCV1CommandEncapsulation = MultiChannelCCV1CommandEncapsulation_1 = class MultiChannelCCV1CommandEncapsulation2 extends MultiChannelCC {
994
- constructor(options) {
995
- super(options);
996
- this.encapsulated = options.encapsulated;
997
- this.endpointIndex = this.encapsulated.endpointIndex;
998
- }
999
- static from(raw, ctx) {
1000
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
1001
- const endpointIndex = raw.payload[0];
1002
- const isV2withV1Header = raw.payload.length >= 2 && raw.payload[1] === 0;
1003
- const encapsulated = import_CommandClass.CommandClass.parse(raw.payload.subarray(isV2withV1Header ? 2 : 1), ctx);
1004
- return new MultiChannelCCV1CommandEncapsulation_1({
1005
- nodeId: ctx.sourceNodeId,
1006
- endpointIndex,
1007
- encapsulated
1008
- });
1009
- }
1010
- encapsulated;
1011
- serialize(ctx) {
1012
- this.payload = import_safe2.Bytes.concat([
1013
- import_safe2.Bytes.from([this.endpointIndex]),
1014
- this.encapsulated.serialize(ctx)
1015
- ]);
1016
- return super.serialize(ctx);
1017
- }
1018
- computeEncapsulationOverhead() {
1019
- return super.computeEncapsulationOverhead() + 1;
1020
- }
1021
- toLogEntry(ctx) {
1022
- return {
1023
- ...super.toLogEntry(ctx),
1024
- message: { source: this.endpointIndex }
1025
- };
1026
- }
1027
- };
1028
- MultiChannelCCV1CommandEncapsulation = MultiChannelCCV1CommandEncapsulation_1 = __decorate([
1029
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.CommandEncapsulationV1),
1030
- (0, import_CommandClassDecorators.expectedCCResponse)(getResponseForV1CommandEncapsulation, testResponseForV1CommandEncapsulation)
1031
- ], MultiChannelCCV1CommandEncapsulation);
1197
+ let MultiChannelCCV1CommandEncapsulation = (() => {
1198
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultiChannelCommand.CommandEncapsulationV1), (0, import_CommandClassDecorators.expectedCCResponse)(getResponseForV1CommandEncapsulation, testResponseForV1CommandEncapsulation)];
1199
+ let _classDescriptor;
1200
+ let _classExtraInitializers = [];
1201
+ let _classThis;
1202
+ let _classSuper = MultiChannelCC;
1203
+ var MultiChannelCCV1CommandEncapsulation2 = class extends _classSuper {
1204
+ static {
1205
+ _classThis = this;
1206
+ }
1207
+ static {
1208
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1209
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1210
+ MultiChannelCCV1CommandEncapsulation2 = _classThis = _classDescriptor.value;
1211
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1212
+ __runInitializers(_classThis, _classExtraInitializers);
1213
+ }
1214
+ constructor(options) {
1215
+ super(options);
1216
+ this.encapsulated = options.encapsulated;
1217
+ this.endpointIndex = this.encapsulated.endpointIndex;
1218
+ }
1219
+ static from(raw, ctx) {
1220
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
1221
+ const endpointIndex = raw.payload[0];
1222
+ const isV2withV1Header = raw.payload.length >= 2 && raw.payload[1] === 0;
1223
+ const encapsulated = import_CommandClass.CommandClass.parse(raw.payload.subarray(isV2withV1Header ? 2 : 1), ctx);
1224
+ return new this({
1225
+ nodeId: ctx.sourceNodeId,
1226
+ endpointIndex,
1227
+ encapsulated
1228
+ });
1229
+ }
1230
+ encapsulated;
1231
+ serialize(ctx) {
1232
+ this.payload = import_safe2.Bytes.concat([
1233
+ import_safe2.Bytes.from([this.endpointIndex]),
1234
+ this.encapsulated.serialize(ctx)
1235
+ ]);
1236
+ return super.serialize(ctx);
1237
+ }
1238
+ computeEncapsulationOverhead() {
1239
+ return super.computeEncapsulationOverhead() + 1;
1240
+ }
1241
+ toLogEntry(ctx) {
1242
+ return {
1243
+ ...super.toLogEntry(ctx),
1244
+ message: { source: this.endpointIndex }
1245
+ };
1246
+ }
1247
+ };
1248
+ return MultiChannelCCV1CommandEncapsulation2 = _classThis;
1249
+ })();
1032
1250
  // Annotate the CommonJS export names for ESM import in node:
1033
1251
  0 && (module.exports = {
1034
1252
  MultiChannelCC,