@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 ProtectionCCReport_1, ProtectionCCSupportedReport_1, ProtectionCCExclusiveControlReport_1, ProtectionCCTimeoutReport_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -49,7 +76,7 @@ import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
49
76
  import { padStart } from "alcalzone-shared/strings/index.js";
50
77
  import { CCAPI, POLL_VALUE, SET_VALUE, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
51
78
  import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
52
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
79
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
53
80
  import { V } from "../lib/Values.js";
54
81
  import { LocalProtectionState, ProtectionCommand, RFProtectionState, } from "../lib/_Types.js";
55
82
  export const ProtectionCCValues = Object.freeze({
@@ -88,582 +115,716 @@ export const ProtectionCCValues = Object.freeze({
88
115
  }),
89
116
  }),
90
117
  });
91
- let ProtectionCCAPI = class ProtectionCCAPI extends CCAPI {
92
- supportsCommand(cmd) {
93
- switch (cmd) {
94
- case ProtectionCommand.Get:
95
- return this.isSinglecast();
96
- case ProtectionCommand.Set:
97
- return true; // This is mandatory
98
- case ProtectionCommand.SupportedGet:
99
- return this.version >= 2 && this.isSinglecast();
100
- case ProtectionCommand.TimeoutGet:
101
- case ProtectionCommand.TimeoutSet: {
102
- return (this.isSinglecast()
103
- && this.tryGetValueDB()?.getValue(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));
104
- }
105
- case ProtectionCommand.ExclusiveControlGet:
106
- case ProtectionCommand.ExclusiveControlSet: {
107
- return (this.isSinglecast()
108
- && this.tryGetValueDB()?.getValue(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));
109
- }
118
+ let ProtectionCCAPI = (() => {
119
+ let _classDecorators = [API(CommandClasses.Protection)];
120
+ let _classDescriptor;
121
+ let _classExtraInitializers = [];
122
+ let _classThis;
123
+ let _classSuper = CCAPI;
124
+ var ProtectionCCAPI = class extends _classSuper {
125
+ static { _classThis = this; }
126
+ static {
127
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
128
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
129
+ ProtectionCCAPI = _classThis = _classDescriptor.value;
130
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
131
+ __runInitializers(_classThis, _classExtraInitializers);
110
132
  }
111
- return super.supportsCommand(cmd);
112
- }
113
- get [SET_VALUE]() {
114
- return async function ({ property }, value) {
115
- const valueDB = this.tryGetValueDB();
116
- if (property === "local") {
117
- if (typeof value !== "number") {
118
- throwWrongValueType(this.ccId, property, "number", typeof value);
133
+ supportsCommand(cmd) {
134
+ switch (cmd) {
135
+ case ProtectionCommand.Get:
136
+ return this.isSinglecast();
137
+ case ProtectionCommand.Set:
138
+ return true; // This is mandatory
139
+ case ProtectionCommand.SupportedGet:
140
+ return this.version >= 2 && this.isSinglecast();
141
+ case ProtectionCommand.TimeoutGet:
142
+ case ProtectionCommand.TimeoutSet: {
143
+ return (this.isSinglecast()
144
+ && this.tryGetValueDB()?.getValue(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));
119
145
  }
120
- // We need to set both values together, so retrieve the other one from the value DB
121
- const rf = valueDB?.getValue(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));
122
- return this.set(value, rf);
123
- }
124
- else if (property === "rf") {
125
- if (typeof value !== "number") {
126
- throwWrongValueType(this.ccId, property, "number", typeof value);
146
+ case ProtectionCommand.ExclusiveControlGet:
147
+ case ProtectionCommand.ExclusiveControlSet: {
148
+ return (this.isSinglecast()
149
+ && this.tryGetValueDB()?.getValue(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));
127
150
  }
128
- // We need to set both values together, so retrieve the other one from the value DB
129
- const local = valueDB?.getValue(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));
130
- return this.set(local ?? LocalProtectionState.Unprotected, value);
131
151
  }
132
- else if (property === "exclusiveControlNodeId") {
133
- if (typeof value !== "number") {
134
- throwWrongValueType(this.ccId, property, "number", typeof value);
152
+ return super.supportsCommand(cmd);
153
+ }
154
+ get [SET_VALUE]() {
155
+ return async function ({ property }, value) {
156
+ const valueDB = this.tryGetValueDB();
157
+ if (property === "local") {
158
+ if (typeof value !== "number") {
159
+ throwWrongValueType(this.ccId, property, "number", typeof value);
160
+ }
161
+ // We need to set both values together, so retrieve the other one from the value DB
162
+ const rf = valueDB?.getValue(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));
163
+ return this.set(value, rf);
135
164
  }
136
- return this.setExclusiveControl(value);
137
- }
138
- else {
139
- throwUnsupportedProperty(this.ccId, property);
140
- }
141
- };
142
- }
143
- get [POLL_VALUE]() {
144
- return async function ({ property }) {
145
- switch (property) {
146
- case "local":
147
- case "rf":
148
- return (await this.get())?.[property];
149
- case "exclusiveControlNodeId":
150
- return this.getExclusiveControl();
151
- default:
165
+ else if (property === "rf") {
166
+ if (typeof value !== "number") {
167
+ throwWrongValueType(this.ccId, property, "number", typeof value);
168
+ }
169
+ // We need to set both values together, so retrieve the other one from the value DB
170
+ const local = valueDB?.getValue(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));
171
+ return this.set(local ?? LocalProtectionState.Unprotected, value);
172
+ }
173
+ else if (property === "exclusiveControlNodeId") {
174
+ if (typeof value !== "number") {
175
+ throwWrongValueType(this.ccId, property, "number", typeof value);
176
+ }
177
+ return this.setExclusiveControl(value);
178
+ }
179
+ else {
152
180
  throwUnsupportedProperty(this.ccId, property);
181
+ }
182
+ };
183
+ }
184
+ get [POLL_VALUE]() {
185
+ return async function ({ property }) {
186
+ switch (property) {
187
+ case "local":
188
+ case "rf":
189
+ return (await this.get())?.[property];
190
+ case "exclusiveControlNodeId":
191
+ return this.getExclusiveControl();
192
+ default:
193
+ throwUnsupportedProperty(this.ccId, property);
194
+ }
195
+ };
196
+ }
197
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
198
+ async get() {
199
+ this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);
200
+ const cc = new ProtectionCCGet({
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, ["local", "rf"]);
153
207
  }
154
- };
155
- }
156
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
157
- async get() {
158
- this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);
159
- const cc = new ProtectionCCGet({
160
- nodeId: this.endpoint.nodeId,
161
- endpointIndex: this.endpoint.index,
162
- });
163
- const response = await this.host.sendCommand(cc, this.commandOptions);
164
- if (response) {
165
- return pick(response, ["local", "rf"]);
166
208
  }
167
- }
168
- async set(local, rf) {
169
- __assertType("local", "LocalProtectionState", __assertType__LocalProtectionState.bind(void 0, local));
170
- __assertType("rf", "(optional) RFProtectionState", __assertType__optional_RFProtectionState.bind(void 0, rf));
171
- this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);
172
- const cc = new ProtectionCCSet({
173
- nodeId: this.endpoint.nodeId,
174
- endpointIndex: this.endpoint.index,
175
- local,
176
- rf,
177
- });
178
- return this.host.sendCommand(cc, this.commandOptions);
179
- }
180
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
181
- async getSupported() {
182
- this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);
183
- const cc = new ProtectionCCSupportedGet({
184
- nodeId: this.endpoint.nodeId,
185
- endpointIndex: this.endpoint.index,
186
- });
187
- const response = await this.host.sendCommand(cc, this.commandOptions);
188
- if (response) {
189
- return pick(response, [
190
- "supportsExclusiveControl",
191
- "supportsTimeout",
192
- "supportedLocalStates",
193
- "supportedRFStates",
194
- ]);
209
+ async set(local, rf) {
210
+ __assertType("local", "LocalProtectionState", __assertType__LocalProtectionState.bind(void 0, local));
211
+ __assertType("rf", "(optional) RFProtectionState", __assertType__optional_RFProtectionState.bind(void 0, rf));
212
+ this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);
213
+ const cc = new ProtectionCCSet({
214
+ nodeId: this.endpoint.nodeId,
215
+ endpointIndex: this.endpoint.index,
216
+ local,
217
+ rf,
218
+ });
219
+ return this.host.sendCommand(cc, this.commandOptions);
195
220
  }
196
- }
197
- async getExclusiveControl() {
198
- this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);
199
- const cc = new ProtectionCCExclusiveControlGet({
200
- nodeId: this.endpoint.nodeId,
201
- endpointIndex: this.endpoint.index,
202
- });
203
- const response = await this.host.sendCommand(cc, this.commandOptions);
204
- return response?.exclusiveControlNodeId;
205
- }
206
- async setExclusiveControl(nodeId) {
207
- __assertType("nodeId", "number", __assertType__number.bind(void 0, nodeId));
208
- this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);
209
- const cc = new ProtectionCCExclusiveControlSet({
210
- nodeId: this.endpoint.nodeId,
211
- endpointIndex: this.endpoint.index,
212
- exclusiveControlNodeId: nodeId,
213
- });
214
- return this.host.sendCommand(cc, this.commandOptions);
215
- }
216
- async getTimeout() {
217
- this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);
218
- const cc = new ProtectionCCTimeoutGet({
219
- nodeId: this.endpoint.nodeId,
220
- endpointIndex: this.endpoint.index,
221
- });
222
- const response = await this.host.sendCommand(cc, this.commandOptions);
223
- return response?.timeout;
224
- }
225
- async setTimeout(timeout) {
226
- __assertType("timeout", "Timeout", __assertType__Timeout.bind(void 0, timeout));
227
- this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);
228
- const cc = new ProtectionCCTimeoutSet({
229
- nodeId: this.endpoint.nodeId,
230
- endpointIndex: this.endpoint.index,
231
- timeout,
232
- });
233
- return this.host.sendCommand(cc, this.commandOptions);
234
- }
235
- };
236
- ProtectionCCAPI = __decorate([
237
- API(CommandClasses.Protection)
238
- ], ProtectionCCAPI);
221
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
222
+ async getSupported() {
223
+ this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);
224
+ const cc = new ProtectionCCSupportedGet({
225
+ nodeId: this.endpoint.nodeId,
226
+ endpointIndex: this.endpoint.index,
227
+ });
228
+ const response = await this.host.sendCommand(cc, this.commandOptions);
229
+ if (response) {
230
+ return pick(response, [
231
+ "supportsExclusiveControl",
232
+ "supportsTimeout",
233
+ "supportedLocalStates",
234
+ "supportedRFStates",
235
+ ]);
236
+ }
237
+ }
238
+ async getExclusiveControl() {
239
+ this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);
240
+ const cc = new ProtectionCCExclusiveControlGet({
241
+ nodeId: this.endpoint.nodeId,
242
+ endpointIndex: this.endpoint.index,
243
+ });
244
+ const response = await this.host.sendCommand(cc, this.commandOptions);
245
+ return response?.exclusiveControlNodeId;
246
+ }
247
+ async setExclusiveControl(nodeId) {
248
+ __assertType("nodeId", "number", __assertType__number.bind(void 0, nodeId));
249
+ this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);
250
+ const cc = new ProtectionCCExclusiveControlSet({
251
+ nodeId: this.endpoint.nodeId,
252
+ endpointIndex: this.endpoint.index,
253
+ exclusiveControlNodeId: nodeId,
254
+ });
255
+ return this.host.sendCommand(cc, this.commandOptions);
256
+ }
257
+ async getTimeout() {
258
+ this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);
259
+ const cc = new ProtectionCCTimeoutGet({
260
+ nodeId: this.endpoint.nodeId,
261
+ endpointIndex: this.endpoint.index,
262
+ });
263
+ const response = await this.host.sendCommand(cc, this.commandOptions);
264
+ return response?.timeout;
265
+ }
266
+ async setTimeout(timeout) {
267
+ __assertType("timeout", "Timeout", __assertType__Timeout.bind(void 0, timeout));
268
+ this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);
269
+ const cc = new ProtectionCCTimeoutSet({
270
+ nodeId: this.endpoint.nodeId,
271
+ endpointIndex: this.endpoint.index,
272
+ timeout,
273
+ });
274
+ return this.host.sendCommand(cc, this.commandOptions);
275
+ }
276
+ };
277
+ return ProtectionCCAPI = _classThis;
278
+ })();
239
279
  export { ProtectionCCAPI };
