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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +381 -266
  2. package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
  3. package/build/cjs/cc/AssociationCC.js +669 -503
  4. package/build/cjs/cc/AssociationCC.js.map +3 -3
  5. package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
  6. package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
  7. package/build/cjs/cc/BarrierOperatorCC.js +595 -429
  8. package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
  9. package/build/cjs/cc/BasicCC.js +354 -260
  10. package/build/cjs/cc/BasicCC.js.map +3 -3
  11. package/build/cjs/cc/BatteryCC.js +427 -345
  12. package/build/cjs/cc/BatteryCC.js.map +3 -3
  13. package/build/cjs/cc/BinarySensorCC.js +391 -276
  14. package/build/cjs/cc/BinarySensorCC.js.map +3 -3
  15. package/build/cjs/cc/BinarySwitchCC.js +347 -253
  16. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  17. package/build/cjs/cc/CRC16CC.js +160 -85
  18. package/build/cjs/cc/CRC16CC.js.map +3 -3
  19. package/build/cjs/cc/CentralSceneCC.js +459 -324
  20. package/build/cjs/cc/CentralSceneCC.js.map +3 -3
  21. package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
  23. package/build/cjs/cc/ClockCC.js +254 -150
  24. package/build/cjs/cc/ClockCC.js.map +3 -3
  25. package/build/cjs/cc/ColorSwitchCC.js +758 -610
  26. package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
  27. package/build/cjs/cc/ConfigurationCC.js +1700 -1453
  28. package/build/cjs/cc/ConfigurationCC.js.map +3 -3
  29. package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
  30. package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
  31. package/build/cjs/cc/DoorLockCC.js +904 -777
  32. package/build/cjs/cc/DoorLockCC.js.map +3 -3
  33. package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
  34. package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
  35. package/build/cjs/cc/EnergyProductionCC.js +249 -160
  36. package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
  37. package/build/cjs/cc/EntryControlCC.js +619 -458
  38. package/build/cjs/cc/EntryControlCC.js.map +3 -3
  39. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
  40. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
  41. package/build/cjs/cc/HailCC.js +57 -11
  42. package/build/cjs/cc/HailCC.js.map +2 -2
  43. package/build/cjs/cc/HumidityControlModeCC.js +359 -233
  44. package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
  45. package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
  46. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
  47. package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
  48. package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
  49. package/build/cjs/cc/InclusionControllerCC.js +205 -114
  50. package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
  51. package/build/cjs/cc/IndicatorCC.js +897 -736
  52. package/build/cjs/cc/IndicatorCC.js.map +3 -3
  53. package/build/cjs/cc/IrrigationCC.js +1651 -1405
  54. package/build/cjs/cc/IrrigationCC.js.map +3 -3
  55. package/build/cjs/cc/LanguageCC.js +268 -171
  56. package/build/cjs/cc/LanguageCC.js.map +3 -3
  57. package/build/cjs/cc/LockCC.js +254 -154
  58. package/build/cjs/cc/LockCC.js.map +3 -3
  59. package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
  60. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  61. package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
  62. package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
  63. package/build/cjs/cc/MeterCC.js +827 -707
  64. package/build/cjs/cc/MeterCC.js.map +3 -3
  65. package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
  66. package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
  67. package/build/cjs/cc/MultiChannelCC.js +1037 -819
  68. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  69. package/build/cjs/cc/MultiCommandCC.js +172 -97
  70. package/build/cjs/cc/MultiCommandCC.js.map +3 -3
  71. package/build/cjs/cc/MultilevelSensorCC.js +589 -449
  72. package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
  73. package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
  74. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  75. package/build/cjs/cc/NoOperationCC.js +89 -27
  76. package/build/cjs/cc/NoOperationCC.js.map +2 -2
  77. package/build/cjs/cc/NodeNamingCC.js +417 -277
  78. package/build/cjs/cc/NodeNamingCC.js.map +3 -3
  79. package/build/cjs/cc/NotificationCC.js +972 -818
  80. package/build/cjs/cc/NotificationCC.js.map +3 -3
  81. package/build/cjs/cc/PowerlevelCC.js +450 -303
  82. package/build/cjs/cc/PowerlevelCC.js.map +3 -3
  83. package/build/cjs/cc/ProtectionCC.js +686 -494
  84. package/build/cjs/cc/ProtectionCC.js.map +3 -3
  85. package/build/cjs/cc/SceneActivationCC.js +165 -97
  86. package/build/cjs/cc/SceneActivationCC.js.map +3 -3
  87. package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
  88. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
  89. package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
  90. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
  91. package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
  92. package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
  93. package/build/cjs/cc/Security2CC.js +1483 -1219
  94. package/build/cjs/cc/Security2CC.js.map +3 -3
  95. package/build/cjs/cc/SecurityCC.js +839 -619
  96. package/build/cjs/cc/SecurityCC.js.map +3 -3
  97. package/build/cjs/cc/SoundSwitchCC.js +707 -515
  98. package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
  99. package/build/cjs/cc/SupervisionCC.js +327 -237
  100. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  101. package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
  102. package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
  103. package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
  104. package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
  105. package/build/cjs/cc/ThermostatModeCC.js +425 -302
  106. package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
  107. package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
  108. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
  109. package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
  110. package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
  111. package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
  112. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  113. package/build/cjs/cc/TimeCC.js +515 -353
  114. package/build/cjs/cc/TimeCC.js.map +3 -3
  115. package/build/cjs/cc/TimeParametersCC.js +302 -202
  116. package/build/cjs/cc/TimeParametersCC.js.map +3 -3
  117. package/build/cjs/cc/TransportServiceCC.js +433 -315
  118. package/build/cjs/cc/TransportServiceCC.js.map +3 -3
  119. package/build/cjs/cc/UserCodeCC.js +1385 -1102
  120. package/build/cjs/cc/UserCodeCC.js.map +3 -3
  121. package/build/cjs/cc/VersionCC.js +696 -562
  122. package/build/cjs/cc/VersionCC.js.map +3 -3
  123. package/build/cjs/cc/WakeUpCC.js +499 -346
  124. package/build/cjs/cc/WakeUpCC.js.map +3 -3
  125. package/build/cjs/cc/WindowCoveringCC.js +626 -478
  126. package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
  127. package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
  128. package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
  129. package/build/cjs/cc/ZWavePlusCC.js +233 -159
  130. package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
  131. package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
  132. package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
  133. package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  134. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
  135. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
  136. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
  137. package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
  138. package/build/cjs/lib/CommandClassDecorators.js +19 -20
  139. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  140. package/build/cjs/lib/Security2/Extension.d.ts +1 -1
  141. package/build/cjs/lib/Security2/Extension.js +217 -126
  142. package/build/cjs/lib/Security2/Extension.js.map +3 -3
  143. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  144. package/build/esm/cc/AlarmSensorCC.js +389 -291
  145. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  146. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  147. package/build/esm/cc/AssociationCC.js +678 -537
  148. package/build/esm/cc/AssociationCC.js.map +1 -1
  149. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  150. package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
  151. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  152. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  153. package/build/esm/cc/BarrierOperatorCC.js +634 -493
  154. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  155. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  156. package/build/esm/cc/BasicCC.js +380 -302
  157. package/build/esm/cc/BasicCC.js.map +1 -1
  158. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  159. package/build/esm/cc/BatteryCC.js +449 -384
  160. package/build/esm/cc/BatteryCC.js.map +1 -1
  161. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  162. package/build/esm/cc/BinarySensorCC.js +395 -297
  163. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  164. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  165. package/build/esm/cc/BinarySwitchCC.js +353 -274
  166. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  167. package/build/esm/cc/CRC16CC.js +162 -98
  168. package/build/esm/cc/CRC16CC.js.map +1 -1
  169. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  170. package/build/esm/cc/CentralSceneCC.js +465 -351
  171. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  172. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  173. package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
  174. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  175. package/build/esm/cc/ClockCC.js +248 -159
  176. package/build/esm/cc/ClockCC.js.map +1 -1
  177. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  178. package/build/esm/cc/ColorSwitchCC.js +802 -677
  179. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  180. package/build/esm/cc/ConfigurationCC.js +1899 -1687
  181. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  182. package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
  183. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  184. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  185. package/build/esm/cc/DoorLockCC.js +951 -849
  186. package/build/esm/cc/DoorLockCC.js.map +1 -1
  187. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  188. package/build/esm/cc/DoorLockLoggingCC.js +316 -218
  189. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  190. package/build/esm/cc/EnergyProductionCC.js +240 -164
  191. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  192. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  193. package/build/esm/cc/EntryControlCC.js +629 -493
  194. package/build/esm/cc/EntryControlCC.js.map +1 -1
  195. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  196. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
  197. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  198. package/build/esm/cc/HailCC.js +51 -12
  199. package/build/esm/cc/HailCC.js.map +1 -1
  200. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  201. package/build/esm/cc/HumidityControlModeCC.js +357 -250
  202. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  203. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  204. package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
  205. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  206. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  207. package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
  208. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  209. package/build/esm/cc/InclusionControllerCC.js +197 -119
  210. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  211. package/build/esm/cc/IndicatorCC.js +973 -835
  212. package/build/esm/cc/IndicatorCC.js.map +1 -1
  213. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  214. package/build/esm/cc/IrrigationCC.js +1697 -1496
  215. package/build/esm/cc/IrrigationCC.js.map +1 -1
  216. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  217. package/build/esm/cc/LanguageCC.js +266 -184
  218. package/build/esm/cc/LanguageCC.js.map +1 -1
  219. package/build/esm/cc/LockCC.d.ts.map +1 -1
  220. package/build/esm/cc/LockCC.js +247 -162
  221. package/build/esm/cc/LockCC.js.map +1 -1
  222. package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
  223. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  224. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  225. package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
  226. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  227. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  228. package/build/esm/cc/MeterCC.js +896 -795
  229. package/build/esm/cc/MeterCC.js.map +1 -1
  230. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  231. package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
  232. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  233. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  234. package/build/esm/cc/MultiChannelCC.js +1106 -921
  235. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  236. package/build/esm/cc/MultiCommandCC.js +166 -102
  237. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  238. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  239. package/build/esm/cc/MultilevelSensorCC.js +616 -497
  240. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  241. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  242. package/build/esm/cc/MultilevelSwitchCC.js +621 -496
  243. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  244. package/build/esm/cc/NoOperationCC.js +82 -29
  245. package/build/esm/cc/NoOperationCC.js.map +1 -1
  246. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  247. package/build/esm/cc/NodeNamingCC.js +413 -294
  248. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  249. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  250. package/build/esm/cc/NotificationCC.js +1097 -966
  251. package/build/esm/cc/NotificationCC.js.map +1 -1
  252. package/build/esm/cc/PowerlevelCC.js +437 -311
  253. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  254. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  255. package/build/esm/cc/ProtectionCC.js +704 -543
  256. package/build/esm/cc/ProtectionCC.js.map +1 -1
  257. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  258. package/build/esm/cc/SceneActivationCC.js +157 -100
  259. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  260. package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
  261. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  262. package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
  263. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  264. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  265. package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
  266. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  267. package/build/esm/cc/Security2CC.js +1633 -1406
  268. package/build/esm/cc/Security2CC.js.map +1 -1
  269. package/build/esm/cc/SecurityCC.js +876 -687
  270. package/build/esm/cc/SecurityCC.js.map +1 -1
  271. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  272. package/build/esm/cc/SoundSwitchCC.js +689 -526
  273. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  274. package/build/esm/cc/SupervisionCC.js +349 -272
  275. package/build/esm/cc/SupervisionCC.js.map +1 -1
  276. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  277. package/build/esm/cc/ThermostatFanModeCC.js +388 -284
  278. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  279. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  280. package/build/esm/cc/ThermostatFanStateCC.js +184 -111
  281. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  282. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  283. package/build/esm/cc/ThermostatModeCC.js +435 -331
  284. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  285. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  286. package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
  287. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  288. package/build/esm/cc/ThermostatSetbackCC.js +274 -185
  289. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  290. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  291. package/build/esm/cc/ThermostatSetpointCC.js +674 -543
  292. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  293. package/build/esm/cc/TimeCC.js +499 -360
  294. package/build/esm/cc/TimeCC.js.map +1 -1
  295. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  296. package/build/esm/cc/TimeParametersCC.js +296 -211
  297. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  298. package/build/esm/cc/TransportServiceCC.js +464 -363
  299. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  300. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  301. package/build/esm/cc/UserCodeCC.js +1443 -1205
  302. package/build/esm/cc/UserCodeCC.js.map +1 -1
  303. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  304. package/build/esm/cc/VersionCC.js +744 -635
  305. package/build/esm/cc/VersionCC.js.map +1 -1
  306. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  307. package/build/esm/cc/WakeUpCC.js +494 -364
  308. package/build/esm/cc/WakeUpCC.js.map +1 -1
  309. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  310. package/build/esm/cc/WindowCoveringCC.js +655 -530
  311. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  312. package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
  313. package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
  314. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  315. package/build/esm/cc/ZWavePlusCC.js +223 -162
  316. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  317. package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
  318. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  319. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  320. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  321. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
  322. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  323. package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
  324. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  325. package/build/esm/lib/CommandClassDecorators.js +24 -24
  326. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  327. package/build/esm/lib/Security2/Extension.d.ts +1 -1
  328. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  329. package/build/esm/lib/Security2/Extension.js +207 -123
  330. package/build/esm/lib/Security2/Extension.js.map +1 -1
  331. package/package.json +6 -6
