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