240
- let ProtectionCC = class ProtectionCC extends CommandClass {
241
- async interview(ctx) {
242
- const node = this.getNode(ctx);
243
- const endpoint = this.getEndpoint(ctx);
244
- const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({
245
- priority: MessagePriority.NodeQuery,
246
- });
247
- ctx.logNode(node.id, {
248
- endpoint: this.endpointIndex,
249
- message: `Interviewing ${this.ccName}...`,
250
- direction: "none",
251
- });
252
- // We need to do some queries after a potential timeout
253
- // In this case, do now mark this CC as interviewed completely
254
- let hadCriticalTimeout = false;
255
- // First find out what the device supports
256
- if (api.version >= 2) {
280
+ let ProtectionCC = (() => {
281
+ let _classDecorators = [commandClass(CommandClasses.Protection), implementedVersion(2), ccValues(ProtectionCCValues)];
282
+ let _classDescriptor;
283
+ let _classExtraInitializers = [];
284
+ let _classThis;
285
+ let _classSuper = CommandClass;
286
+ var ProtectionCC = class extends _classSuper {
287
+ static { _classThis = this; }
288
+ static {
289
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
290
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
291
+ ProtectionCC = _classThis = _classDescriptor.value;
292
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
293
+ __runInitializers(_classThis, _classExtraInitializers);
294
+ }
295
+ async interview(ctx) {
296
+ const node = this.getNode(ctx);
297
+ const endpoint = this.getEndpoint(ctx);
298
+ const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({
299
+ priority: MessagePriority.NodeQuery,
300
+ });
257
301
  ctx.logNode(node.id, {
258
- message: "querying protection capabilities...",
259
- direction: "outbound",
302
+ endpoint: this.endpointIndex,
303
+ message: `Interviewing ${this.ccName}...`,
304
+ direction: "none",
260
305
  });
261
- const resp = await api.getSupported();
262
- if (resp) {
263
- const logMessage = `received protection capabilities:
306
+ // We need to do some queries after a potential timeout
307
+ // In this case, do now mark this CC as interviewed completely
308
+ let hadCriticalTimeout = false;
309
+ // First find out what the device supports
310
+ if (api.version >= 2) {
311
+ ctx.logNode(node.id, {
312
+ message: "querying protection capabilities...",
313
+ direction: "outbound",
314
+ });
315
+ const resp = await api.getSupported();
316
+ if (resp) {
317
+ const logMessage = `received protection capabilities:
264
318
  exclusive control: ${resp.supportsExclusiveControl}
265
319
  timeout: ${resp.supportsTimeout}
266
320
  local protection states: ${resp.supportedLocalStates
267
- .map((local) => getEnumMemberName(LocalProtectionState, local))
268
- .map((str) => `\n· ${str}`)
269
- .join("")}
321
+ .map((local) => getEnumMemberName(LocalProtectionState, local))
322
+ .map((str) => `\n· ${str}`)
323
+ .join("")}
270
324
  RF protection states: ${resp.supportedRFStates
271
- .map((local) => getEnumMemberName(RFProtectionState, local))
272
- .map((str) => `\n· ${str}`)
273
- .join("")}`;
274
- ctx.logNode(node.id, {
275
- message: logMessage,
276
- direction: "inbound",
277
- });
278
- }
279
- else {
280
- hadCriticalTimeout = true;
325
+ .map((local) => getEnumMemberName(RFProtectionState, local))
326
+ .map((str) => `\n· ${str}`)
327
+ .join("")}`;
328
+ ctx.logNode(node.id, {
329
+ message: logMessage,
330
+ direction: "inbound",
331
+ });
332
+ }
333
+ else {
334
+ hadCriticalTimeout = true;
335
+ }
281
336
  }
337
+ await this.refreshValues(ctx);
338
+ // Remember that the interview is complete
339
+ if (!hadCriticalTimeout)
340
+ this.setInterviewComplete(ctx, true);
282
341
  }
283
- await this.refreshValues(ctx);
284
- // Remember that the interview is complete
285
- if (!hadCriticalTimeout)
286
- this.setInterviewComplete(ctx, true);
287
- }
288
- async refreshValues(ctx) {
289
- const node = this.getNode(ctx);
290
- const endpoint = this.getEndpoint(ctx);
291
- const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({
292
- priority: MessagePriority.NodeQuery,
293
- });
294
- const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);
295
- const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);
296
- // Query the current state
297
- ctx.logNode(node.id, {
298
- message: "querying protection status...",
299
- direction: "outbound",
300
- });
301
- const protectionResp = await api.get();
302
- if (protectionResp) {
303
- let logMessage = `received protection status:
304
- local: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;
305
- if (protectionResp.rf != undefined) {
306
- logMessage += `
307
- rf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;
308
- }
309
- ctx.logNode(node.id, {
310
- message: logMessage,
311
- direction: "inbound",
342
+ async refreshValues(ctx) {
343
+ const node = this.getNode(ctx);
344
+ const endpoint = this.getEndpoint(ctx);
345
+ const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({
346
+ priority: MessagePriority.NodeQuery,
312
347
  });
313
- }
314
- if (supportsTimeout) {
315
- // Query the current timeout
348
+ const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);
349
+ const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);
350
+ // Query the current state
316
351
  ctx.logNode(node.id, {
317
- message: "querying protection timeout...",
352
+ message: "querying protection status...",
318
353
  direction: "outbound",
319
354
  });
320
- const timeout = await api.getTimeout();
321
- if (timeout) {
355
+ const protectionResp = await api.get();
356
+ if (protectionResp) {
357
+ let logMessage = `received protection status:
358
+ local: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;
359
+ if (protectionResp.rf != undefined) {
360
+ logMessage += `
361
+ rf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;
362
+ }
322
363
  ctx.logNode(node.id, {
323
- message: `received timeout: ${timeout.toString()}`,
364
+ message: logMessage,
324
365
  direction: "inbound",
325
366
  });
326
367
  }
327
- }
328
- if (supportsExclusiveControl) {
329
- // Query the current timeout
330
- ctx.logNode(node.id, {
331
- message: "querying exclusive control node...",
332
- direction: "outbound",
333
- });
334
- const nodeId = await api.getExclusiveControl();
335
- if (nodeId != undefined) {
368
+ if (supportsTimeout) {
369
+ // Query the current timeout
336
370
  ctx.logNode(node.id, {
337
- message: (nodeId !== 0
338
- ? `Node ${padStart(nodeId.toString(), 3, "0")}`
339
- : `no node`) + ` has exclusive control`,
340
- direction: "inbound",
371
+ message: "querying protection timeout...",
372
+ direction: "outbound",
373
+ });
374
+ const timeout = await api.getTimeout();
375
+ if (timeout) {
376
+ ctx.logNode(node.id, {
377
+ message: `received timeout: ${timeout.toString()}`,
378
+ direction: "inbound",
379
+ });
380
+ }
381
+ }
382
+ if (supportsExclusiveControl) {
383
+ // Query the current timeout
384
+ ctx.logNode(node.id, {
385
+ message: "querying exclusive control node...",
386
+ direction: "outbound",
341
387
  });
388
+ const nodeId = await api.getExclusiveControl();
389
+ if (nodeId != undefined) {
390
+ ctx.logNode(node.id, {
391
+ message: (nodeId !== 0
392
+ ? `Node ${padStart(nodeId.toString(), 3, "0")}`
393
+ : `no node`) + ` has exclusive control`,
394
+ direction: "inbound",
395
+ });
396
+ }
342
397
  }
343
398
  }
344
- }
345
- };
346
- ProtectionCC = __decorate([
347
- commandClass(CommandClasses.Protection),
348
- implementedVersion(2),
349
- ccValues(ProtectionCCValues)
350
- ], ProtectionCC);
399
+ };
400
+ return ProtectionCC = _classThis;
401
+ })();
351
402
  export { ProtectionCC };