@@ -1,10 +1,37 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
6
34
  };
7
- var VersionCCReport_1, VersionCCCommandClassReport_1, VersionCCCommandClassGet_1, VersionCCCapabilitiesReport_1, VersionCCZWaveSoftwareReport_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -75,7 +102,7 @@ import { Bytes } from "@zwave-js/shared/safe";
75
102
  import { getEnumMemberName, num2hex, pick } from "@zwave-js/shared/safe";
76
103
  import { CCAPI, PhysicalCCAPI } from "../lib/API.js";
77
104
  import { CommandClass, } from "../lib/CommandClass.js";
78
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, getImplementedVersion, implementedVersion, } from "../lib/CommandClassDecorators.js";
105
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, getImplementedVersion, implementedVersion, } from "../lib/CommandClassDecorators.js";
79
106
  import { V } from "../lib/Values.js";
80
107
  import { VersionCommand } from "../lib/_Types.js";
81
108
  export const VersionCCValues = Object.freeze({
@@ -176,687 +203,769 @@ function parseVersion(buffer) {
176
203
  return `${buffer[0]}.${buffer[1]}.${buffer[2]}`;
177
204
  }
178
205
  // @noSetValueAPI This CC is read-only
179
- let VersionCCAPI = class VersionCCAPI extends PhysicalCCAPI {
180
- supportsCommand(cmd) {
181
- switch (cmd) {
182
- case VersionCommand.Get:
183
- case VersionCommand.Report:
184
- case VersionCommand.CommandClassGet:
185
- case VersionCommand.CommandClassReport:
186
- return true; // This is mandatory
187
- case VersionCommand.CapabilitiesGet:
188
- case VersionCommand.CapabilitiesReport:
189
- case VersionCommand.ZWaveSoftwareReport:
190
- return this.version >= 3;
191
- case VersionCommand.ZWaveSoftwareGet: {
192
- return this.getValueDB().getValue(VersionCCValues.supportsZWaveSoftwareGet.endpoint(this.endpoint.index));
206
+ let VersionCCAPI = (() => {
207
+ let _classDecorators = [API(CommandClasses.Version)];
208
+ let _classDescriptor;
209
+ let _classExtraInitializers = [];
210
+ let _classThis;
211
+ let _classSuper = PhysicalCCAPI;
212
+ var VersionCCAPI = class extends _classSuper {
213
+ static { _classThis = this; }
214
+ static {
215
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
216
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
217
+ VersionCCAPI = _classThis = _classDescriptor.value;
218
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
219
+ __runInitializers(_classThis, _classExtraInitializers);
220
+ }
221
+ supportsCommand(cmd) {
222
+ switch (cmd) {
223
+ case VersionCommand.Get:
224
+ case VersionCommand.Report:
225
+ case VersionCommand.CommandClassGet:
226
+ case VersionCommand.CommandClassReport:
227
+ return true; // This is mandatory
228
+ case VersionCommand.CapabilitiesGet:
229
+ case VersionCommand.CapabilitiesReport:
230
+ case VersionCommand.ZWaveSoftwareReport:
231
+ return this.version >= 3;
232
+ case VersionCommand.ZWaveSoftwareGet: {
233
+ return this.getValueDB().getValue(VersionCCValues.supportsZWaveSoftwareGet.endpoint(this.endpoint.index));
234
+ }
193
235
  }
236
+ return super.supportsCommand(cmd);
194
237
  }
195
- return super.supportsCommand(cmd);
196
- }
197
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
198
- async get() {
199
- this.assertSupportsCommand(VersionCommand, VersionCommand.Get);
200
- const cc = new VersionCCGet({
201
- nodeId: this.endpoint.nodeId,
202
- endpointIndex: this.endpoint.index,
203
- });
204
- const response = await this.host.sendCommand(cc, this.commandOptions);
205
- if (response) {
206
- return pick(response, [
207
- "libraryType",
208
- "protocolVersion",
209
- "firmwareVersions",
210
- "hardwareVersion",
211
- ]);
238
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
239
+ async get() {
240
+ this.assertSupportsCommand(VersionCommand, VersionCommand.Get);
241
+ const cc = new VersionCCGet({
242
+ nodeId: this.endpoint.nodeId,
243
+ endpointIndex: this.endpoint.index,
244
+ });
245
+ const response = await this.host.sendCommand(cc, this.commandOptions);
246
+ if (response) {
247
+ return pick(response, [
248
+ "libraryType",
249
+ "protocolVersion",
250
+ "firmwareVersions",
251
+ "hardwareVersion",
252
+ ]);
253
+ }
212
254
  }
213
- }
214
- async sendReport(options) {
215
- __assertType("options", "VersionCCReportOptions", __assertType__VersionCCReportOptions.bind(void 0, options));
216
- this.assertSupportsCommand(VersionCommand, VersionCommand.Report);
217
- const cc = new VersionCCReport({
218
- nodeId: this.endpoint.nodeId,
219
- endpointIndex: this.endpoint.index,
220
- ...options,
221
- });
222
- await this.host.sendCommand(cc, this.commandOptions);
223
- }
224
- async getCCVersion(requestedCC) {
225
- __assertType("requestedCC", "CommandClasses", __assertType__number.bind(void 0, requestedCC));
226
- this.assertSupportsCommand(VersionCommand, VersionCommand.CommandClassGet);
227
- const cc = new VersionCCCommandClassGet({
228
- nodeId: this.endpoint.nodeId,
229
- endpointIndex: this.endpoint.index,
230
- requestedCC,
231
- });
232
- const response = await this.host.sendCommand(cc, this.commandOptions);
233
- return response?.ccVersion;
234
- }
235
- async reportCCVersion(requestedCC) {
236
- __assertType("requestedCC", "CommandClasses", __assertType__number.bind(void 0, requestedCC));
237
- this.assertSupportsCommand(VersionCommand, VersionCommand.CommandClassReport);
238
- let ccVersion;
239
- switch (requestedCC) {
240
- case CommandClasses["Z-Wave Protocol"]:
241
- case CommandClasses["Z-Wave Long Range"]:
242
- // These two are only for internal use
243
- ccVersion = 0;
244
- break;
245
- case CommandClasses.Hail:
246
- case CommandClasses["Manufacturer Proprietary"]:
247
- // These CCs are obsolete, we cannot enter them in the certification portal
248
- // but not doing so fails a certification test. Just respond that they
249
- // are not supported or controlled
250
- ccVersion = 0;
251
- break;
252
- default:
253
- ccVersion = getImplementedVersion(requestedCC);
254
- break;
255
- }
256
- const cc = new VersionCCCommandClassReport({
257
- nodeId: this.endpoint.nodeId,
258
- endpointIndex: this.endpoint.index,
259
- requestedCC,
260
- ccVersion,
261
- });
262
- await this.host.sendCommand(cc, this.commandOptions);
263
- }
264
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
265
- async getCapabilities() {
266
- this.assertSupportsCommand(VersionCommand, VersionCommand.CapabilitiesGet);
267
- const cc = new VersionCCCapabilitiesGet({
268
- nodeId: this.endpoint.nodeId,
269
- endpointIndex: this.endpoint.index,
270
- });
271
- const response = await this.host.sendCommand(cc, this.commandOptions);
272
- if (response) {
273
- return pick(response, ["supportsZWaveSoftwareGet"]);
255
+ async sendReport(options) {
256
+ __assertType("options", "VersionCCReportOptions", __assertType__VersionCCReportOptions.bind(void 0, options));
257
+ this.assertSupportsCommand(VersionCommand, VersionCommand.Report);
258
+ const cc = new VersionCCReport({
259
+ nodeId: this.endpoint.nodeId,
260
+ endpointIndex: this.endpoint.index,
261
+ ...options,
262
+ });
263
+ await this.host.sendCommand(cc, this.commandOptions);
274
264
  }
275
- }
276
- async reportCapabilities() {
277
- this.assertSupportsCommand(VersionCommand, VersionCommand.CapabilitiesReport);
278
- const cc = new VersionCCCapabilitiesReport({
279
- nodeId: this.endpoint.nodeId,
280
- endpointIndex: this.endpoint.index,
281
- // At this time, we do not support responding to Z-Wave Software Get
282
- supportsZWaveSoftwareGet: false,
283
- });
284
- await this.host.sendCommand(cc, this.commandOptions);
285
- }
286
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
287
- async getZWaveSoftware() {
288
- this.assertSupportsCommand(VersionCommand, VersionCommand.ZWaveSoftwareGet);
289
- const cc = new VersionCCZWaveSoftwareGet({
290
- nodeId: this.endpoint.nodeId,
291
- endpointIndex: this.endpoint.index,
292
- });
293
- const response = await this.host.sendCommand(cc, this.commandOptions);
294
- if (response) {
295
- return pick(response, [
296
- "sdkVersion",
297
- "applicationFrameworkAPIVersion",
298
- "applicationFrameworkBuildNumber",
299
- "hostInterfaceVersion",
300
- "hostInterfaceBuildNumber",
301
- "zWaveProtocolVersion",
302
- "zWaveProtocolBuildNumber",
303
- "applicationVersion",
304
- "applicationBuildNumber",
305
- ]);
265
+ async getCCVersion(requestedCC) {
266
+ __assertType("requestedCC", "CommandClasses", __assertType__number.bind(void 0, requestedCC));
267
+ this.assertSupportsCommand(VersionCommand, VersionCommand.CommandClassGet);
268
+ const cc = new VersionCCCommandClassGet({
269
+ nodeId: this.endpoint.nodeId,
270
+ endpointIndex: this.endpoint.index,
271
+ requestedCC,
272
+ });
273
+ const response = await this.host.sendCommand(cc, this.commandOptions);
274
+ return response?.ccVersion;
306
275
  }
307
- }
308
- };
309
- VersionCCAPI = __decorate([
310
- API(CommandClasses.Version)
311
- ], VersionCCAPI);
312
- export { VersionCCAPI };
313
- let VersionCC = class VersionCC extends CommandClass {
314
- determineRequiredCCInterviews() {
315
- // VersionCC must be the 2nd CC after ManufacturerSpecificCC
316
- return [CommandClasses["Manufacturer Specific"]];
317
- }
318
- async interview(ctx) {
319
- const node = this.getNode(ctx);
320
- // SDS13782: In a Multi Channel device, the Version Command Class MUST be supported by the Root Device, while
321
- // the Version Command Class SHOULD NOT be supported by individual End Points.
322
- //
323
- // There may be cases where a given Command Class is not implemented by the Root Device of a Multi
324
- // Channel device. However, the Root Device MUST respond to Version requests for any Command Class
325
- // implemented by the Multi Channel device; also in cases where the actual Command Class is only
326
- // provided by an End Point.
327
- const endpoint = this.getEndpoint(ctx);
328
- // Use the CC API of the root device for all queries
329
- const api = CCAPI.create(CommandClasses.Version, ctx, node).withOptions({
330
- priority: MessagePriority.NodeQuery,
331
- });
332
- ctx.logNode(node.id, {
333
- endpoint: this.endpointIndex,
334
- message: `Interviewing ${this.ccName}...`,
335
- direction: "none",
336
- });
337
- const queryCCVersion = async (cc) => {
338
- // Only query CCs we support. Theoretically we could skip queries where we support only V1,
339
- // but there are Z-Wave certification tests that require us to query all CCs
340
- const maxImplemented = getImplementedVersion(cc);
341
- if (maxImplemented === 0) {
342
- ctx.logNode(node.id, ` skipping query for ${CommandClasses[cc]} (${num2hex(cc)}) because max implemented version is ${maxImplemented}`);
343
- return;
276
+ async reportCCVersion(requestedCC) {
277
+ __assertType("requestedCC", "CommandClasses", __assertType__number.bind(void 0, requestedCC));
278
+ this.assertSupportsCommand(VersionCommand, VersionCommand.CommandClassReport);
279
+ let ccVersion;
280
+ switch (requestedCC) {
281
+ case CommandClasses["Z-Wave Protocol"]:
282
+ case CommandClasses["Z-Wave Long Range"]:
283
+ // These two are only for internal use
284
+ ccVersion = 0;
285
+ break;
286
+ case CommandClasses.Hail:
287
+ case CommandClasses["Manufacturer Proprietary"]:
288
+ // These CCs are obsolete, we cannot enter them in the certification portal
289
+ // but not doing so fails a certification test. Just respond that they
290
+ // are not supported or controlled
291
+ ccVersion = 0;
292
+ break;
293
+ default:
294
+ ccVersion = getImplementedVersion(requestedCC);
295
+ break;
296
+ }
297
+ const cc = new VersionCCCommandClassReport({
298
+ nodeId: this.endpoint.nodeId,
299
+ endpointIndex: this.endpoint.index,
300
+ requestedCC,
301
+ ccVersion,
302
+ });
303
+ await this.host.sendCommand(cc, this.commandOptions);
304
+ }
305
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
306
+ async getCapabilities() {
307
+ this.assertSupportsCommand(VersionCommand, VersionCommand.CapabilitiesGet);
308
+ const cc = new VersionCCCapabilitiesGet({
309
+ nodeId: this.endpoint.nodeId,
310
+ endpointIndex: this.endpoint.index,
311
+ });
312
+ const response = await this.host.sendCommand(cc, this.commandOptions);
313
+ if (response) {
314
+ return pick(response, ["supportsZWaveSoftwareGet"]);
315
+ }
316
+ }
317
+ async reportCapabilities() {
318
+ this.assertSupportsCommand(VersionCommand, VersionCommand.CapabilitiesReport);
319
+ const cc = new VersionCCCapabilitiesReport({
320
+ nodeId: this.endpoint.nodeId,
321
+ endpointIndex: this.endpoint.index,
322
+ // At this time, we do not support responding to Z-Wave Software Get
323
+ supportsZWaveSoftwareGet: false,
324
+ });
325
+ await this.host.sendCommand(cc, this.commandOptions);
326
+ }
327
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
328
+ async getZWaveSoftware() {
329
+ this.assertSupportsCommand(VersionCommand, VersionCommand.ZWaveSoftwareGet);
330
+ const cc = new VersionCCZWaveSoftwareGet({
331
+ nodeId: this.endpoint.nodeId,
332
+ endpointIndex: this.endpoint.index,
333
+ });
334
+ const response = await this.host.sendCommand(cc, this.commandOptions);
335
+ if (response) {
336
+ return pick(response, [
337
+ "sdkVersion",
338
+ "applicationFrameworkAPIVersion",
339
+ "applicationFrameworkBuildNumber",
340
+ "hostInterfaceVersion",
341
+ "hostInterfaceBuildNumber",
342
+ "zWaveProtocolVersion",
343
+ "zWaveProtocolBuildNumber",
344
+ "applicationVersion",
345
+ "applicationBuildNumber",
346
+ ]);
344
347
  }
348
+ }
349
+ };
350
+ return VersionCCAPI = _classThis;
351
+ })();
352
+ export { VersionCCAPI };
353
+ let VersionCC = (() => {
354
+ let _classDecorators = [commandClass(CommandClasses.Version), implementedVersion(3), ccValues(VersionCCValues)];
355
+ let _classDescriptor;
356
+ let _classExtraInitializers = [];
357
+ let _classThis;
358
+ let _classSuper = CommandClass;
359
+ var VersionCC = class extends _classSuper {
360
+ static { _classThis = this; }
361
+ static {
362
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
363
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
364
+ VersionCC = _classThis = _classDescriptor.value;
365
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
366
+ __runInitializers(_classThis, _classExtraInitializers);
367
+ }
368
+ determineRequiredCCInterviews() {
369
+ // VersionCC must be the 2nd CC after ManufacturerSpecificCC
370
+ return [CommandClasses["Manufacturer Specific"]];
371
+ }
372
+ async interview(ctx) {
373
+ const node = this.getNode(ctx);
374
+ // SDS13782: In a Multi Channel device, the Version Command Class MUST be supported by the Root Device, while
375
+ // the Version Command Class SHOULD NOT be supported by individual End Points.
376
+ //
377
+ // There may be cases where a given Command Class is not implemented by the Root Device of a Multi
378
+ // Channel device. However, the Root Device MUST respond to Version requests for any Command Class
379
+ // implemented by the Multi Channel device; also in cases where the actual Command Class is only
380
+ // provided by an End Point.
381
+ const endpoint = this.getEndpoint(ctx);
382
+ // Use the CC API of the root device for all queries
383
+ const api = CCAPI.create(CommandClasses.Version, ctx, node).withOptions({
384
+ priority: MessagePriority.NodeQuery,
385
+ });
345
386
  ctx.logNode(node.id, {
346
387
  endpoint: this.endpointIndex,
347
- message: ` querying the CC version for ${getCCName(cc)}...`,
348
- direction: "outbound",
388
+ message: `Interviewing ${this.ccName}...`,
389
+ direction: "none",
349
390
  });
350
- // query the CC version
351
- const supportedVersion = await api.getCCVersion(cc);
352
- if (supportedVersion != undefined) {
353
- // Remember which CC version this endpoint supports
354
- let logMessage;
355
- if (supportedVersion > 0) {
356
- // Basic CC has special rules for when it is considered supported
357
- // Therefore we mark all other CCs as supported, but not Basic CC,
358
- // for which support is determined later.
359
- if (cc === CommandClasses.Basic) {
360
- endpoint.addCC(cc, { version: supportedVersion });
391
+ const queryCCVersion = async (cc) => {
392
+ // Only query CCs we support. Theoretically we could skip queries where we support only V1,
393
+ // but there are Z-Wave certification tests that require us to query all CCs
394
+ const maxImplemented = getImplementedVersion(cc);
395
+ if (maxImplemented === 0) {
396
+ ctx.logNode(node.id, ` skipping query for ${CommandClasses[cc]} (${num2hex(cc)}) because max implemented version is ${maxImplemented}`);
397
+ return;
398
+ }
399
+ ctx.logNode(node.id, {
400
+ endpoint: this.endpointIndex,
401
+ message: ` querying the CC version for ${getCCName(cc)}...`,
402
+ direction: "outbound",
403
+ });
404
+ // query the CC version
405
+ const supportedVersion = await api.getCCVersion(cc);
406
+ if (supportedVersion != undefined) {
407
+ // Remember which CC version this endpoint supports
408
+ let logMessage;
409
+ if (supportedVersion > 0) {
410
+ // Basic CC has special rules for when it is considered supported
411
+ // Therefore we mark all other CCs as supported, but not Basic CC,
412
+ // for which support is determined later.
413
+ if (cc === CommandClasses.Basic) {
414
+ endpoint.addCC(cc, { version: supportedVersion });
415
+ }
416
+ else {
417
+ endpoint.addCC(cc, {
418
+ isSupported: true,
419
+ version: supportedVersion,
420
+ });
421
+ }
422
+ logMessage = ` supports CC ${CommandClasses[cc]} (${num2hex(cc)}) in version ${supportedVersion}`;
361
423
  }
362
424
  else {
363
- endpoint.addCC(cc, {
364
- isSupported: true,
365
- version: supportedVersion,
366
- });
425
+ // We were lied to - the NIF said this CC is supported, now the node claims it isn't
426
+ // Make sure this is not a critical CC, which must be supported though
427
+ if (cc === CommandClasses.Version
428
+ || cc === CommandClasses["Manufacturer Specific"]) {
429
+ logMessage = ` claims NOT to support CC ${CommandClasses[cc]} (${num2hex(cc)}), but it must. Assuming the ${this.endpointIndex === 0 ? "node" : "endpoint"} supports version 1...`;
430
+ endpoint.addCC(cc, { version: 1 });
431
+ }
432
+ else if ((cc === CommandClasses.Security
433
+ && node.hasSecurityClass(SecurityClass.S0_Legacy))
434
+ || (cc === CommandClasses["Security 2"]
435
+ && securityClassOrder.some((sc) => securityClassIsS2(sc)
436
+ && node.hasSecurityClass(sc)))) {
437
+ logMessage = ` claims NOT to support CC ${CommandClasses[cc]} (${num2hex(cc)}), but it is known to support it. Assuming the ${this.endpointIndex === 0 ? "node" : "endpoint"} supports version 1...`;
438
+ endpoint.addCC(cc, { version: 1 });
439
+ }
440
+ else {
441
+ logMessage = ` does NOT support CC ${CommandClasses[cc]} (${num2hex(cc)})`;
442
+ endpoint.removeCC(cc);
443
+ }
367
444
  }
368
- logMessage = ` supports CC ${CommandClasses[cc]} (${num2hex(cc)}) in version ${supportedVersion}`;
445
+ ctx.logNode(node.id, {
446
+ endpoint: this.endpointIndex,
447
+ message: logMessage,
448
+ });
369
449
  }
370
450
  else {
371
- // We were lied to - the NIF said this CC is supported, now the node claims it isn't
372
- // Make sure this is not a critical CC, which must be supported though
373
- if (cc === CommandClasses.Version
374
- || cc === CommandClasses["Manufacturer Specific"]) {
375
- logMessage = ` claims NOT to support CC ${CommandClasses[cc]} (${num2hex(cc)}), but it must. Assuming the ${this.endpointIndex === 0 ? "node" : "endpoint"} supports version 1...`;
376
- endpoint.addCC(cc, { version: 1 });
377
- }
378
- else if ((cc === CommandClasses.Security
379
- && node.hasSecurityClass(SecurityClass.S0_Legacy))
380
- || (cc === CommandClasses["Security 2"]
381
- && securityClassOrder.some((sc) => securityClassIsS2(sc)
382
- && node.hasSecurityClass(sc)))) {
383
- logMessage = ` claims NOT to support CC ${CommandClasses[cc]} (${num2hex(cc)}), but it is known to support it. Assuming the ${this.endpointIndex === 0 ? "node" : "endpoint"} supports version 1...`;
384
- endpoint.addCC(cc, { version: 1 });
385
- }
386
- else {
387
- logMessage = ` does NOT support CC ${CommandClasses[cc]} (${num2hex(cc)})`;
388
- endpoint.removeCC(cc);
389
- }
451
+ ctx.logNode(node.id, {
452
+ endpoint: this.endpointIndex,
453
+ message: `CC version query for ${getCCName(cc)} timed out - assuming the ${this.endpointIndex === 0 ? "node" : "endpoint"} supports version 1...`,
454
+ level: "warn",
455
+ });
456
+ endpoint.addCC(cc, { version: 1 });
390
457
  }
458
+ };
459
+ // Version information should not change (except for firmware updates)
460
+ // And it is only relevant on the root endpoint (the node)
461
+ if (this.endpointIndex === 0) {
462
+ // Step 1: Query Version CC version
463
+ await queryCCVersion(CommandClasses.Version);
464
+ // Step 2: Query node versions
391
465
  ctx.logNode(node.id, {
392
466
  endpoint: this.endpointIndex,
393
- message: logMessage,
467
+ message: "querying node versions...",
468
+ direction: "outbound",
394
469
  });
395
- }
396
- else {
397
- ctx.logNode(node.id, {
398
- endpoint: this.endpointIndex,
399
- message: `CC version query for ${getCCName(cc)} timed out - assuming the ${this.endpointIndex === 0 ? "node" : "endpoint"} supports version 1...`,
400
- level: "warn",
401
- });
402
- endpoint.addCC(cc, { version: 1 });
403
- }
404
- };
405
- // Version information should not change (except for firmware updates)
406
- // And it is only relevant on the root endpoint (the node)
407
- if (this.endpointIndex === 0) {
408
- // Step 1: Query Version CC version
409
- await queryCCVersion(CommandClasses.Version);
410
- // Step 2: Query node versions
411
- ctx.logNode(node.id, {
412
- endpoint: this.endpointIndex,
413
- message: "querying node versions...",
414
- direction: "outbound",
415
- });
416
- const versionGetResponse = await api.get();
417
- if (versionGetResponse) {
418
- let logMessage = `received response for node versions:
470
+ const versionGetResponse = await api.get();
471
+ if (versionGetResponse) {
472
+ let logMessage = `received response for node versions:
419
473
  library type: ${ZWaveLibraryTypes[versionGetResponse.libraryType]} (${num2hex(versionGetResponse.libraryType)})
420
474
  protocol version: ${versionGetResponse.protocolVersion}
421
475
  firmware versions: ${versionGetResponse.firmwareVersions.join(", ")}`;
422
- if (versionGetResponse.hardwareVersion != undefined) {
423
- logMessage +=
424
- `\n hardware version: ${versionGetResponse.hardwareVersion}`;
476
+ if (versionGetResponse.hardwareVersion != undefined) {
477
+ logMessage +=
478
+ `\n hardware version: ${versionGetResponse.hardwareVersion}`;
479
+ }
480
+ ctx.logNode(node.id, {
481
+ endpoint: this.endpointIndex,
482
+ message: logMessage,
483
+ direction: "inbound",
484
+ });
425
485
  }
426
- ctx.logNode(node.id, {
427
- endpoint: this.endpointIndex,
428
- message: logMessage,
429
- direction: "inbound",
430
- });
431
- }
432
- }
433
- // Step 3: Query all other CC versions
434
- ctx.logNode(node.id, {
435
- endpoint: this.endpointIndex,
436
- message: "querying CC versions...",
437
- direction: "outbound",
438
- });
439
- // Basic CC is not included in the NIF, so it won't be returned by endpoint.getCCs() at this point
440
- {
441
- const cc = CommandClasses.Basic;
442
- // Skip the query of endpoint CCs that are also supported by the root device
443
- if (this.endpointIndex === 0 || node.getCCVersion(cc) === 0) {
444
- await queryCCVersion(cc);
445
486
  }
446
- }
447
- for (const [cc] of endpoint.getCCs()) {
448
- // We already queried the Version CC version at the start of this interview
449
- if (cc === CommandClasses.Version)
450
- continue;
451
- // And we queried Basic CC just before this
452
- if (cc === CommandClasses.Basic)
453
- continue;
454
- // Skip the query of endpoint CCs that are also supported by the root device
455
- if (this.endpointIndex > 0 && node.getCCVersion(cc) > 0)
456
- continue;
457
- await queryCCVersion(cc);
458
- }
459
- // Step 4: Query VersionCC capabilities (root device only)
460
- if (this.endpointIndex === 0 && api.version >= 3) {
461
- // Step 4a: Support for SoftwareGet
487
+ // Step 3: Query all other CC versions
462
488
  ctx.logNode(node.id, {
463
489
  endpoint: this.endpointIndex,
464
- message: "querying if Z-Wave Software Get is supported...",
490
+ message: "querying CC versions...",
465
491
  direction: "outbound",
466
492
  });
467
- const capsResponse = await api.getCapabilities();
468
- if (capsResponse) {
469
- const { supportsZWaveSoftwareGet } = capsResponse;
493
+ // Basic CC is not included in the NIF, so it won't be returned by endpoint.getCCs() at this point
494
+ {
495
+ const cc = CommandClasses.Basic;
496
+ // Skip the query of endpoint CCs that are also supported by the root device
497
+ if (this.endpointIndex === 0 || node.getCCVersion(cc) === 0) {
498
+ await queryCCVersion(cc);
499
+ }
500
+ }
501
+ for (const [cc] of endpoint.getCCs()) {
502
+ // We already queried the Version CC version at the start of this interview
503
+ if (cc === CommandClasses.Version)
504
+ continue;
505
+ // And we queried Basic CC just before this
506
+ if (cc === CommandClasses.Basic)
507
+ continue;
508
+ // Skip the query of endpoint CCs that are also supported by the root device
509
+ if (this.endpointIndex > 0 && node.getCCVersion(cc) > 0)
510
+ continue;
511
+ await queryCCVersion(cc);
512
+ }
513
+ // Step 4: Query VersionCC capabilities (root device only)
514
+ if (this.endpointIndex === 0 && api.version >= 3) {
515
+ // Step 4a: Support for SoftwareGet
470
516
  ctx.logNode(node.id, {
471
517
  endpoint: this.endpointIndex,
472
- message: `Z-Wave Software Get is${supportsZWaveSoftwareGet ? "" : " not"} supported`,
473
- direction: "inbound",
518
+ message: "querying if Z-Wave Software Get is supported...",
519
+ direction: "outbound",
474
520
  });
475
- if (supportsZWaveSoftwareGet) {
476
- // Step 4b: Query Z-Wave Software versions
521
+ const capsResponse = await api.getCapabilities();
522
+ if (capsResponse) {
523
+ const { supportsZWaveSoftwareGet } = capsResponse;
477
524
  ctx.logNode(node.id, {
478
525
  endpoint: this.endpointIndex,
479
- message: "querying Z-Wave software versions...",
480
- direction: "outbound",
481
- });
482
- await api.getZWaveSoftware();
483
- ctx.logNode(node.id, {
484
- endpoint: this.endpointIndex,
485
- message: "received Z-Wave software versions",
526
+ message: `Z-Wave Software Get is${supportsZWaveSoftwareGet ? "" : " not"} supported`,
486
527
  direction: "inbound",
487
528
  });
529
+ if (supportsZWaveSoftwareGet) {
530
+ // Step 4b: Query Z-Wave Software versions
531
+ ctx.logNode(node.id, {
532
+ endpoint: this.endpointIndex,
533
+ message: "querying Z-Wave software versions...",
534
+ direction: "outbound",
535
+ });
536
+ await api.getZWaveSoftware();
537
+ ctx.logNode(node.id, {
538
+ endpoint: this.endpointIndex,
539
+ message: "received Z-Wave software versions",
540
+ direction: "inbound",
541
+ });
542
+ }
488
543
  }
489
544
  }
545
+ // Remember that the interview is complete
546
+ this.setInterviewComplete(ctx, true);
490
547
  }
491
- // Remember that the interview is complete
492
- this.setInterviewComplete(ctx, true);
493
- }
494
- };
495
- VersionCC = __decorate([
496
- commandClass(CommandClasses.Version),
497
- implementedVersion(3),
498
- ccValues(VersionCCValues)
499
- ], VersionCC);
548
+ };
549
+ return VersionCC = _classThis;
550
+ })();
500
551
  export { VersionCC };
501
- let VersionCCReport = VersionCCReport_1 = class VersionCCReport extends VersionCC {
502
- constructor(options) {
503
- super(options);
504
- if (!/^\d+\.\d+(\.\d+)?$/.test(options.protocolVersion)) {
505
- throw new ZWaveError(`protocolVersion must be a string in the format "major.minor" or "major.minor.patch", received "${options.protocolVersion}"`, ZWaveErrorCodes.Argument_Invalid);
506
- }
507
- else if (!options.firmwareVersions.every((fw) => /^\d+\.\d+(\.\d+)?$/.test(fw))) {
508
- throw new ZWaveError(`firmwareVersions must be an array of strings in the format "major.minor" or "major.minor.patch", received "${JSON.stringify(options.firmwareVersions)}"`, ZWaveErrorCodes.Argument_Invalid);
509
- }
510
- this.libraryType = options.libraryType;
511
- this.protocolVersion = options.protocolVersion;
512
- this.firmwareVersions = options.firmwareVersions;
513
- this.hardwareVersion = options.hardwareVersion;
514
- }
515
- static from(raw, ctx) {
516
- validatePayload(raw.payload.length >= 5);
517
- const libraryType = raw.payload[0];
518
- const protocolVersion = `${raw.payload[1]}.${raw.payload[2]}`;
519
- const firmwareVersions = [`${raw.payload[3]}.${raw.payload[4]}`];
520
- let hardwareVersion;
521
- if (raw.payload.length >= 7) {
522
- // V2+
523
- hardwareVersion = raw.payload[5];
524
- const additionalFirmwares = raw.payload[6];
525
- validatePayload(raw.payload.length >= 7 + 2 * additionalFirmwares);
526
- for (let i = 0; i < additionalFirmwares; i++) {
527
- firmwareVersions.push(`${raw.payload[7 + 2 * i]}.${raw.payload[7 + 2 * i + 1]}`);
552
+ let VersionCCReport = (() => {
553
+ let _classDecorators = [CCCommand(VersionCommand.Report), ccValueProperty("libraryType", VersionCCValues.libraryType), ccValueProperty("protocolVersion", VersionCCValues.protocolVersion), ccValueProperty("firmwareVersions", VersionCCValues.firmwareVersions), ccValueProperty("hardwareVersion", VersionCCValues.hardwareVersion)];
554
+ let _classDescriptor;
555
+ let _classExtraInitializers = [];
556
+ let _classThis;
557
+ let _classSuper = VersionCC;
558
+ var VersionCCReport = class extends _classSuper {
559
+ static { _classThis = this; }
560
+ static {
561
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
562
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
563
+ VersionCCReport = _classThis = _classDescriptor.value;
564
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
565
+ __runInitializers(_classThis, _classExtraInitializers);
566
+ }
567
+ constructor(options) {
568
+ super(options);
569
+ if (!/^\d+\.\d+(\.\d+)?$/.test(options.protocolVersion)) {
570
+ throw new ZWaveError(`protocolVersion must be a string in the format "major.minor" or "major.minor.patch", received "${options.protocolVersion}"`, ZWaveErrorCodes.Argument_Invalid);
571
+ }
572
+ else if (!options.firmwareVersions.every((fw) => /^\d+\.\d+(\.\d+)?$/.test(fw))) {
573
+ throw new ZWaveError(`firmwareVersions must be an array of strings in the format "major.minor" or "major.minor.patch", received "${JSON.stringify(options.firmwareVersions)}"`, ZWaveErrorCodes.Argument_Invalid);
528
574
  }
575
+ this.libraryType = options.libraryType;
576
+ this.protocolVersion = options.protocolVersion;
577
+ this.firmwareVersions = options.firmwareVersions;
578
+ this.hardwareVersion = options.hardwareVersion;
529
579
  }
530
- return new VersionCCReport_1({
531
- nodeId: ctx.sourceNodeId,
532
- libraryType,
533
- protocolVersion,
534
- firmwareVersions,
535
- hardwareVersion,
536
- });
537
- }
538
- libraryType;
539
- protocolVersion;
540
- firmwareVersions;
541
- hardwareVersion;
542
- serialize(ctx) {
543
- this.payload = Bytes.from([
544
- this.libraryType,
545
- ...this.protocolVersion
546
- .split(".")
547
- .map((n) => parseInt(n))
548
- .slice(0, 2),
549
- ...this.firmwareVersions[0]
550
- .split(".")
551
- .map((n) => parseInt(n))
552
- .slice(0, 2),
553
- this.hardwareVersion ?? 0x00,
554
- this.firmwareVersions.length - 1,
555
- ]);
556
- if (this.firmwareVersions.length > 1) {
557
- const firmwaresBuffer = new Bytes((this.firmwareVersions.length - 1) * 2);
558
- for (let i = 1; i < this.firmwareVersions.length; i++) {
559
- const [major, minor] = this.firmwareVersions[i]
580
+ static from(raw, ctx) {
581
+ validatePayload(raw.payload.length >= 5);
582
+ const libraryType = raw.payload[0];
583
+ const protocolVersion = `${raw.payload[1]}.${raw.payload[2]}`;
584
+ const firmwareVersions = [`${raw.payload[3]}.${raw.payload[4]}`];
585
+ let hardwareVersion;
586
+ if (raw.payload.length >= 7) {
587
+ // V2+
588
+ hardwareVersion = raw.payload[5];
589
+ const additionalFirmwares = raw.payload[6];
590
+ validatePayload(raw.payload.length >= 7 + 2 * additionalFirmwares);
591
+ for (let i = 0; i < additionalFirmwares; i++) {
592
+ firmwareVersions.push(`${raw.payload[7 + 2 * i]}.${raw.payload[7 + 2 * i + 1]}`);
593
+ }
594
+ }
595
+ return new this({
596
+ nodeId: ctx.sourceNodeId,
597
+ libraryType,
598
+ protocolVersion,
599
+ firmwareVersions,
600
+ hardwareVersion,
601
+ });
602
+ }
603
+ libraryType;
604
+ protocolVersion;
605
+ firmwareVersions;
606
+ hardwareVersion;
607
+ serialize(ctx) {
608
+ this.payload = Bytes.from([
609
+ this.libraryType,
610
+ ...this.protocolVersion
560
611
  .split(".")
561
- .map((n) => parseInt(n));
562
- firmwaresBuffer[2 * (i - 1)] = major;
563
- firmwaresBuffer[2 * (i - 1) + 1] = minor;
612
+ .map((n) => parseInt(n))
613
+ .slice(0, 2),
614
+ ...this.firmwareVersions[0]
615
+ .split(".")
616
+ .map((n) => parseInt(n))
617
+ .slice(0, 2),
618
+ this.hardwareVersion ?? 0x00,
619
+ this.firmwareVersions.length - 1,
620
+ ]);
621
+ if (this.firmwareVersions.length > 1) {
622
+ const firmwaresBuffer = new Bytes((this.firmwareVersions.length - 1) * 2);
623
+ for (let i = 1; i < this.firmwareVersions.length; i++) {
624
+ const [major, minor] = this.firmwareVersions[i]
625
+ .split(".")
626
+ .map((n) => parseInt(n));
627
+ firmwaresBuffer[2 * (i - 1)] = major;
628
+ firmwaresBuffer[2 * (i - 1) + 1] = minor;
629
+ }
630
+ this.payload = Bytes.concat([this.payload, firmwaresBuffer]);
564
631
  }
565
- this.payload = Bytes.concat([this.payload, firmwaresBuffer]);
632
+ return super.serialize(ctx);
566
633
  }
567
- return super.serialize(ctx);
568
- }
569
- toLogEntry(ctx) {
570
- const message = {
571
- "library type": getEnumMemberName(ZWaveLibraryTypes, this.libraryType),
572
- "protocol version": this.protocolVersion,
573
- "firmware versions": this.firmwareVersions.join(", "),
574
- };
575
- if (this.hardwareVersion != undefined) {
576
- message["hardware version"] = this.hardwareVersion;
577
- }
578
- return {
579
- ...super.toLogEntry(ctx),
580
- message,
581
- };
582
- }
583
- };
584
- __decorate([
585
- ccValue(VersionCCValues.libraryType)
586
- ], VersionCCReport.prototype, "libraryType", void 0);
587
- __decorate([
588
- ccValue(VersionCCValues.protocolVersion)
589
- ], VersionCCReport.prototype, "protocolVersion", void 0);
590
- __decorate([
591
- ccValue(VersionCCValues.firmwareVersions)
592
- ], VersionCCReport.prototype, "firmwareVersions", void 0);
593
- __decorate([
594
- ccValue(VersionCCValues.hardwareVersion)
595
- ], VersionCCReport.prototype, "hardwareVersion", void 0);
596
- VersionCCReport = VersionCCReport_1 = __decorate([
597
- CCCommand(VersionCommand.Report)
598
- ], VersionCCReport);
634
+ toLogEntry(ctx) {
635
+ const message = {
636
+ "library type": getEnumMemberName(ZWaveLibraryTypes, this.libraryType),
637
+ "protocol version": this.protocolVersion,
638
+ "firmware versions": this.firmwareVersions.join(", "),
639
+ };
640
+ if (this.hardwareVersion != undefined) {
641
+ message["hardware version"] = this.hardwareVersion;
642
+ }
643
+ return {
644
+ ...super.toLogEntry(ctx),
645
+ message,
646
+ };
647
+ }
648
+ };
649
+ return VersionCCReport = _classThis;
650
+ })();
599
651
  export { VersionCCReport };
600
- let VersionCCGet = class VersionCCGet extends VersionCC {
601
- };
602
- VersionCCGet = __decorate([
603
- CCCommand(VersionCommand.Get),
604
- expectedCCResponse(VersionCCReport)
605
- ], VersionCCGet);
652
+ let VersionCCGet = (() => {
653
+ let _classDecorators = [CCCommand(VersionCommand.Get), expectedCCResponse(VersionCCReport)];
654
+ let _classDescriptor;
655
+ let _classExtraInitializers = [];
656
+ let _classThis;
657
+ let _classSuper = VersionCC;
658
+ var VersionCCGet = class extends _classSuper {
659
+ static { _classThis = this; }
660
+ static {
661
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
662
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
663
+ VersionCCGet = _classThis = _classDescriptor.value;
664
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
665
+ __runInitializers(_classThis, _classExtraInitializers);
666
+ }
667
+ };
668
+ return VersionCCGet = _classThis;
669
+ })();
606
670
  export { VersionCCGet };
607
- let VersionCCCommandClassReport = VersionCCCommandClassReport_1 = class VersionCCCommandClassReport extends VersionCC {
608
- constructor(options) {
609
- super(options);
610
- this.requestedCC = options.requestedCC;
611
- this.ccVersion = options.ccVersion;
612
- }
613
- static from(raw, ctx) {
614
- validatePayload(raw.payload.length >= 2);
615
- const requestedCC = raw.payload[0];
616
- const ccVersion = raw.payload[1];
617
- return new VersionCCCommandClassReport_1({
618
- nodeId: ctx.sourceNodeId,
619
- requestedCC,
620
- ccVersion,
621
- });
622
- }
623
- ccVersion;
624
- requestedCC;
625
- serialize(ctx) {
626
- this.payload = Bytes.from([this.requestedCC, this.ccVersion]);
627
- return super.serialize(ctx);
628
- }
629
- toLogEntry(ctx) {
630
- return {
631
- ...super.toLogEntry(ctx),
632
- message: {
633
- CC: getCCName(this.requestedCC),
634
- version: this.ccVersion,
635
- },
636
- };
637
- }
638
- };
639
- VersionCCCommandClassReport = VersionCCCommandClassReport_1 = __decorate([
640
- CCCommand(VersionCommand.CommandClassReport)
641
- ], VersionCCCommandClassReport);
671
+ let VersionCCCommandClassReport = (() => {
672
+ let _classDecorators = [CCCommand(VersionCommand.CommandClassReport)];
673
+ let _classDescriptor;
674
+ let _classExtraInitializers = [];
675
+ let _classThis;
676
+ let _classSuper = VersionCC;
677
+ var VersionCCCommandClassReport = class extends _classSuper {
678
+ static { _classThis = this; }
679
+ static {
680
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
681
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
682
+ VersionCCCommandClassReport = _classThis = _classDescriptor.value;
683
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
684
+ __runInitializers(_classThis, _classExtraInitializers);
685
+ }
686
+ constructor(options) {
687
+ super(options);
688
+ this.requestedCC = options.requestedCC;
689
+ this.ccVersion = options.ccVersion;
690
+ }
691
+ static from(raw, ctx) {
692
+ validatePayload(raw.payload.length >= 2);
693
+ const requestedCC = raw.payload[0];
694
+ const ccVersion = raw.payload[1];
695
+ return new this({
696
+ nodeId: ctx.sourceNodeId,
697
+ requestedCC,
698
+ ccVersion,
699
+ });
700
+ }
701
+ ccVersion;
702
+ requestedCC;
703
+ serialize(ctx) {
704
+ this.payload = Bytes.from([this.requestedCC, this.ccVersion]);
705
+ return super.serialize(ctx);
706
+ }
707
+ toLogEntry(ctx) {
708
+ return {
709
+ ...super.toLogEntry(ctx),
710
+ message: {
711
+ CC: getCCName(this.requestedCC),
712
+ version: this.ccVersion,
713
+ },
714
+ };
715
+ }
716
+ };
717
+ return VersionCCCommandClassReport = _classThis;
718
+ })();
642
719
  export { VersionCCCommandClassReport };
643
720
  function testResponseForVersionCommandClassGet(sent, received) {
644
721
  // We expect a Version CommandClass Report that matches the requested CC
645
722
  return sent.requestedCC === received.requestedCC;
646
723
  }
647
- let VersionCCCommandClassGet = VersionCCCommandClassGet_1 = class VersionCCCommandClassGet extends VersionCC {
648
- constructor(options) {
649
- super(options);
650
- this.requestedCC = options.requestedCC;
651
- }
652
- static from(raw, ctx) {
653
- validatePayload(raw.payload.length >= 1);
654
- const requestedCC = raw.payload[0];
655
- return new VersionCCCommandClassGet_1({
656
- nodeId: ctx.sourceNodeId,
657
- requestedCC,
658
- });
659
- }
660
- requestedCC;
661
- serialize(ctx) {
662
- this.payload = Bytes.from([this.requestedCC]);
663
- return super.serialize(ctx);
664
- }
665
- toLogEntry(ctx) {
666
- return {
667
- ...super.toLogEntry(ctx),
668
- message: { CC: getCCName(this.requestedCC) },
669
- };
670
- }
671
- };
672
- VersionCCCommandClassGet = VersionCCCommandClassGet_1 = __decorate([
673
- CCCommand(VersionCommand.CommandClassGet),
674
- expectedCCResponse(VersionCCCommandClassReport, testResponseForVersionCommandClassGet)
675
- ], VersionCCCommandClassGet);
724
+ let VersionCCCommandClassGet = (() => {
725
+ let _classDecorators = [CCCommand(VersionCommand.CommandClassGet), expectedCCResponse(VersionCCCommandClassReport, testResponseForVersionCommandClassGet)];
726
+ let _classDescriptor;
727
+ let _classExtraInitializers = [];
728
+ let _classThis;
729
+ let _classSuper = VersionCC;
730
+ var VersionCCCommandClassGet = class extends _classSuper {
731
+ static { _classThis = this; }
732
+ static {
733
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
734
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
735
+ VersionCCCommandClassGet = _classThis = _classDescriptor.value;
736
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
737
+ __runInitializers(_classThis, _classExtraInitializers);
738
+ }
739
+ constructor(options) {
740
+ super(options);
741
+ this.requestedCC = options.requestedCC;
742
+ }
743
+ static from(raw, ctx) {
744
+ validatePayload(raw.payload.length >= 1);
745
+ const requestedCC = raw.payload[0];
746
+ return new this({
747
+ nodeId: ctx.sourceNodeId,
748
+ requestedCC,
749
+ });
750
+ }
751
+ requestedCC;
752
+ serialize(ctx) {
753
+ this.payload = Bytes.from([this.requestedCC]);
754
+ return super.serialize(ctx);
755
+ }
756
+ toLogEntry(ctx) {
757
+ return {
758
+ ...super.toLogEntry(ctx),
759
+ message: { CC: getCCName(this.requestedCC) },
760
+ };
761
+ }
762
+ };
763
+ return VersionCCCommandClassGet = _classThis;
764
+ })();
676
765
  export { VersionCCCommandClassGet };
677
- let VersionCCCapabilitiesReport = VersionCCCapabilitiesReport_1 = class VersionCCCapabilitiesReport extends VersionCC {
678
- constructor(options) {
679
- super(options);
680
- this.supportsZWaveSoftwareGet = options.supportsZWaveSoftwareGet;
681
- }
682
- static from(raw, ctx) {
683
- validatePayload(raw.payload.length >= 1);
684
- const capabilities = raw.payload[0];
685
- const supportsZWaveSoftwareGet = !!(capabilities & 0b100);
686
- return new VersionCCCapabilitiesReport_1({
687
- nodeId: ctx.sourceNodeId,
688
- supportsZWaveSoftwareGet,
689
- });
690
- }
691
- supportsZWaveSoftwareGet;
692
- serialize(ctx) {
693
- this.payload = Bytes.from([
694
- (this.supportsZWaveSoftwareGet ? 0b100 : 0) | 0b11,
695
- ]);
696
- return super.serialize(ctx);
697
- }
698
- toLogEntry(ctx) {
699
- return {
700
- ...super.toLogEntry(ctx),
701
- message: {
702
- "supports Z-Wave Software Get command": this.supportsZWaveSoftwareGet,
703
- },
704
- };
705
- }
706
- };
707
- __decorate([
708
- ccValue(VersionCCValues.supportsZWaveSoftwareGet)
709
- ], VersionCCCapabilitiesReport.prototype, "supportsZWaveSoftwareGet", void 0);
710
- VersionCCCapabilitiesReport = VersionCCCapabilitiesReport_1 = __decorate([
711
- CCCommand(VersionCommand.CapabilitiesReport)
712
- ], VersionCCCapabilitiesReport);
766
+ let VersionCCCapabilitiesReport = (() => {
767
+ let _classDecorators = [CCCommand(VersionCommand.CapabilitiesReport), ccValueProperty("supportsZWaveSoftwareGet", VersionCCValues.supportsZWaveSoftwareGet)];
768
+ let _classDescriptor;
769
+ let _classExtraInitializers = [];
770
+ let _classThis;
771
+ let _classSuper = VersionCC;
772
+ var VersionCCCapabilitiesReport = class extends _classSuper {
773
+ static { _classThis = this; }
774
+ static {
775
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
776
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
777
+ VersionCCCapabilitiesReport = _classThis = _classDescriptor.value;
778
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
779
+ __runInitializers(_classThis, _classExtraInitializers);
780
+ }
781
+ constructor(options) {
782
+ super(options);
783
+ this.supportsZWaveSoftwareGet = options.supportsZWaveSoftwareGet;
784
+ }
785
+ static from(raw, ctx) {
786
+ validatePayload(raw.payload.length >= 1);
787
+ const capabilities = raw.payload[0];
788
+ const supportsZWaveSoftwareGet = !!(capabilities & 0b100);
789
+ return new this({
790
+ nodeId: ctx.sourceNodeId,
791
+ supportsZWaveSoftwareGet,
792
+ });
793
+ }
794
+ supportsZWaveSoftwareGet;
795
+ serialize(ctx) {
796
+ this.payload = Bytes.from([
797
+ (this.supportsZWaveSoftwareGet ? 0b100 : 0) | 0b11,
798
+ ]);
799
+ return super.serialize(ctx);
800
+ }
801
+ toLogEntry(ctx) {
802
+ return {
803
+ ...super.toLogEntry(ctx),
804
+ message: {
805
+ "supports Z-Wave Software Get command": this.supportsZWaveSoftwareGet,
806
+ },
807
+ };
808
+ }
809
+ };
810
+ return VersionCCCapabilitiesReport = _classThis;
811
+ })();
713
812
  export { VersionCCCapabilitiesReport };
714
- let VersionCCCapabilitiesGet = class VersionCCCapabilitiesGet extends VersionCC {
715
- };
716
- VersionCCCapabilitiesGet = __decorate([
717
- CCCommand(VersionCommand.CapabilitiesGet),
718
- expectedCCResponse(VersionCCCapabilitiesReport)
719
- ], VersionCCCapabilitiesGet);
813
+ let VersionCCCapabilitiesGet = (() => {
814
+ let _classDecorators = [CCCommand(VersionCommand.CapabilitiesGet), expectedCCResponse(VersionCCCapabilitiesReport)];
815
+ let _classDescriptor;
816
+ let _classExtraInitializers = [];
817
+ let _classThis;
818
+ let _classSuper = VersionCC;
819
+ var VersionCCCapabilitiesGet = class extends _classSuper {
820
+ static { _classThis = this; }
821
+ static {
822
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
823
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
824
+ VersionCCCapabilitiesGet = _classThis = _classDescriptor.value;
825
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
826
+ __runInitializers(_classThis, _classExtraInitializers);
827
+ }
828
+ };
829
+ return VersionCCCapabilitiesGet = _classThis;
830
+ })();
720
831
  export { VersionCCCapabilitiesGet };
721
- let VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport_1 = class VersionCCZWaveSoftwareReport extends VersionCC {
722
- constructor(options) {
723
- super(options);
724
- // TODO: Check implementation:
725
- this.sdkVersion = options.sdkVersion;
726
- this.applicationFrameworkAPIVersion =
727
- options.applicationFrameworkAPIVersion;
728
- this.applicationFrameworkBuildNumber =
729
- options.applicationFrameworkBuildNumber;
730
- this.hostInterfaceVersion = options.hostInterfaceVersion;
731
- this.hostInterfaceBuildNumber = options.hostInterfaceBuildNumber;
732
- this.zWaveProtocolVersion = options.zWaveProtocolVersion;
733
- this.zWaveProtocolBuildNumber = options.zWaveProtocolBuildNumber;
734
- this.applicationVersion = options.applicationVersion;
735
- this.applicationBuildNumber = options.applicationBuildNumber;
736
- }
737
- static from(raw, ctx) {
738
- validatePayload(raw.payload.length >= 23);
739
- const sdkVersion = parseVersion(raw.payload);
740
- const applicationFrameworkAPIVersion = parseVersion(raw.payload.subarray(3));
741
- let applicationFrameworkBuildNumber;
742
- if (applicationFrameworkAPIVersion !== "unused") {
743
- applicationFrameworkBuildNumber = raw.payload.readUInt16BE(6);
744
- }
745
- else {
746
- applicationFrameworkBuildNumber = 0;
747
- }
748
- const hostInterfaceVersion = parseVersion(raw.payload.subarray(8));
749
- let hostInterfaceBuildNumber;
750
- if (hostInterfaceVersion !== "unused") {
751
- hostInterfaceBuildNumber = raw.payload.readUInt16BE(11);
752
- }
753
- else {
754
- hostInterfaceBuildNumber = 0;
755
- }
756
- const zWaveProtocolVersion = parseVersion(raw.payload.subarray(13));
757
- let zWaveProtocolBuildNumber;
758
- if (zWaveProtocolVersion !== "unused") {
759
- zWaveProtocolBuildNumber = raw.payload.readUInt16BE(16);
760
- }
761
- else {
762
- zWaveProtocolBuildNumber = 0;
763
- }
764
- const applicationVersion = parseVersion(raw.payload.subarray(18));
765
- let applicationBuildNumber;
766
- if (applicationVersion !== "unused") {
767
- applicationBuildNumber = raw.payload.readUInt16BE(21);
768
- }
769
- else {
770
- applicationBuildNumber = 0;
771
- }
772
- return new VersionCCZWaveSoftwareReport_1({
773
- nodeId: ctx.sourceNodeId,
774
- sdkVersion,
775
- applicationFrameworkAPIVersion,
776
- applicationFrameworkBuildNumber,
777
- hostInterfaceVersion,
778
- hostInterfaceBuildNumber,
779
- zWaveProtocolVersion,
780
- zWaveProtocolBuildNumber,
781
- applicationVersion,
782
- applicationBuildNumber,
783
- });
784
- }
785
- sdkVersion;
786
- applicationFrameworkAPIVersion;
787
- applicationFrameworkBuildNumber;
788
- hostInterfaceVersion;
789
- hostInterfaceBuildNumber;
790
- zWaveProtocolVersion;
791
- zWaveProtocolBuildNumber;
792
- applicationVersion;
793
- applicationBuildNumber;
794
- toLogEntry(ctx) {
795
- const message = {
796
- "SDK version": this.sdkVersion,
797
- };
798
- message["appl. framework API version"] =
799
- this.applicationFrameworkAPIVersion;
800
- if (this.applicationFrameworkAPIVersion !== "unused") {
801
- message["appl. framework build number"] =
802
- this.applicationFrameworkBuildNumber;
803
- }
804
- message["host interface version"] = this.hostInterfaceVersion;
805
- if (this.hostInterfaceVersion !== "unused") {
806
- message["host interface build number"] =
807
- this.hostInterfaceBuildNumber;
808
- }
809
- message["Z-Wave protocol version"] = this.zWaveProtocolVersion;
810
- if (this.zWaveProtocolVersion !== "unused") {
811
- message["Z-Wave protocol build number"] =
812
- this.zWaveProtocolBuildNumber;
813
- }
814
- message["application version"] = this.applicationVersion;
815
- if (this.applicationVersion !== "unused") {
816
- message["application build number"] = this.applicationBuildNumber;
817
- }
818
- return {
819
- ...super.toLogEntry(ctx),
820
- message,
821
- };
822
- }
823
- };
824
- __decorate([
825
- ccValue(VersionCCValues.sdkVersion)
826
- ], VersionCCZWaveSoftwareReport.prototype, "sdkVersion", void 0);
827
- __decorate([
828
- ccValue(VersionCCValues.applicationFrameworkAPIVersion)
829
- ], VersionCCZWaveSoftwareReport.prototype, "applicationFrameworkAPIVersion", void 0);
830
- __decorate([
831
- ccValue(VersionCCValues.applicationFrameworkBuildNumber)
832
- ], VersionCCZWaveSoftwareReport.prototype, "applicationFrameworkBuildNumber", void 0);
833
- __decorate([
834
- ccValue(VersionCCValues.serialAPIVersion)
835
- ], VersionCCZWaveSoftwareReport.prototype, "hostInterfaceVersion", void 0);
836
- __decorate([
837
- ccValue(VersionCCValues.serialAPIBuildNumber)
838
- ], VersionCCZWaveSoftwareReport.prototype, "hostInterfaceBuildNumber", void 0);
839
- __decorate([
840
- ccValue(VersionCCValues.zWaveProtocolVersion)
841
- ], VersionCCZWaveSoftwareReport.prototype, "zWaveProtocolVersion", void 0);
842
- __decorate([
843
- ccValue(VersionCCValues.zWaveProtocolBuildNumber)
844
- ], VersionCCZWaveSoftwareReport.prototype, "zWaveProtocolBuildNumber", void 0);
845
- __decorate([
846
- ccValue(VersionCCValues.applicationVersion)
847
- ], VersionCCZWaveSoftwareReport.prototype, "applicationVersion", void 0);
848
- __decorate([
849
- ccValue(VersionCCValues.applicationBuildNumber)
850
- ], VersionCCZWaveSoftwareReport.prototype, "applicationBuildNumber", void 0);
851
- VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport_1 = __decorate([
852
- CCCommand(VersionCommand.ZWaveSoftwareReport)
853
- ], VersionCCZWaveSoftwareReport);
832
+ let VersionCCZWaveSoftwareReport = (() => {
833
+ let _classDecorators = [CCCommand(VersionCommand.ZWaveSoftwareReport), ccValueProperty("sdkVersion", VersionCCValues.sdkVersion), ccValueProperty("applicationFrameworkAPIVersion", VersionCCValues.applicationFrameworkAPIVersion), ccValueProperty("applicationFrameworkBuildNumber", VersionCCValues.applicationFrameworkBuildNumber), ccValueProperty("hostInterfaceVersion", VersionCCValues.serialAPIVersion), ccValueProperty("hostInterfaceBuildNumber", VersionCCValues.serialAPIBuildNumber), ccValueProperty("zWaveProtocolVersion", VersionCCValues.zWaveProtocolVersion), ccValueProperty("zWaveProtocolBuildNumber", VersionCCValues.zWaveProtocolBuildNumber), ccValueProperty("applicationVersion", VersionCCValues.applicationVersion), ccValueProperty("applicationBuildNumber", VersionCCValues.applicationBuildNumber)];
834
+ let _classDescriptor;
835
+ let _classExtraInitializers = [];
836
+ let _classThis;
837
+ let _classSuper = VersionCC;
838
+ var VersionCCZWaveSoftwareReport = class extends _classSuper {
839
+ static { _classThis = this; }
840
+ static {
841
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
842
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
843
+ VersionCCZWaveSoftwareReport = _classThis = _classDescriptor.value;
844
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
845
+ __runInitializers(_classThis, _classExtraInitializers);
846
+ }
847
+ constructor(options) {
848
+ super(options);
849
+ // TODO: Check implementation:
850
+ this.sdkVersion = options.sdkVersion;
851
+ this.applicationFrameworkAPIVersion =
852
+ options.applicationFrameworkAPIVersion;
853
+ this.applicationFrameworkBuildNumber =
854
+ options.applicationFrameworkBuildNumber;
855
+ this.hostInterfaceVersion = options.hostInterfaceVersion;
856
+ this.hostInterfaceBuildNumber = options.hostInterfaceBuildNumber;
857
+ this.zWaveProtocolVersion = options.zWaveProtocolVersion;
858
+ this.zWaveProtocolBuildNumber = options.zWaveProtocolBuildNumber;
859
+ this.applicationVersion = options.applicationVersion;
860
+ this.applicationBuildNumber = options.applicationBuildNumber;
861
+ }
862
+ static from(raw, ctx) {
863
+ validatePayload(raw.payload.length >= 23);
864
+ const sdkVersion = parseVersion(raw.payload);
865
+ const applicationFrameworkAPIVersion = parseVersion(raw.payload.subarray(3));
866
+ let applicationFrameworkBuildNumber;
867
+ if (applicationFrameworkAPIVersion !== "unused") {
868
+ applicationFrameworkBuildNumber = raw.payload.readUInt16BE(6);
869
+ }
870
+ else {
871
+ applicationFrameworkBuildNumber = 0;
872
+ }
873
+ const hostInterfaceVersion = parseVersion(raw.payload.subarray(8));
874
+ let hostInterfaceBuildNumber;
875
+ if (hostInterfaceVersion !== "unused") {
876
+ hostInterfaceBuildNumber = raw.payload.readUInt16BE(11);
877
+ }
878
+ else {
879
+ hostInterfaceBuildNumber = 0;
880
+ }
881
+ const zWaveProtocolVersion = parseVersion(raw.payload.subarray(13));
882
+ let zWaveProtocolBuildNumber;
883
+ if (zWaveProtocolVersion !== "unused") {
884
+ zWaveProtocolBuildNumber = raw.payload.readUInt16BE(16);
885
+ }
886
+ else {
887
+ zWaveProtocolBuildNumber = 0;
888
+ }
889
+ const applicationVersion = parseVersion(raw.payload.subarray(18));
890
+ let applicationBuildNumber;
891
+ if (applicationVersion !== "unused") {
892
+ applicationBuildNumber = raw.payload.readUInt16BE(21);
893
+ }
894
+ else {
895
+ applicationBuildNumber = 0;
896
+ }
897
+ return new this({
898
+ nodeId: ctx.sourceNodeId,
899
+ sdkVersion,
900
+ applicationFrameworkAPIVersion,
901
+ applicationFrameworkBuildNumber,
902
+ hostInterfaceVersion,
903
+ hostInterfaceBuildNumber,
904
+ zWaveProtocolVersion,
905
+ zWaveProtocolBuildNumber,
906
+ applicationVersion,
907
+ applicationBuildNumber,
908
+ });
909
+ }
910
+ sdkVersion;
911
+ applicationFrameworkAPIVersion;
912
+ applicationFrameworkBuildNumber;
913
+ hostInterfaceVersion;
914
+ hostInterfaceBuildNumber;
915
+ zWaveProtocolVersion;
916
+ zWaveProtocolBuildNumber;
917
+ applicationVersion;
918
+ applicationBuildNumber;
919
+ toLogEntry(ctx) {
920
+ const message = {
921
+ "SDK version": this.sdkVersion,
922
+ };
923
+ message["appl. framework API version"] =
924
+ this.applicationFrameworkAPIVersion;
925
+ if (this.applicationFrameworkAPIVersion !== "unused") {
926
+ message["appl. framework build number"] =
927
+ this.applicationFrameworkBuildNumber;
928
+ }
929
+ message["host interface version"] = this.hostInterfaceVersion;
930
+ if (this.hostInterfaceVersion !== "unused") {
931
+ message["host interface build number"] =
932
+ this.hostInterfaceBuildNumber;
933
+ }
934
+ message["Z-Wave protocol version"] = this.zWaveProtocolVersion;
935
+ if (this.zWaveProtocolVersion !== "unused") {
936
+ message["Z-Wave protocol build number"] =
937
+ this.zWaveProtocolBuildNumber;
938
+ }
939
+ message["application version"] = this.applicationVersion;
940
+ if (this.applicationVersion !== "unused") {
941
+ message["application build number"] = this.applicationBuildNumber;
942
+ }
943
+ return {
944
+ ...super.toLogEntry(ctx),
945
+ message,
946
+ };
947
+ }
948
+ };
949
+ return VersionCCZWaveSoftwareReport = _classThis;
950
+ })();
854
951
  export { VersionCCZWaveSoftwareReport };
855
- let VersionCCZWaveSoftwareGet = class VersionCCZWaveSoftwareGet extends VersionCC {
856
- };
857
- VersionCCZWaveSoftwareGet = __decorate([
858
- CCCommand(VersionCommand.ZWaveSoftwareGet),
859
- expectedCCResponse(VersionCCZWaveSoftwareReport)
860
- ], VersionCCZWaveSoftwareGet);
952
+ let VersionCCZWaveSoftwareGet = (() => {
953
+ let _classDecorators = [CCCommand(VersionCommand.ZWaveSoftwareGet), expectedCCResponse(VersionCCZWaveSoftwareReport)];
954
+ let _classDescriptor;
955
+ let _classExtraInitializers = [];
956
+ let _classThis;
957
+ let _classSuper = VersionCC;
958
+ var VersionCCZWaveSoftwareGet = class extends _classSuper {
959
+ static { _classThis = this; }
960
+ static {
961
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
962
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
963
+ VersionCCZWaveSoftwareGet = _classThis = _classDescriptor.value;
964
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
965
+ __runInitializers(_classThis, _classExtraInitializers);
966
+ }
967
+ };
968
+ return VersionCCZWaveSoftwareGet = _classThis;
969
+ })();
861
970
  export { VersionCCZWaveSoftwareGet };
862
971
  //# sourceMappingURL=VersionCC.js.map