@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 BarrierOperatorCCReport_1, BarrierOperatorCCSignalingCapabilitiesReport_1, BarrierOperatorCCEventSignalingReport_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -46,7 +73,7 @@ import { Bytes } from "@zwave-js/shared/safe";
46
73
  import { getEnumMemberName, isEnumMember, noop, pick, } from "@zwave-js/shared/safe";
47
74
  import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from "../lib/API.js";
48
75
  import { CommandClass, } from "../lib/CommandClass.js";
49
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
76
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
50
77
  import { V } from "../lib/Values.js";
51
78
  import { BarrierOperatorCommand, BarrierState, SubsystemState, SubsystemType, } from "../lib/_Types.js";
52
79
  export const BarrierOperatorCCValues = Object.freeze({
@@ -83,528 +110,642 @@ export const BarrierOperatorCCValues = Object.freeze({
83
110
  })),
84
111
  }),
85
112
  });
86
- let BarrierOperatorCCAPI = class BarrierOperatorCCAPI extends CCAPI {
87
- supportsCommand(cmd) {
88
- switch (cmd) {
89
- case BarrierOperatorCommand.Get:
90
- case BarrierOperatorCommand.Set:
91
- case BarrierOperatorCommand.SignalingCapabilitiesGet:
92
- case BarrierOperatorCommand.EventSignalingGet:
93
- case BarrierOperatorCommand.EventSignalingSet:
94
- return true; // This is mandatory
95
- }
96
- return super.supportsCommand(cmd);
97
- }
98
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
99
- async get() {
100
- this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.Get);
101
- const cc = new BarrierOperatorCCGet({
102
- nodeId: this.endpoint.nodeId,
103
- endpointIndex: this.endpoint.index,
104
- });
105
- const response = await this.host.sendCommand(cc, this.commandOptions);
106
- if (response) {
107
- return pick(response, ["currentState", "position"]);
113
+ let BarrierOperatorCCAPI = (() => {
114
+ let _classDecorators = [API(CommandClasses["Barrier Operator"])];
115
+ let _classDescriptor;
116
+ let _classExtraInitializers = [];
117
+ let _classThis;
118
+ let _classSuper = CCAPI;
119
+ var BarrierOperatorCCAPI = class extends _classSuper {
120
+ static { _classThis = this; }
121
+ static {
122
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
123
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
124
+ BarrierOperatorCCAPI = _classThis = _classDescriptor.value;
125
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
126
+ __runInitializers(_classThis, _classExtraInitializers);
108
127
  }
109
- }
110
- async set(targetState) {
111
- __assertType("targetState", undefined, __assertType__su__1__2_eu.bind(void 0, targetState));
112
- this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.Set);
113
- const cc = new BarrierOperatorCCSet({
114
- nodeId: this.endpoint.nodeId,
115
- endpointIndex: this.endpoint.index,
116
- targetState,
117
- });
118
- return this.host.sendCommand(cc, this.commandOptions);
119
- }
120
- async getSignalingCapabilities() {
121
- this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.SignalingCapabilitiesGet);
122
- const cc = new BarrierOperatorCCSignalingCapabilitiesGet({
123
- nodeId: this.endpoint.nodeId,
124
- endpointIndex: this.endpoint.index,
125
- });
126
- const response = await this.host.sendCommand(cc, this.commandOptions);
127
- return response?.supportedSubsystemTypes;
128
- }
129
- async getEventSignaling(subsystemType) {
130
- __assertType("subsystemType", "SubsystemType", __assertType__SubsystemType.bind(void 0, subsystemType));
131
- this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.EventSignalingGet);
132
- const cc = new BarrierOperatorCCEventSignalingGet({
133
- nodeId: this.endpoint.nodeId,
134
- endpointIndex: this.endpoint.index,
135
- subsystemType,
136
- });
137
- const response = await this.host.sendCommand(cc, this.commandOptions);
138
- return response?.subsystemState;
139
- }
140
- async setEventSignaling(subsystemType, subsystemState) {
141
- __assertType("subsystemType", "SubsystemType", __assertType__SubsystemType.bind(void 0, subsystemType));
142
- __assertType("subsystemState", "SubsystemState", __assertType__SubsystemState.bind(void 0, subsystemState));
143
- this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.EventSignalingSet);
144
- const cc = new BarrierOperatorCCEventSignalingSet({
145
- nodeId: this.endpoint.nodeId,
146
- endpointIndex: this.endpoint.index,
147
- subsystemType,
148
- subsystemState,
149
- });
150
- return this.host.sendCommand(cc, this.commandOptions);
151
- }
152
- get [SET_VALUE]() {
153
- return async function ({ property, propertyKey }, value) {
154
- if (property === "targetState") {
155
- if (typeof value !== "number") {
156
- throwWrongValueType(this.ccId, property, "number", typeof value);
157
- }
158
- const targetValue = value === BarrierState.Closed
159
- ? BarrierState.Closed
160
- : BarrierState.Open;
161
- return this.set(targetValue);
128
+ supportsCommand(cmd) {
129
+ switch (cmd) {
130
+ case BarrierOperatorCommand.Get:
131
+ case BarrierOperatorCommand.Set:
132
+ case BarrierOperatorCommand.SignalingCapabilitiesGet:
133
+ case BarrierOperatorCommand.EventSignalingGet:
134
+ case BarrierOperatorCommand.EventSignalingSet:
135
+ return true; // This is mandatory
162
136
  }
163
- else if (property === "signalingState") {
164
- if (propertyKey == undefined) {
165
- throwMissingPropertyKey(this.ccId, property);
166
- }
167
- else if (typeof propertyKey !== "number") {
168
- throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
169
- }
170
- if (typeof value !== "number") {
171
- throwWrongValueType(this.ccId, property, "number", typeof value);
172
- }
173
- return this.setEventSignaling(propertyKey, value);
174
- }
175
- else {
176
- throwUnsupportedProperty(this.ccId, property);
137
+ return super.supportsCommand(cmd);
138
+ }
139
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
140
+ async get() {
141
+ this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.Get);
142
+ const cc = new BarrierOperatorCCGet({
143
+ nodeId: this.endpoint.nodeId,
144
+ endpointIndex: this.endpoint.index,
145
+ });
146
+ const response = await this.host.sendCommand(cc, this.commandOptions);
147
+ if (response) {
148
+ return pick(response, ["currentState", "position"]);
177
149
  }
178
- };
179
- }
180
- [SET_VALUE_HOOKS] = ({ property, propertyKey }, value, _options) => {
181
- const valueId = {
182
- commandClass: this.ccId,
183
- property,
184
- propertyKey,
185
- };
186
- if (BarrierOperatorCCValues.targetState.is(valueId)) {
187
- const currentStateValueId = BarrierOperatorCCValues.currentState
188
- .endpoint(this.endpoint.index);
189
- const targetValue = value === BarrierState.Closed
190
- ? BarrierState.Closed
191
- : BarrierState.Open;
192
- return {
193
- // Barrier Operator commands may take some time to be executed.
194
- // Therefore we try to supervise the command execution and delay the
195
- // optimistic update until the final result is received.
196
- supervisionDelayedUpdates: true,
197
- supervisionOnSuccess: () => {
198
- this.tryGetValueDB()?.setValue(currentStateValueId, targetValue);
199
- },
200
- supervisionOnFailure: async () => {
201
- // The command failed, so now we don't know the status - refresh the current value
202
- try {
203
- await this.get();
204
- }
205
- catch {
206
- // ignore
207
- }
208
- },
209
- optimisticallyUpdateRelatedValues: (supervisedAndSuccessful) => {
210
- // For barriers, do not update the current value unless we actually know the command was successful
211
- if (!supervisedAndSuccessful)
212
- return;
213
- if (this.isSinglecast()) {
214
- this.tryGetValueDB()?.setValue(currentStateValueId, targetValue);
215
- }
216
- else if (this.isMulticast()) {
217
- // Figure out which nodes were affected by this command
218
- const affectedNodes = this.endpoint.node.physicalNodes
219
- .filter((node) => node
220
- .getEndpoint(this.endpoint.index)
221
- ?.supportsCC(this.ccId));
222
- // and optimistically update the currentValue
223
- for (const node of affectedNodes) {
224
- this.host
225
- .tryGetValueDB(node.id)
226
- ?.setValue(currentStateValueId, targetValue);
227
- }
228
- }
229
- },
230
- verifyChanges: () => {
231
- if (this.isSinglecast()) {
232
- // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
233
- this.schedulePoll(currentStateValueId, targetValue);
234
- }
235
- else {
236
- // For multicasts, do not schedule a refresh - this could cause a LOT of traffic
237
- }
238
- },
239
- };
240
150
  }
241
- else if (BarrierOperatorCCValues.signalingState.is(valueId)) {
242
- const subsystemType = propertyKey;
243
- const signalingStateValueId = BarrierOperatorCCValues
244
- .signalingState(subsystemType).endpoint(this.endpoint.index);
245
- return {
246
- verifyChanges: () => {
247
- if (this.isSinglecast()) {
248
- this.schedulePoll(signalingStateValueId, value, {
249
- // Signaling state changes are fast
250
- transition: "fast",
251
- });
252
- }
253
- },
254
- };
151
+ async set(targetState) {
152
+ __assertType("targetState", undefined, __assertType__su__1__2_eu.bind(void 0, targetState));
153
+ this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.Set);
154
+ const cc = new BarrierOperatorCCSet({
155
+ nodeId: this.endpoint.nodeId,
156
+ endpointIndex: this.endpoint.index,
157
+ targetState,
158
+ });
159
+ return this.host.sendCommand(cc, this.commandOptions);
255
160
  }
256
- };
257
- get [POLL_VALUE]() {
258
- return async function ({ property, propertyKey }) {
259
- switch (property) {
260
- case "currentState":
261
- case "position":
262
- return (await this.get())?.[property];
263
- case "signalingState":
161
+ async getSignalingCapabilities() {
162
+ this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.SignalingCapabilitiesGet);
163
+ const cc = new BarrierOperatorCCSignalingCapabilitiesGet({
164
+ nodeId: this.endpoint.nodeId,
165
+ endpointIndex: this.endpoint.index,
166
+ });
167
+ const response = await this.host.sendCommand(cc, this.commandOptions);
168
+ return response?.supportedSubsystemTypes;
169
+ }
170
+ async getEventSignaling(subsystemType) {
171
+ __assertType("subsystemType", "SubsystemType", __assertType__SubsystemType.bind(void 0, subsystemType));
172
+ this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.EventSignalingGet);
173
+ const cc = new BarrierOperatorCCEventSignalingGet({
174
+ nodeId: this.endpoint.nodeId,
175
+ endpointIndex: this.endpoint.index,
176
+ subsystemType,
177
+ });
178
+ const response = await this.host.sendCommand(cc, this.commandOptions);
179
+ return response?.subsystemState;
180
+ }
181
+ async setEventSignaling(subsystemType, subsystemState) {
182
+ __assertType("subsystemType", "SubsystemType", __assertType__SubsystemType.bind(void 0, subsystemType));
183
+ __assertType("subsystemState", "SubsystemState", __assertType__SubsystemState.bind(void 0, subsystemState));
184
+ this.assertSupportsCommand(BarrierOperatorCommand, BarrierOperatorCommand.EventSignalingSet);
185
+ const cc = new BarrierOperatorCCEventSignalingSet({
186
+ nodeId: this.endpoint.nodeId,
187
+ endpointIndex: this.endpoint.index,
188
+ subsystemType,
189
+ subsystemState,
190
+ });
191
+ return this.host.sendCommand(cc, this.commandOptions);
192
+ }
193
+ get [SET_VALUE]() {
194
+ return async function ({ property, propertyKey }, value) {
195
+ if (property === "targetState") {
196
+ if (typeof value !== "number") {
197
+ throwWrongValueType(this.ccId, property, "number", typeof value);
198
+ }
199
+ const targetValue = value === BarrierState.Closed
200
+ ? BarrierState.Closed
201
+ : BarrierState.Open;
202
+ return this.set(targetValue);
203
+ }
204
+ else if (property === "signalingState") {
264
205
  if (propertyKey == undefined) {
265
206
  throwMissingPropertyKey(this.ccId, property);
266
207
  }
267
208
  else if (typeof propertyKey !== "number") {
268
209
  throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
269
210
  }
270
- return this.getEventSignaling(propertyKey);
271
- default:
211
+ if (typeof value !== "number") {
212
+ throwWrongValueType(this.ccId, property, "number", typeof value);
213
+ }
214
+ return this.setEventSignaling(propertyKey, value);
215
+ }
216
+ else {
272
217
  throwUnsupportedProperty(this.ccId, property);
218
+ }
219
+ };
220
+ }
221
+ [SET_VALUE_HOOKS] = ({ property, propertyKey }, value, _options) => {
222
+ const valueId = {
223
+ commandClass: this.ccId,
224
+ property,
225
+ propertyKey,
226
+ };
227
+ if (BarrierOperatorCCValues.targetState.is(valueId)) {
228
+ const currentStateValueId = BarrierOperatorCCValues.currentState
229
+ .endpoint(this.endpoint.index);
230
+ const targetValue = value === BarrierState.Closed
231
+ ? BarrierState.Closed
232
+ : BarrierState.Open;
233
+ return {
234
+ // Barrier Operator commands may take some time to be executed.
235
+ // Therefore we try to supervise the command execution and delay the
236
+ // optimistic update until the final result is received.
237
+ supervisionDelayedUpdates: true,
238
+ supervisionOnSuccess: () => {
239
+ this.tryGetValueDB()?.setValue(currentStateValueId, targetValue);
240
+ },
241
+ supervisionOnFailure: async () => {
242
+ // The command failed, so now we don't know the status - refresh the current value
243
+ try {
244
+ await this.get();
245
+ }
246
+ catch {
247
+ // ignore
248
+ }
249
+ },
250
+ optimisticallyUpdateRelatedValues: (supervisedAndSuccessful) => {
251
+ // For barriers, do not update the current value unless we actually know the command was successful
252
+ if (!supervisedAndSuccessful)
253
+ return;
254
+ if (this.isSinglecast()) {
255
+ this.tryGetValueDB()?.setValue(currentStateValueId, targetValue);
256
+ }
257
+ else if (this.isMulticast()) {
258
+ // Figure out which nodes were affected by this command
259
+ const affectedNodes = this.endpoint.node.physicalNodes
260
+ .filter((node) => node
261
+ .getEndpoint(this.endpoint.index)
262
+ ?.supportsCC(this.ccId));
263
+ // and optimistically update the currentValue
264
+ for (const node of affectedNodes) {
265
+ this.host
266
+ .tryGetValueDB(node.id)
267
+ ?.setValue(currentStateValueId, targetValue);
268
+ }
269
+ }
270
+ },
271
+ verifyChanges: () => {
272
+ if (this.isSinglecast()) {
273
+ // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
274
+ this.schedulePoll(currentStateValueId, targetValue);
275
+ }
276
+ else {
277
+ // For multicasts, do not schedule a refresh - this could cause a LOT of traffic
278
+ }
279
+ },
280
+ };
281
+ }
282
+ else if (BarrierOperatorCCValues.signalingState.is(valueId)) {
283
+ const subsystemType = propertyKey;
284
+ const signalingStateValueId = BarrierOperatorCCValues
285
+ .signalingState(subsystemType).endpoint(this.endpoint.index);
286
+ return {
287
+ verifyChanges: () => {
288
+ if (this.isSinglecast()) {
289
+ this.schedulePoll(signalingStateValueId, value, {
290
+ // Signaling state changes are fast
291
+ transition: "fast",
292
+ });
293
+ }
294
+ },
295
+ };
273
296
  }
274
297
  };
275
- }
276
- };
277
- BarrierOperatorCCAPI = __decorate([
278
- API(CommandClasses["Barrier Operator"])
279
- ], BarrierOperatorCCAPI);
298
+ get [POLL_VALUE]() {
299
+ return async function ({ property, propertyKey }) {
300
+ switch (property) {
301
+ case "currentState":
302
+ case "position":
303
+ return (await this.get())?.[property];
304
+ case "signalingState":
305
+ if (propertyKey == undefined) {
306
+ throwMissingPropertyKey(this.ccId, property);
307
+ }
308
+ else if (typeof propertyKey !== "number") {
309
+ throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
310
+ }
311
+ return this.getEventSignaling(propertyKey);
312
+ default:
313
+ throwUnsupportedProperty(this.ccId, property);
314
+ }
315
+ };
316
+ }
317
+ };
318
+ return BarrierOperatorCCAPI = _classThis;
319
+ })();
280
320
  export { BarrierOperatorCCAPI };