352
- let ProtectionCCSet = class ProtectionCCSet extends ProtectionCC {
353
- constructor(options) {
354
- super(options);
355
- this.local = options.local;
356
- this.rf = options.rf;
357
- }
358
- static from(_raw, _ctx) {
359
- // TODO: Deserialize payload
360
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
361
- // return new ProtectionCCSet({
362
- // nodeId: ctx.sourceNodeId,
363
- // });
364
- }
365
- local;
366
- rf;
367
- serialize(ctx) {
368
- this.payload = Bytes.from([
369
- this.local & 0b1111,
370
- (this.rf ?? RFProtectionState.Unprotected) & 0b1111,
371
- ]);
372
- const ccVersion = getEffectiveCCVersion(ctx, this);
373
- if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
374
- // When forcing CC version 1, only include the local state
375
- this.payload = this.payload.subarray(0, 1);
376
- }
377
- return super.serialize(ctx);
378
- }
379
- toLogEntry(ctx) {
380
- const message = {
381
- local: getEnumMemberName(LocalProtectionState, this.local),
382
- };
383
- if (this.rf != undefined) {
384
- message.rf = getEnumMemberName(RFProtectionState, this.rf);
385
- }
386
- return {
387
- ...super.toLogEntry(ctx),
388
- message,
389
- };
390
- }
391
- };
392
- ProtectionCCSet = __decorate([
393
- CCCommand(ProtectionCommand.Set),
394
- useSupervision()
395
- ], ProtectionCCSet);
403
+ let ProtectionCCSet = (() => {
404
+ let _classDecorators = [CCCommand(ProtectionCommand.Set), useSupervision()];
405
+ let _classDescriptor;
406
+ let _classExtraInitializers = [];
407
+ let _classThis;
408
+ let _classSuper = ProtectionCC;
409
+ var ProtectionCCSet = class extends _classSuper {
410
+ static { _classThis = this; }
411
+ static {
412
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
413
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
414
+ ProtectionCCSet = _classThis = _classDescriptor.value;
415
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
416
+ __runInitializers(_classThis, _classExtraInitializers);
417
+ }
418
+ constructor(options) {
419
+ super(options);
420
+ this.local = options.local;
421
+ this.rf = options.rf;
422
+ }
423
+ static from(_raw, _ctx) {
424
+ // TODO: Deserialize payload
425
+ throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
426
+ // return new ProtectionCCSet({
427
+ // nodeId: ctx.sourceNodeId,
428
+ // });
429
+ }
430
+ local;
431
+ rf;
432
+ serialize(ctx) {
433
+ this.payload = Bytes.from([
434
+ this.local & 0b1111,
435
+ (this.rf ?? RFProtectionState.Unprotected) & 0b1111,
436
+ ]);
437
+ const ccVersion = getEffectiveCCVersion(ctx, this);
438
+ if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
439
+ // When forcing CC version 1, only include the local state
440
+ this.payload = this.payload.subarray(0, 1);
441
+ }
442
+ return super.serialize(ctx);
443
+ }
444
+ toLogEntry(ctx) {
445
+ const message = {
446
+ local: getEnumMemberName(LocalProtectionState, this.local),
447
+ };
448
+ if (this.rf != undefined) {
449
+ message.rf = getEnumMemberName(RFProtectionState, this.rf);
450
+ }
451
+ return {
452
+ ...super.toLogEntry(ctx),
453
+ message,
454
+ };
455
+ }
456
+ };
457
+ return ProtectionCCSet = _classThis;
458
+ })();
396
459
  export { ProtectionCCSet };
397
- let ProtectionCCReport = ProtectionCCReport_1 = class ProtectionCCReport extends ProtectionCC {
398
- constructor(options) {
399
- super(options);
400
- // TODO: Check implementation:
401
- this.local = options.local;
402
- this.rf = options.rf;
403
- }
404
- static from(raw, ctx) {
405
- validatePayload(raw.payload.length >= 1);
406
- const local = raw.payload[0] & 0b1111;
407
- let rf;
408
- if (raw.payload.length >= 2) {
409
- rf = raw.payload[1] & 0b1111;
410
- }
411
- return new ProtectionCCReport_1({
412
- nodeId: ctx.sourceNodeId,
413
- local,
414
- rf,
415
- });
416
- }
417
- local;
418
- rf;
419
- toLogEntry(ctx) {
420
- const message = {
421
- local: getEnumMemberName(LocalProtectionState, this.local),
422
- };
423
- if (this.rf != undefined) {
424
- message.rf = getEnumMemberName(RFProtectionState, this.rf);
425
- }
426
- return {
427
- ...super.toLogEntry(ctx),
428
- message,
429
- };
430
- }
431
- };
432
- __decorate([
433
- ccValue(ProtectionCCValues.localProtectionState)
434
- ], ProtectionCCReport.prototype, "local", void 0);
435
- __decorate([
436
- ccValue(ProtectionCCValues.rfProtectionState)
437
- ], ProtectionCCReport.prototype, "rf", void 0);
438
- ProtectionCCReport = ProtectionCCReport_1 = __decorate([
439
- CCCommand(ProtectionCommand.Report)
440
- ], ProtectionCCReport);
460
+ let ProtectionCCReport = (() => {
461
+ let _classDecorators = [CCCommand(ProtectionCommand.Report), ccValueProperty("local", ProtectionCCValues.localProtectionState), ccValueProperty("rf", ProtectionCCValues.rfProtectionState)];
462
+ let _classDescriptor;
463
+ let _classExtraInitializers = [];
464
+ let _classThis;
465
+ let _classSuper = ProtectionCC;
466
+ var ProtectionCCReport = class extends _classSuper {
467
+ static { _classThis = this; }
468
+ static {
469
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
470
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
471
+ ProtectionCCReport = _classThis = _classDescriptor.value;
472
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
473
+ __runInitializers(_classThis, _classExtraInitializers);
474
+ }
475
+ constructor(options) {
476
+ super(options);
477
+ // TODO: Check implementation:
478
+ this.local = options.local;
479
+ this.rf = options.rf;
480
+ }
481
+ static from(raw, ctx) {
482
+ validatePayload(raw.payload.length >= 1);
483
+ const local = raw.payload[0] & 0b1111;
484
+ let rf;
485
+ if (raw.payload.length >= 2) {
486
+ rf = raw.payload[1] & 0b1111;
487
+ }
488
+ return new this({
489
+ nodeId: ctx.sourceNodeId,
490
+ local,
491
+ rf,
492
+ });
493
+ }
494
+ local;
495
+ rf;
496
+ toLogEntry(ctx) {
497
+ const message = {
498
+ local: getEnumMemberName(LocalProtectionState, this.local),
499
+ };
500
+ if (this.rf != undefined) {
501
+ message.rf = getEnumMemberName(RFProtectionState, this.rf);
502
+ }
503
+ return {
504
+ ...super.toLogEntry(ctx),
505
+ message,
506
+ };
507
+ }
508
+ };
509
+ return ProtectionCCReport = _classThis;
510
+ })();
441
511
  export { ProtectionCCReport };