281
- let BarrierOperatorCC = class BarrierOperatorCC extends CommandClass {
282
- async interview(ctx) {
283
- const node = this.getNode(ctx);
284
- const endpoint = this.getEndpoint(ctx);
285
- const api = CCAPI.create(CommandClasses["Barrier Operator"], ctx, endpoint).withOptions({
286
- priority: MessagePriority.NodeQuery,
287
- });
288
- ctx.logNode(node.id, {
289
- endpoint: this.endpointIndex,
290
- message: `Interviewing ${this.ccName}...`,
291
- direction: "none",
292
- });
293
- // Create targetState value if it does not exist
294
- this.ensureMetadata(ctx, BarrierOperatorCCValues.targetState);
295
- ctx.logNode(node.id, {
296
- message: "Querying signaling capabilities...",
297
- direction: "outbound",
298
- });
299
- const resp = await api.getSignalingCapabilities();
300
- if (resp) {
321
+ let BarrierOperatorCC = (() => {
322
+ let _classDecorators = [commandClass(CommandClasses["Barrier Operator"]), implementedVersion(1), ccValues(BarrierOperatorCCValues)];
323
+ let _classDescriptor;
324
+ let _classExtraInitializers = [];
325
+ let _classThis;
326
+ let _classSuper = CommandClass;
327
+ var BarrierOperatorCC = class extends _classSuper {
328
+ static { _classThis = this; }
329
+ static {
330
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
331
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
332
+ BarrierOperatorCC = _classThis = _classDescriptor.value;
333
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
334
+ __runInitializers(_classThis, _classExtraInitializers);
335
+ }
336
+ async interview(ctx) {
337
+ const node = this.getNode(ctx);
338
+ const endpoint = this.getEndpoint(ctx);
339
+ const api = CCAPI.create(CommandClasses["Barrier Operator"], ctx, endpoint).withOptions({
340
+ priority: MessagePriority.NodeQuery,
341
+ });
301
342
  ctx.logNode(node.id, {
302
- message: `Received supported subsystem types: ${resp
303
- .map((t) => `\n· ${getEnumMemberName(SubsystemType, t)}`)
304
- .join("")}`,
305
- direction: "inbound",
343
+ endpoint: this.endpointIndex,
344
+ message: `Interviewing ${this.ccName}...`,
345
+ direction: "none",
346
+ });
347
+ // Create targetState value if it does not exist
348
+ this.ensureMetadata(ctx, BarrierOperatorCCValues.targetState);
349
+ ctx.logNode(node.id, {
350
+ message: "Querying signaling capabilities...",
351
+ direction: "outbound",
306
352
  });
307
- // Enable all supported subsystems
308
- for (const subsystemType of resp) {
353
+ const resp = await api.getSignalingCapabilities();
354
+ if (resp) {
355
+ ctx.logNode(node.id, {
356
+ message: `Received supported subsystem types: ${resp
357
+ .map((t) => `\n· ${getEnumMemberName(SubsystemType, t)}`)
358
+ .join("")}`,
359
+ direction: "inbound",
360
+ });
361
+ // Enable all supported subsystems
362
+ for (const subsystemType of resp) {
363
+ // Some devices report invalid subsystem types, but the CC API checks
364
+ // for valid values and throws otherwise.
365
+ if (!isEnumMember(SubsystemType, subsystemType))
366
+ continue;
367
+ ctx.logNode(node.id, {
368
+ message: `Enabling subsystem ${getEnumMemberName(SubsystemType, subsystemType)}...`,
369
+ direction: "outbound",
370
+ });
371
+ await api.setEventSignaling(subsystemType, SubsystemState.On)
372
+ .catch(noop);
373
+ }
374
+ }
375
+ await this.refreshValues(ctx);
376
+ // Remember that the interview is complete
377
+ this.setInterviewComplete(ctx, true);
378
+ }
379
+ async refreshValues(ctx) {
380
+ const node = this.getNode(ctx);
381
+ const endpoint = this.getEndpoint(ctx);
382
+ const api = CCAPI.create(CommandClasses["Barrier Operator"], ctx, endpoint).withOptions({
383
+ priority: MessagePriority.NodeQuery,
384
+ });
385
+ const supportedSubsystems = this.getValue(ctx, BarrierOperatorCCValues.supportedSubsystemTypes) ?? [];
386
+ for (const subsystemType of supportedSubsystems) {
309
387
  // Some devices report invalid subsystem types, but the CC API checks
310
388
  // for valid values and throws otherwise.
311
389
  if (!isEnumMember(SubsystemType, subsystemType))
312
390
  continue;
313
391
  ctx.logNode(node.id, {
314
- message: `Enabling subsystem ${getEnumMemberName(SubsystemType, subsystemType)}...`,
392
+ message: `Querying event signaling state for subsystem ${getEnumMemberName(SubsystemType, subsystemType)}...`,
315
393
  direction: "outbound",
316
394
  });
317
- await api.setEventSignaling(subsystemType, SubsystemState.On)
318
- .catch(noop);
395
+ const state = await api.getEventSignaling(subsystemType);
396
+ if (state != undefined) {
397
+ ctx.logNode(node.id, {
398
+ message: `Subsystem ${getEnumMemberName(SubsystemType, subsystemType)} has state ${getEnumMemberName(SubsystemState, state)}`,
399
+ direction: "inbound",
400
+ });
401
+ }
319
402
  }
320
- }
321
- await this.refreshValues(ctx);
322
- // Remember that the interview is complete
323
- this.setInterviewComplete(ctx, true);
324
- }
325
- async refreshValues(ctx) {
326
- const node = this.getNode(ctx);
327
- const endpoint = this.getEndpoint(ctx);
328
- const api = CCAPI.create(CommandClasses["Barrier Operator"], ctx, endpoint).withOptions({
329
- priority: MessagePriority.NodeQuery,
330
- });
331
- const supportedSubsystems = this.getValue(ctx, BarrierOperatorCCValues.supportedSubsystemTypes) ?? [];
332
- for (const subsystemType of supportedSubsystems) {
333
- // Some devices report invalid subsystem types, but the CC API checks
334
- // for valid values and throws otherwise.
335
- if (!isEnumMember(SubsystemType, subsystemType))
336
- continue;
337
403
  ctx.logNode(node.id, {
338
- message: `Querying event signaling state for subsystem ${getEnumMemberName(SubsystemType, subsystemType)}...`,
404
+ message: "querying current barrier state...",
339
405
  direction: "outbound",
340
406
  });
341
- const state = await api.getEventSignaling(subsystemType);
342
- if (state != undefined) {
343
- ctx.logNode(node.id, {
344
- message: `Subsystem ${getEnumMemberName(SubsystemType, subsystemType)} has state ${getEnumMemberName(SubsystemState, state)}`,
345
- direction: "inbound",
346
- });
347
- }
407
+ await api.get();
348
408
  }
349
- ctx.logNode(node.id, {
350
- message: "querying current barrier state...",
351
- direction: "outbound",
352
- });
353
- await api.get();
354
- }
355
- };
356
- BarrierOperatorCC = __decorate([
357
- commandClass(CommandClasses["Barrier Operator"]),
358
- implementedVersion(1),
359
- ccValues(BarrierOperatorCCValues)
360
- ], BarrierOperatorCC);
409
+ };
410
+ return BarrierOperatorCC = _classThis;
411
+ })();
361
412
  export { BarrierOperatorCC };
362
- let BarrierOperatorCCSet = class BarrierOperatorCCSet extends BarrierOperatorCC {
363
- constructor(options) {
364
- super(options);
365
- this.targetState = options.targetState;
366
- }
367
- static from(_raw, _ctx) {
368
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
369
- // return new BarrierOperatorCCSet({
370
- // nodeId: ctx.sourceNodeId,
371
- // });
372
- }
373
- targetState;
374
- serialize(ctx) {
375
- this.payload = Bytes.from([this.targetState]);
376
- return super.serialize(ctx);
377
- }
378
- toLogEntry(ctx) {
379
- return {
380
- ...super.toLogEntry(ctx),
381
- message: { "target state": this.targetState },
382
- };
383
- }
384
- };
385
- BarrierOperatorCCSet = __decorate([
386
- CCCommand(BarrierOperatorCommand.Set),
387
- useSupervision()
388
- ], BarrierOperatorCCSet);
413
+ let BarrierOperatorCCSet = (() => {
414
+ let _classDecorators = [CCCommand(BarrierOperatorCommand.Set), useSupervision()];
415
+ let _classDescriptor;
416
+ let _classExtraInitializers = [];
417
+ let _classThis;
418
+ let _classSuper = BarrierOperatorCC;
419
+ var BarrierOperatorCCSet = class extends _classSuper {
420
+ static { _classThis = this; }
421
+ static {
422
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
423
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
424
+ BarrierOperatorCCSet = _classThis = _classDescriptor.value;
425
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
426
+ __runInitializers(_classThis, _classExtraInitializers);
427
+ }
428
+ constructor(options) {
429
+ super(options);
430
+ this.targetState = options.targetState;
431
+ }
432
+ static from(_raw, _ctx) {
433
+ throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
434
+ // return new BarrierOperatorCCSet({
435
+ // nodeId: ctx.sourceNodeId,
436
+ // });
437
+ }
438
+ targetState;
439
+ serialize(ctx) {
440
+ this.payload = Bytes.from([this.targetState]);
441
+ return super.serialize(ctx);
442
+ }
443
+ toLogEntry(ctx) {
444
+ return {
445
+ ...super.toLogEntry(ctx),
446
+ message: { "target state": this.targetState },
447
+ };
448
+ }
449
+ };
450
+ return BarrierOperatorCCSet = _classThis;
451
+ })();
389
452
  export { BarrierOperatorCCSet };
390
- let BarrierOperatorCCReport = BarrierOperatorCCReport_1 = class BarrierOperatorCCReport extends BarrierOperatorCC {
391
- constructor(options) {
392
- super(options);
393
- // TODO: Check implementation:
394
- this.position = options.position;
395
- this.currentState = options.currentState;
396
- }
397
- static from(raw, ctx) {
398
- validatePayload(raw.payload.length >= 1);
399
- // The payload byte encodes information about the state and position in a single value
400
- const payloadValue = raw.payload[0];
401
- let position;
402
- if (payloadValue <= 99) {
403
- // known position
404
- position = payloadValue;
405
- }
406
- else if (payloadValue === 255) {
407
- // known position, fully opened
408
- position = 100;
409
- }
410
- else {
411
- // unknown position
412
- position = UNKNOWN_STATE;
413
- }
414
- let currentState;
415
- if (payloadValue === BarrierState.Closed
416
- || payloadValue >= BarrierState.Closing) {
417
- // predefined states
418
- currentState = payloadValue;
419
- }
420
- else if (payloadValue > 0 && payloadValue <= 99) {
421
- // stopped at exact position
422
- currentState = BarrierState.Stopped;
423
- }
424
- else {
425
- // invalid value, assume unknown
426
- currentState = UNKNOWN_STATE;
427
- }
428
- return new BarrierOperatorCCReport_1({
429
- nodeId: ctx.sourceNodeId,
430
- position,
431
- currentState,
432
- });
433
- }
434
- currentState;
435
- position;
436
- toLogEntry(ctx) {
437
- return {
438
- ...super.toLogEntry(ctx),
439
- message: {
440
- "barrier position": maybeUnknownToString(this.position),
441
- "barrier state": this.currentState != undefined
442
- ? getEnumMemberName(BarrierState, this.currentState)
443
- : "unknown",
444
- },
445
- };
446
- }
447
- };
448
- __decorate([
449
- ccValue(BarrierOperatorCCValues.currentState)
450
- ], BarrierOperatorCCReport.prototype, "currentState", void 0);
451
- __decorate([
452
- ccValue(BarrierOperatorCCValues.position)
453
- ], BarrierOperatorCCReport.prototype, "position", void 0);
454
- BarrierOperatorCCReport = BarrierOperatorCCReport_1 = __decorate([
455
- CCCommand(BarrierOperatorCommand.Report)
456
- ], BarrierOperatorCCReport);
453
+ let BarrierOperatorCCReport = (() => {
454
+ let _classDecorators = [CCCommand(BarrierOperatorCommand.Report), ccValueProperty("currentState", BarrierOperatorCCValues.currentState), ccValueProperty("position", BarrierOperatorCCValues.position)];
455
+ let _classDescriptor;
456
+ let _classExtraInitializers = [];
457
+ let _classThis;
458
+ let _classSuper = BarrierOperatorCC;
459
+ var BarrierOperatorCCReport = class extends _classSuper {
460
+ static { _classThis = this; }
461
+ static {
462
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
463
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
464
+ BarrierOperatorCCReport = _classThis = _classDescriptor.value;
465
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
466
+ __runInitializers(_classThis, _classExtraInitializers);
467
+ }
468
+ constructor(options) {
469
+ super(options);
470
+ // TODO: Check implementation:
471
+ this.position = options.position;
472
+ this.currentState = options.currentState;
473
+ }
474
+ static from(raw, ctx) {
475
+ validatePayload(raw.payload.length >= 1);
476
+ // The payload byte encodes information about the state and position in a single value
477
+ const payloadValue = raw.payload[0];
478
+ let position;
479
+ if (payloadValue <= 99) {
480
+ // known position
481
+ position = payloadValue;
482
+ }
483
+ else if (payloadValue === 255) {
484
+ // known position, fully opened
485
+ position = 100;
486
+ }
487
+ else {
488
+ // unknown position
489
+ position = UNKNOWN_STATE;
490
+ }
491
+ let currentState;
492
+ if (payloadValue === BarrierState.Closed
493
+ || payloadValue >= BarrierState.Closing) {
494
+ // predefined states
495
+ currentState = payloadValue;
496
+ }
497
+ else if (payloadValue > 0 && payloadValue <= 99) {
498
+ // stopped at exact position
499
+ currentState = BarrierState.Stopped;
500
+ }
501
+ else {
502
+ // invalid value, assume unknown
503
+ currentState = UNKNOWN_STATE;
504
+ }
505
+ return new this({
506
+ nodeId: ctx.sourceNodeId,
507
+ position,
508
+ currentState,
509
+ });
510
+ }
511
+ currentState;
512
+ position;
513
+ toLogEntry(ctx) {
514
+ return {
515
+ ...super.toLogEntry(ctx),
516
+ message: {
517
+ "barrier position": maybeUnknownToString(this.position),
518
+ "barrier state": this.currentState != undefined
519
+ ? getEnumMemberName(BarrierState, this.currentState)
520
+ : "unknown",
521
+ },
522
+ };
523
+ }
524
+ };
525
+ return BarrierOperatorCCReport = _classThis;
526
+ })();
457
527
  export { BarrierOperatorCCReport };
458
- let BarrierOperatorCCGet = class BarrierOperatorCCGet extends BarrierOperatorCC {
459
- };
460
- BarrierOperatorCCGet = __decorate([
461
- CCCommand(BarrierOperatorCommand.Get),
462
- expectedCCResponse(BarrierOperatorCCReport)
463
- ], BarrierOperatorCCGet);
528
+ let BarrierOperatorCCGet = (() => {
529
+ let _classDecorators = [CCCommand(BarrierOperatorCommand.Get), expectedCCResponse(BarrierOperatorCCReport)];
530
+ let _classDescriptor;
531
+ let _classExtraInitializers = [];
532
+ let _classThis;
533
+ let _classSuper = BarrierOperatorCC;
534
+ var BarrierOperatorCCGet = class extends _classSuper {
535
+ static { _classThis = this; }
536
+ static {
537
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
538
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
539
+ BarrierOperatorCCGet = _classThis = _classDescriptor.value;
540
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
541
+ __runInitializers(_classThis, _classExtraInitializers);
542
+ }
543
+ };
544
+ return BarrierOperatorCCGet = _classThis;
545
+ })();
464
546
  export { BarrierOperatorCCGet };
465
- let BarrierOperatorCCSignalingCapabilitiesReport = BarrierOperatorCCSignalingCapabilitiesReport_1 = class BarrierOperatorCCSignalingCapabilitiesReport extends BarrierOperatorCC {
466
- constructor(options) {
467
- super(options);
468
- // TODO: Check implementation:
469
- this.supportedSubsystemTypes = options.supportedSubsystemTypes;
470
- }
471
- static from(raw, ctx) {
472
- const supportedSubsystemTypes = parseBitMask(raw.payload, SubsystemType.Audible);
473
- return new BarrierOperatorCCSignalingCapabilitiesReport_1({
474
- nodeId: ctx.sourceNodeId,
475
- supportedSubsystemTypes,
476
- });
477
- }
478
- supportedSubsystemTypes;
479
- toLogEntry(ctx) {
480
- return {
481
- ...super.toLogEntry(ctx),
482
- message: {
483
- "supported types": this.supportedSubsystemTypes
484
- .map((t) => `\n· ${getEnumMemberName(SubsystemType, t)}`)
485
- .join(""),
486
- },
487
- };
488
- }
489
- };
490
- __decorate([
491
- ccValue(BarrierOperatorCCValues.supportedSubsystemTypes)
492
- ], BarrierOperatorCCSignalingCapabilitiesReport.prototype, "supportedSubsystemTypes", void 0);
493
- BarrierOperatorCCSignalingCapabilitiesReport = BarrierOperatorCCSignalingCapabilitiesReport_1 = __decorate([
494
- CCCommand(BarrierOperatorCommand.SignalingCapabilitiesReport)
495
- ], BarrierOperatorCCSignalingCapabilitiesReport);
547
+ let BarrierOperatorCCSignalingCapabilitiesReport = (() => {
548
+ let _classDecorators = [CCCommand(BarrierOperatorCommand.SignalingCapabilitiesReport), ccValueProperty("supportedSubsystemTypes", BarrierOperatorCCValues.supportedSubsystemTypes)];
549
+ let _classDescriptor;
550
+ let _classExtraInitializers = [];
551
+ let _classThis;
552
+ let _classSuper = BarrierOperatorCC;
553
+ var BarrierOperatorCCSignalingCapabilitiesReport = class extends _classSuper {
554
+ static { _classThis = this; }
555
+ static {
556
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
557
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
558
+ BarrierOperatorCCSignalingCapabilitiesReport = _classThis = _classDescriptor.value;
559
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
560
+ __runInitializers(_classThis, _classExtraInitializers);
561
+ }
562
+ constructor(options) {
563
+ super(options);
564
+ // TODO: Check implementation:
565
+ this.supportedSubsystemTypes = options.supportedSubsystemTypes;
566
+ }
567
+ static from(raw, ctx) {
568
+ const supportedSubsystemTypes = parseBitMask(raw.payload, SubsystemType.Audible);
569
+ return new this({
570
+ nodeId: ctx.sourceNodeId,
571
+ supportedSubsystemTypes,
572
+ });
573
+ }
574
+ supportedSubsystemTypes;
575
+ toLogEntry(ctx) {
576
+ return {
577
+ ...super.toLogEntry(ctx),
578
+ message: {
579
+ "supported types": this.supportedSubsystemTypes
580
+ .map((t) => `\n· ${getEnumMemberName(SubsystemType, t)}`)
581
+ .join(""),
582
+ },
583
+ };
584
+ }
585
+ };
586
+ return BarrierOperatorCCSignalingCapabilitiesReport = _classThis;
587
+ })();
496
588
  export { BarrierOperatorCCSignalingCapabilitiesReport };
497
- let BarrierOperatorCCSignalingCapabilitiesGet = class BarrierOperatorCCSignalingCapabilitiesGet extends BarrierOperatorCC {
498
- };
499
- BarrierOperatorCCSignalingCapabilitiesGet = __decorate([
500
- CCCommand(BarrierOperatorCommand.SignalingCapabilitiesGet),
501
- expectedCCResponse(BarrierOperatorCCSignalingCapabilitiesReport)
502
- ], BarrierOperatorCCSignalingCapabilitiesGet);
589
+ let BarrierOperatorCCSignalingCapabilitiesGet = (() => {
590
+ let _classDecorators = [CCCommand(BarrierOperatorCommand.SignalingCapabilitiesGet), expectedCCResponse(BarrierOperatorCCSignalingCapabilitiesReport)];
591
+ let _classDescriptor;
592
+ let _classExtraInitializers = [];
593
+ let _classThis;
594
+ let _classSuper = BarrierOperatorCC;
595
+ var BarrierOperatorCCSignalingCapabilitiesGet = class extends _classSuper {
596
+ static { _classThis = this; }
597
+ static {
598
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
599
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
600
+ BarrierOperatorCCSignalingCapabilitiesGet = _classThis = _classDescriptor.value;
601
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
602
+ __runInitializers(_classThis, _classExtraInitializers);
603
+ }
604
+ };
605
+ return BarrierOperatorCCSignalingCapabilitiesGet = _classThis;
606
+ })();
503
607
  export { BarrierOperatorCCSignalingCapabilitiesGet };
504
- let BarrierOperatorCCEventSignalingSet = class BarrierOperatorCCEventSignalingSet extends BarrierOperatorCC {
505
- constructor(options) {
506
- super(options);
507
- this.subsystemType = options.subsystemType;
508
- this.subsystemState = options.subsystemState;
509
- }
510
- static from(_raw, _ctx) {
511
- // TODO: Deserialize payload
512
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
513
- // return new BarrierOperatorCCEventSignalingSet({
514
- // nodeId: ctx.sourceNodeId,
515
- // });
516
- }
517
- subsystemType;
518
- subsystemState;
519
- serialize(ctx) {
520
- this.payload = Bytes.from([this.subsystemType, this.subsystemState]);
521
- return super.serialize(ctx);
522
- }
523
- toLogEntry(ctx) {
524
- return {
525
- ...super.toLogEntry(ctx),
526
- message: {
527
- "subsystem type": getEnumMemberName(SubsystemType, this.subsystemType),
528
- "subsystem state": getEnumMemberName(SubsystemState, this.subsystemState),
529
- },
530
- };
531
- }
532
- };
533
- BarrierOperatorCCEventSignalingSet = __decorate([
534
- CCCommand(BarrierOperatorCommand.EventSignalingSet),
535
- useSupervision()
536
- ], BarrierOperatorCCEventSignalingSet);
608
+ let BarrierOperatorCCEventSignalingSet = (() => {
609
+ let _classDecorators = [CCCommand(BarrierOperatorCommand.EventSignalingSet), useSupervision()];
610
+ let _classDescriptor;
611
+ let _classExtraInitializers = [];
612
+ let _classThis;
613
+ let _classSuper = BarrierOperatorCC;
614
+ var BarrierOperatorCCEventSignalingSet = class extends _classSuper {
615
+ static { _classThis = this; }
616
+ static {
617
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
618
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
619
+ BarrierOperatorCCEventSignalingSet = _classThis = _classDescriptor.value;
620
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
621
+ __runInitializers(_classThis, _classExtraInitializers);
622
+ }
623
+ constructor(options) {
624
+ super(options);
625
+ this.subsystemType = options.subsystemType;
626
+ this.subsystemState = options.subsystemState;
627
+ }
628
+ static from(_raw, _ctx) {
629
+ // TODO: Deserialize payload
630
+ throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
631
+ // return new BarrierOperatorCCEventSignalingSet({
632
+ // nodeId: ctx.sourceNodeId,
633
+ // });
634
+ }
635
+ subsystemType;
636
+ subsystemState;
637
+ serialize(ctx) {
638
+ this.payload = Bytes.from([this.subsystemType, this.subsystemState]);
639
+ return super.serialize(ctx);
640
+ }
641
+ toLogEntry(ctx) {
642
+ return {
643
+ ...super.toLogEntry(ctx),
644
+ message: {
645
+ "subsystem type": getEnumMemberName(SubsystemType, this.subsystemType),
646
+ "subsystem state": getEnumMemberName(SubsystemState, this.subsystemState),
647
+ },
648
+ };
649
+ }
650
+ };
651
+ return BarrierOperatorCCEventSignalingSet = _classThis;
652
+ })();
537
653
  export { BarrierOperatorCCEventSignalingSet };
538
- let BarrierOperatorCCEventSignalingReport = BarrierOperatorCCEventSignalingReport_1 = class BarrierOperatorCCEventSignalingReport extends BarrierOperatorCC {
539
- constructor(options) {
540
- super(options);
541
- // TODO: Check implementation:
542
- this.subsystemType = options.subsystemType;
543
- this.subsystemState = options.subsystemState;
544
- }
545
- static from(raw, ctx) {
546
- validatePayload(raw.payload.length >= 2);
547
- const subsystemType = raw.payload[0];
548
- const subsystemState = raw.payload[1];
549
- return new BarrierOperatorCCEventSignalingReport_1({
550
- nodeId: ctx.sourceNodeId,
551
- subsystemType,
552
- subsystemState,
553
- });
554
- }
555
- persistValues(ctx) {
556
- if (!super.persistValues(ctx))
557
- return false;
558
- const signalingStateValue = BarrierOperatorCCValues.signalingState(this.subsystemType);
559
- this.ensureMetadata(ctx, signalingStateValue);
560
- this.setValue(ctx, signalingStateValue, this.subsystemState);
561
- return true;
562
- }
563
- subsystemType;
564
- subsystemState;
565
- toLogEntry(ctx) {
566
- return {
567
- ...super.toLogEntry(ctx),
568
- message: {
569
- "subsystem type": getEnumMemberName(SubsystemType, this.subsystemType),
570
- "subsystem state": getEnumMemberName(SubsystemState, this.subsystemState),
571
- },
572
- };
573
- }
574
- };
575
- BarrierOperatorCCEventSignalingReport = BarrierOperatorCCEventSignalingReport_1 = __decorate([
576
- CCCommand(BarrierOperatorCommand.EventSignalingReport)
577
- ], BarrierOperatorCCEventSignalingReport);
654
+ let BarrierOperatorCCEventSignalingReport = (() => {
655
+ let _classDecorators = [CCCommand(BarrierOperatorCommand.EventSignalingReport)];
656
+ let _classDescriptor;
657
+ let _classExtraInitializers = [];
658
+ let _classThis;
659
+ let _classSuper = BarrierOperatorCC;
660
+ var BarrierOperatorCCEventSignalingReport = class extends _classSuper {
661
+ static { _classThis = this; }
662
+ static {
663
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
664
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
665
+ BarrierOperatorCCEventSignalingReport = _classThis = _classDescriptor.value;
666
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
667
+ __runInitializers(_classThis, _classExtraInitializers);
668
+ }
669
+ constructor(options) {
670
+ super(options);
671
+ // TODO: Check implementation:
672
+ this.subsystemType = options.subsystemType;
673
+ this.subsystemState = options.subsystemState;
674
+ }
675
+ static from(raw, ctx) {
676
+ validatePayload(raw.payload.length >= 2);
677
+ const subsystemType = raw.payload[0];
678
+ const subsystemState = raw.payload[1];
679
+ return new this({
680
+ nodeId: ctx.sourceNodeId,
681
+ subsystemType,
682
+ subsystemState,
683
+ });
684
+ }
685
+ persistValues(ctx) {
686
+ if (!super.persistValues(ctx))
687
+ return false;
688
+ const signalingStateValue = BarrierOperatorCCValues.signalingState(this.subsystemType);
689
+ this.ensureMetadata(ctx, signalingStateValue);
690
+ this.setValue(ctx, signalingStateValue, this.subsystemState);
691
+ return true;
692
+ }
693
+ subsystemType;
694
+ subsystemState;
695
+ toLogEntry(ctx) {
696
+ return {
697
+ ...super.toLogEntry(ctx),
698
+ message: {
699
+ "subsystem type": getEnumMemberName(SubsystemType, this.subsystemType),
700
+ "subsystem state": getEnumMemberName(SubsystemState, this.subsystemState),
701
+ },
702
+ };
703
+ }
704
+ };
705
+ return BarrierOperatorCCEventSignalingReport = _classThis;
706
+ })();
578
707
  export { BarrierOperatorCCEventSignalingReport };
579
- let BarrierOperatorCCEventSignalingGet = class BarrierOperatorCCEventSignalingGet extends BarrierOperatorCC {
580
- constructor(options) {
581
- super(options);
582
- this.subsystemType = options.subsystemType;
583
- }
584
- static from(_raw, _ctx) {
585
- // TODO: Deserialize payload
586
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
587
- // return new BarrierOperatorCCEventSignalingGet({
588
- // nodeId: ctx.sourceNodeId,
589
- // });
590
- }
591
- subsystemType;
592
- serialize(ctx) {
593
- this.payload = Bytes.from([this.subsystemType]);
594
- return super.serialize(ctx);
595
- }
596
- toLogEntry(ctx) {
597
- return {
598
- ...super.toLogEntry(ctx),
599
- message: {
600
- "subsystem type": getEnumMemberName(SubsystemType, this.subsystemType),
601
- },
602
- };
603
- }
604
- };
605
- BarrierOperatorCCEventSignalingGet = __decorate([
606
- CCCommand(BarrierOperatorCommand.EventSignalingGet),
607
- expectedCCResponse(BarrierOperatorCCEventSignalingReport)
608
- ], BarrierOperatorCCEventSignalingGet);
708
+ let BarrierOperatorCCEventSignalingGet = (() => {
709
+ let _classDecorators = [CCCommand(BarrierOperatorCommand.EventSignalingGet), expectedCCResponse(BarrierOperatorCCEventSignalingReport)];
710
+ let _classDescriptor;
711
+ let _classExtraInitializers = [];
712
+ let _classThis;
713
+ let _classSuper = BarrierOperatorCC;
714
+ var BarrierOperatorCCEventSignalingGet = class extends _classSuper {
715
+ static { _classThis = this; }
716
+ static {
717
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
718
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
719
+ BarrierOperatorCCEventSignalingGet = _classThis = _classDescriptor.value;
720
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
721
+ __runInitializers(_classThis, _classExtraInitializers);
722
+ }
723
+ constructor(options) {
724
+ super(options);
725
+ this.subsystemType = options.subsystemType;
726
+ }
727
+ static from(_raw, _ctx) {
728
+ // TODO: Deserialize payload
729
+ throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
730
+ // return new BarrierOperatorCCEventSignalingGet({
731
+ // nodeId: ctx.sourceNodeId,
732
+ // });
733
+ }
734
+ subsystemType;
735
+ serialize(ctx) {
736
+ this.payload = Bytes.from([this.subsystemType]);
737
+ return super.serialize(ctx);
738
+ }
739
+ toLogEntry(ctx) {
740
+ return {
741
+ ...super.toLogEntry(ctx),
742
+ message: {
743
+ "subsystem type": getEnumMemberName(SubsystemType, this.subsystemType),
744
+ },
745
+ };
746
+ }
747
+ };
748
+ return BarrierOperatorCCEventSignalingGet = _classThis;
749
+ })();
609
750
  export { BarrierOperatorCCEventSignalingGet };
610
751
  //# sourceMappingURL=BarrierOperatorCC.js.map