442
- let ProtectionCCGet = class ProtectionCCGet extends ProtectionCC {
443
- };
444
- ProtectionCCGet = __decorate([
445
- CCCommand(ProtectionCommand.Get),
446
- expectedCCResponse(ProtectionCCReport)
447
- ], ProtectionCCGet);
512
+ let ProtectionCCGet = (() => {
513
+ let _classDecorators = [CCCommand(ProtectionCommand.Get), expectedCCResponse(ProtectionCCReport)];
514
+ let _classDescriptor;
515
+ let _classExtraInitializers = [];
516
+ let _classThis;
517
+ let _classSuper = ProtectionCC;
518
+ var ProtectionCCGet = class extends _classSuper {
519
+ static { _classThis = this; }
520
+ static {
521
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
522
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
523
+ ProtectionCCGet = _classThis = _classDescriptor.value;
524
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
525
+ __runInitializers(_classThis, _classExtraInitializers);
526
+ }
527
+ };
528
+ return ProtectionCCGet = _classThis;
529
+ })();
448
530
  export { ProtectionCCGet };
449
- let ProtectionCCSupportedReport = ProtectionCCSupportedReport_1 = class ProtectionCCSupportedReport extends ProtectionCC {
450
- constructor(options) {
451
- super(options);
452
- // TODO: Check implementation:
453
- this.supportsTimeout = options.supportsTimeout;
454
- this.supportsExclusiveControl = options.supportsExclusiveControl;
455
- this.supportedLocalStates = options.supportedLocalStates;
456
- this.supportedRFStates = options.supportedRFStates;
457
- }
458
- static from(raw, ctx) {
459
- validatePayload(raw.payload.length >= 5);
460
- const supportsTimeout = !!(raw.payload[0] & 0b1);
461
- const supportsExclusiveControl = !!(raw.payload[0] & 0b10);
462
- const supportedLocalStates = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);
463
- const supportedRFStates = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);
464
- return new ProtectionCCSupportedReport_1({
465
- nodeId: ctx.sourceNodeId,
466
- supportsTimeout,
467
- supportsExclusiveControl,
468
- supportedLocalStates,
469
- supportedRFStates,
470
- });
471
- }
472
- persistValues(ctx) {
473
- if (!super.persistValues(ctx))
474
- return false;
475
- // update metadata (partially) for the local and rf values
476
- const localStateValue = ProtectionCCValues.localProtectionState;
477
- this.setMetadata(ctx, localStateValue, {
478
- ...localStateValue.meta,
479
- states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),
480
- });
481
- const rfStateValue = ProtectionCCValues.rfProtectionState;
482
- this.setMetadata(ctx, rfStateValue, {
483
- ...rfStateValue.meta,
484
- states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),
485
- });
486
- return true;
487
- }
488
- supportsExclusiveControl;
489
- supportsTimeout;
490
- supportedLocalStates;
491
- supportedRFStates;
492
- toLogEntry(ctx) {
493
- return {
494
- ...super.toLogEntry(ctx),
495
- message: {
496
- "supports exclusive control": this.supportsExclusiveControl,
497
- "supports timeout": this.supportsTimeout,
498
- "local protection states": this.supportedLocalStates
499
- .map((local) => getEnumMemberName(LocalProtectionState, local))
500
- .map((str) => `\n· ${str}`)
501
- .join(""),
502
- "RF protection states": this.supportedRFStates
503
- .map((rf) => getEnumMemberName(RFProtectionState, rf))
504
- .map((str) => `\n· ${str}`)
505
- .join(""),
506
- },
507
- };
508
- }
509
- };
510
- __decorate([
511
- ccValue(ProtectionCCValues.supportsExclusiveControl)
512
- ], ProtectionCCSupportedReport.prototype, "supportsExclusiveControl", void 0);
513
- __decorate([
514
- ccValue(ProtectionCCValues.supportsTimeout)
515
- ], ProtectionCCSupportedReport.prototype, "supportsTimeout", void 0);
516
- __decorate([
517
- ccValue(ProtectionCCValues.supportedLocalStates)
518
- ], ProtectionCCSupportedReport.prototype, "supportedLocalStates", void 0);
519
- __decorate([
520
- ccValue(ProtectionCCValues.supportedRFStates)
521
- ], ProtectionCCSupportedReport.prototype, "supportedRFStates", void 0);
522
- ProtectionCCSupportedReport = ProtectionCCSupportedReport_1 = __decorate([
523
- CCCommand(ProtectionCommand.SupportedReport)
524
- ], ProtectionCCSupportedReport);
531
+ let ProtectionCCSupportedReport = (() => {
532
+ let _classDecorators = [CCCommand(ProtectionCommand.SupportedReport), ccValueProperty("supportsExclusiveControl", ProtectionCCValues.supportsExclusiveControl), ccValueProperty("supportsTimeout", ProtectionCCValues.supportsTimeout), ccValueProperty("supportedLocalStates", ProtectionCCValues.supportedLocalStates), ccValueProperty("supportedRFStates", ProtectionCCValues.supportedRFStates)];
533
+ let _classDescriptor;
534
+ let _classExtraInitializers = [];
535
+ let _classThis;
536
+ let _classSuper = ProtectionCC;
537
+ var ProtectionCCSupportedReport = class extends _classSuper {
538
+ static { _classThis = this; }
539
+ static {
540
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
541
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
542
+ ProtectionCCSupportedReport = _classThis = _classDescriptor.value;
543
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
544
+ __runInitializers(_classThis, _classExtraInitializers);
545
+ }
546
+ constructor(options) {
547
+ super(options);
548
+ // TODO: Check implementation:
549
+ this.supportsTimeout = options.supportsTimeout;
550
+ this.supportsExclusiveControl = options.supportsExclusiveControl;
551
+ this.supportedLocalStates = options.supportedLocalStates;
552
+ this.supportedRFStates = options.supportedRFStates;
553
+ }
554
+ static from(raw, ctx) {
555
+ validatePayload(raw.payload.length >= 5);
556
+ const supportsTimeout = !!(raw.payload[0] & 0b1);
557
+ const supportsExclusiveControl = !!(raw.payload[0] & 0b10);
558
+ const supportedLocalStates = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);
559
+ const supportedRFStates = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);
560
+ return new this({
561
+ nodeId: ctx.sourceNodeId,
562
+ supportsTimeout,
563
+ supportsExclusiveControl,
564
+ supportedLocalStates,
565
+ supportedRFStates,
566
+ });
567
+ }
568
+ persistValues(ctx) {
569
+ if (!super.persistValues(ctx))
570
+ return false;
571
+ // update metadata (partially) for the local and rf values
572
+ const localStateValue = ProtectionCCValues.localProtectionState;
573
+ this.setMetadata(ctx, localStateValue, {
574
+ ...localStateValue.meta,
575
+ states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),
576
+ });
577
+ const rfStateValue = ProtectionCCValues.rfProtectionState;
578
+ this.setMetadata(ctx, rfStateValue, {
579
+ ...rfStateValue.meta,
580
+ states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),
581
+ });
582
+ return true;
583
+ }
584
+ supportsExclusiveControl;
585
+ supportsTimeout;
586
+ supportedLocalStates;
587
+ supportedRFStates;
588
+ toLogEntry(ctx) {
589
+ return {
590
+ ...super.toLogEntry(ctx),
591
+ message: {
592
+ "supports exclusive control": this.supportsExclusiveControl,
593
+ "supports timeout": this.supportsTimeout,
594
+ "local protection states": this.supportedLocalStates
595
+ .map((local) => getEnumMemberName(LocalProtectionState, local))
596
+ .map((str) => `\n· ${str}`)
597
+ .join(""),
598
+ "RF protection states": this.supportedRFStates
599
+ .map((rf) => getEnumMemberName(RFProtectionState, rf))
600
+ .map((str) => `\n· ${str}`)
601
+ .join(""),
602
+ },
603
+ };
604
+ }
605
+ };
606
+ return ProtectionCCSupportedReport = _classThis;
607
+ })();
525
608
  export { ProtectionCCSupportedReport };
526
- let ProtectionCCSupportedGet = class ProtectionCCSupportedGet extends ProtectionCC {
527
- };
528
- ProtectionCCSupportedGet = __decorate([
529
- CCCommand(ProtectionCommand.SupportedGet),
530
- expectedCCResponse(ProtectionCCSupportedReport)
531
- ], ProtectionCCSupportedGet);
609
+ let ProtectionCCSupportedGet = (() => {
610
+ let _classDecorators = [CCCommand(ProtectionCommand.SupportedGet), expectedCCResponse(ProtectionCCSupportedReport)];
611
+ let _classDescriptor;
612
+ let _classExtraInitializers = [];
613
+ let _classThis;
614
+ let _classSuper = ProtectionCC;
615
+ var ProtectionCCSupportedGet = class extends _classSuper {
616
+ static { _classThis = this; }
617
+ static {
618
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
619
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
620
+ ProtectionCCSupportedGet = _classThis = _classDescriptor.value;
621
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
622
+ __runInitializers(_classThis, _classExtraInitializers);
623
+ }
624
+ };
625
+ return ProtectionCCSupportedGet = _classThis;
626
+ })();
532
627
  export { ProtectionCCSupportedGet };
533
- let ProtectionCCExclusiveControlReport = ProtectionCCExclusiveControlReport_1 = class ProtectionCCExclusiveControlReport extends ProtectionCC {
534
- constructor(options) {
535
- super(options);
536
- // TODO: Check implementation:
537
- this.exclusiveControlNodeId = options.exclusiveControlNodeId;
538
- }
539
- static from(raw, ctx) {
540
- validatePayload(raw.payload.length >= 1);
541
- const exclusiveControlNodeId = raw.payload[0];
542
- return new ProtectionCCExclusiveControlReport_1({
543
- nodeId: ctx.sourceNodeId,
544
- exclusiveControlNodeId,
545
- });
546
- }
547
- exclusiveControlNodeId;
548
- toLogEntry(ctx) {
549
- return {
550
- ...super.toLogEntry(ctx),
551
- message: {
552
- "exclusive control node id": this.exclusiveControlNodeId,
553
- },
554
- };
555
- }
556
- };
557
- __decorate([
558
- ccValue(ProtectionCCValues.exclusiveControlNodeId)
559
- ], ProtectionCCExclusiveControlReport.prototype, "exclusiveControlNodeId", void 0);
560
- ProtectionCCExclusiveControlReport = ProtectionCCExclusiveControlReport_1 = __decorate([
561
- CCCommand(ProtectionCommand.ExclusiveControlReport)
562
- ], ProtectionCCExclusiveControlReport);
628
+ let ProtectionCCExclusiveControlReport = (() => {
629
+ let _classDecorators = [CCCommand(ProtectionCommand.ExclusiveControlReport), ccValueProperty("exclusiveControlNodeId", ProtectionCCValues.exclusiveControlNodeId)];
630
+ let _classDescriptor;
631
+ let _classExtraInitializers = [];
632
+ let _classThis;
633
+ let _classSuper = ProtectionCC;
634
+ var ProtectionCCExclusiveControlReport = class extends _classSuper {
635
+ static { _classThis = this; }
636
+ static {
637
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
638
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
639
+ ProtectionCCExclusiveControlReport = _classThis = _classDescriptor.value;
640
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
641
+ __runInitializers(_classThis, _classExtraInitializers);
642
+ }
643
+ constructor(options) {
644
+ super(options);
645
+ // TODO: Check implementation:
646
+ this.exclusiveControlNodeId = options.exclusiveControlNodeId;
647
+ }
648
+ static from(raw, ctx) {
649
+ validatePayload(raw.payload.length >= 1);
650
+ const exclusiveControlNodeId = raw.payload[0];
651
+ return new this({
652
+ nodeId: ctx.sourceNodeId,
653
+ exclusiveControlNodeId,
654
+ });
655
+ }
656
+ exclusiveControlNodeId;
657
+ toLogEntry(ctx) {
658
+ return {
659
+ ...super.toLogEntry(ctx),
660
+ message: {
661
+ "exclusive control node id": this.exclusiveControlNodeId,
662
+ },
663
+ };
664
+ }
665
+ };
666
+ return ProtectionCCExclusiveControlReport = _classThis;
667
+ })();
563
668
  export { ProtectionCCExclusiveControlReport };
564
- let ProtectionCCExclusiveControlGet = class ProtectionCCExclusiveControlGet extends ProtectionCC {
565
- };
566
- ProtectionCCExclusiveControlGet = __decorate([
567
- CCCommand(ProtectionCommand.ExclusiveControlGet),
568
- expectedCCResponse(ProtectionCCExclusiveControlReport)
569
- ], ProtectionCCExclusiveControlGet);
669
+ let ProtectionCCExclusiveControlGet = (() => {
670
+ let _classDecorators = [CCCommand(ProtectionCommand.ExclusiveControlGet), expectedCCResponse(ProtectionCCExclusiveControlReport)];
671
+ let _classDescriptor;
672
+ let _classExtraInitializers = [];
673
+ let _classThis;
674
+ let _classSuper = ProtectionCC;
675
+ var ProtectionCCExclusiveControlGet = class extends _classSuper {
676
+ static { _classThis = this; }
677
+ static {
678
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
679
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
680
+ ProtectionCCExclusiveControlGet = _classThis = _classDescriptor.value;
681
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
682
+ __runInitializers(_classThis, _classExtraInitializers);
683
+ }
684
+ };
685
+ return ProtectionCCExclusiveControlGet = _classThis;
686
+ })();
570
687
  export { ProtectionCCExclusiveControlGet };
571
- let ProtectionCCExclusiveControlSet = class ProtectionCCExclusiveControlSet extends ProtectionCC {
572
- constructor(options) {
573
- super(options);
574
- this.exclusiveControlNodeId = options.exclusiveControlNodeId;
575
- }
576
- static from(_raw, _ctx) {
577
- // TODO: Deserialize payload
578
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
579
- // return new ProtectionCCExclusiveControlSet({
580
- // nodeId: ctx.sourceNodeId,
581
- // });
582
- }
583
- exclusiveControlNodeId;
584
- serialize(ctx) {
585
- this.payload = Bytes.from([this.exclusiveControlNodeId]);
586
- return super.serialize(ctx);
587
- }
588
- toLogEntry(ctx) {
589
- return {
590
- ...super.toLogEntry(ctx),
591
- message: {
592
- "exclusive control node id": this.exclusiveControlNodeId,
593
- },
594
- };
595
- }
596
- };
597
- ProtectionCCExclusiveControlSet = __decorate([
598
- CCCommand(ProtectionCommand.ExclusiveControlSet),
599
- expectedCCResponse(ProtectionCCReport),
600
- useSupervision()
601
- ], ProtectionCCExclusiveControlSet);
688
+ let ProtectionCCExclusiveControlSet = (() => {
689
+ let _classDecorators = [CCCommand(ProtectionCommand.ExclusiveControlSet), expectedCCResponse(ProtectionCCReport), useSupervision()];
690
+ let _classDescriptor;
691
+ let _classExtraInitializers = [];
692
+ let _classThis;
693
+ let _classSuper = ProtectionCC;
694
+ var ProtectionCCExclusiveControlSet = class extends _classSuper {
695
+ static { _classThis = this; }
696
+ static {
697
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
698
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
699
+ ProtectionCCExclusiveControlSet = _classThis = _classDescriptor.value;
700
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
701
+ __runInitializers(_classThis, _classExtraInitializers);
702
+ }
703
+ constructor(options) {
704
+ super(options);
705
+ this.exclusiveControlNodeId = options.exclusiveControlNodeId;
706
+ }
707
+ static from(_raw, _ctx) {
708
+ // TODO: Deserialize payload
709
+ throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
710
+ // return new ProtectionCCExclusiveControlSet({
711
+ // nodeId: ctx.sourceNodeId,
712
+ // });
713
+ }
714
+ exclusiveControlNodeId;
715
+ serialize(ctx) {
716
+ this.payload = Bytes.from([this.exclusiveControlNodeId]);
717
+ return super.serialize(ctx);
718
+ }
719
+ toLogEntry(ctx) {
720
+ return {
721
+ ...super.toLogEntry(ctx),
722
+ message: {
723
+ "exclusive control node id": this.exclusiveControlNodeId,
724
+ },
725
+ };
726
+ }
727
+ };
728
+ return ProtectionCCExclusiveControlSet = _classThis;
729
+ })();
602
730
  export { ProtectionCCExclusiveControlSet };
603
- let ProtectionCCTimeoutReport = ProtectionCCTimeoutReport_1 = class ProtectionCCTimeoutReport extends ProtectionCC {
604
- constructor(options) {
605
- super(options);
606
- // TODO: Check implementation:
607
- this.timeout = options.timeout;
608
- }
609
- static from(raw, ctx) {
610
- validatePayload(raw.payload.length >= 1);
611
- const timeout = Timeout.parse(raw.payload[0]);
612
- return new ProtectionCCTimeoutReport_1({
613
- nodeId: ctx.sourceNodeId,
614
- timeout,
615
- });
616
- }
617
- timeout;
618
- toLogEntry(ctx) {
619
- return {
620
- ...super.toLogEntry(ctx),
621
- message: { timeout: this.timeout.toString() },
622
- };
623
- }
624
- };
625
- __decorate([
626
- ccValue(ProtectionCCValues.timeout)
627
- ], ProtectionCCTimeoutReport.prototype, "timeout", void 0);
628
- ProtectionCCTimeoutReport = ProtectionCCTimeoutReport_1 = __decorate([
629
- CCCommand(ProtectionCommand.TimeoutReport)
630
- ], ProtectionCCTimeoutReport);
731
+ let ProtectionCCTimeoutReport = (() => {
732
+ let _classDecorators = [CCCommand(ProtectionCommand.TimeoutReport), ccValueProperty("timeout", ProtectionCCValues.timeout)];
733
+ let _classDescriptor;
734
+ let _classExtraInitializers = [];
735
+ let _classThis;
736
+ let _classSuper = ProtectionCC;
737
+ var ProtectionCCTimeoutReport = class extends _classSuper {
738
+ static { _classThis = this; }
739
+ static {
740
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
741
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
742
+ ProtectionCCTimeoutReport = _classThis = _classDescriptor.value;
743
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
744
+ __runInitializers(_classThis, _classExtraInitializers);
745
+ }
746
+ constructor(options) {
747
+ super(options);
748
+ // TODO: Check implementation:
749
+ this.timeout = options.timeout;
750
+ }
751
+ static from(raw, ctx) {
752
+ validatePayload(raw.payload.length >= 1);
753
+ const timeout = Timeout.parse(raw.payload[0]);
754
+ return new this({
755
+ nodeId: ctx.sourceNodeId,
756
+ timeout,
757
+ });
758
+ }
759
+ timeout;
760
+ toLogEntry(ctx) {
761
+ return {
762
+ ...super.toLogEntry(ctx),
763
+ message: { timeout: this.timeout.toString() },
764
+ };
765
+ }
766
+ };
767
+ return ProtectionCCTimeoutReport = _classThis;
768
+ })();
631
769
  export { ProtectionCCTimeoutReport };
632
- let ProtectionCCTimeoutGet = class ProtectionCCTimeoutGet extends ProtectionCC {
633
- };
634
- ProtectionCCTimeoutGet = __decorate([
635
- CCCommand(ProtectionCommand.TimeoutGet),
636
- expectedCCResponse(ProtectionCCTimeoutReport)
637
- ], ProtectionCCTimeoutGet);
770
+ let ProtectionCCTimeoutGet = (() => {
771
+ let _classDecorators = [CCCommand(ProtectionCommand.TimeoutGet), expectedCCResponse(ProtectionCCTimeoutReport)];
772
+ let _classDescriptor;
773
+ let _classExtraInitializers = [];
774
+ let _classThis;
775
+ let _classSuper = ProtectionCC;
776
+ var ProtectionCCTimeoutGet = class extends _classSuper {
777
+ static { _classThis = this; }
778
+ static {
779
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
780
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
781
+ ProtectionCCTimeoutGet = _classThis = _classDescriptor.value;
782
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
783
+ __runInitializers(_classThis, _classExtraInitializers);
784
+ }
785
+ };
786
+ return ProtectionCCTimeoutGet = _classThis;
787
+ })();
638
788
  export { ProtectionCCTimeoutGet };
639
- let ProtectionCCTimeoutSet = class ProtectionCCTimeoutSet extends ProtectionCC {
640
- constructor(options) {
641
- super(options);
642
- this.timeout = options.timeout;
643
- }
644
- static from(_raw, _ctx) {
645
- // TODO: Deserialize payload
646
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
647
- // return new ProtectionCCTimeoutSet({
648
- // nodeId: ctx.sourceNodeId,
649
- // });
650
- }
651
- timeout;
652
- serialize(ctx) {
653
- this.payload = Bytes.from([this.timeout.serialize()]);
654
- return super.serialize(ctx);
655
- }
656
- toLogEntry(ctx) {
657
- return {
658
- ...super.toLogEntry(ctx),
659
- message: { timeout: this.timeout.toString() },
660
- };
661
- }
662
- };
663
- ProtectionCCTimeoutSet = __decorate([
664
- CCCommand(ProtectionCommand.TimeoutSet),
665
- expectedCCResponse(ProtectionCCReport),
666
- useSupervision()
667
- ], ProtectionCCTimeoutSet);
789
+ let ProtectionCCTimeoutSet = (() => {
790
+ let _classDecorators = [CCCommand(ProtectionCommand.TimeoutSet), expectedCCResponse(ProtectionCCReport), useSupervision()];
791
+ let _classDescriptor;
792
+ let _classExtraInitializers = [];
793
+ let _classThis;
794
+ let _classSuper = ProtectionCC;
795
+ var ProtectionCCTimeoutSet = class extends _classSuper {
796
+ static { _classThis = this; }
797
+ static {
798
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
799
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
800
+ ProtectionCCTimeoutSet = _classThis = _classDescriptor.value;
801
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
802
+ __runInitializers(_classThis, _classExtraInitializers);
803
+ }
804
+ constructor(options) {
805
+ super(options);
806
+ this.timeout = options.timeout;
807
+ }
808
+ static from(_raw, _ctx) {
809
+ // TODO: Deserialize payload
810
+ throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
811
+ // return new ProtectionCCTimeoutSet({
812
+ // nodeId: ctx.sourceNodeId,
813
+ // });
814
+ }
815
+ timeout;
816
+ serialize(ctx) {
817
+ this.payload = Bytes.from([this.timeout.serialize()]);
818
+ return super.serialize(ctx);
819
+ }
820
+ toLogEntry(ctx) {
821
+ return {
822
+ ...super.toLogEntry(ctx),
823
+ message: { timeout: this.timeout.toString() },
824
+ };
825
+ }
826
+ };
827
+ return ProtectionCCTimeoutSet = _classThis;
828
+ })();
668
829
  export { ProtectionCCTimeoutSet };
669
830
  //# sourceMappingURL=ProtectionCC.js.map