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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +381 -266
  2. package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
  3. package/build/cjs/cc/AssociationCC.js +669 -503
  4. package/build/cjs/cc/AssociationCC.js.map +3 -3
  5. package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
  6. package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
  7. package/build/cjs/cc/BarrierOperatorCC.js +595 -429
  8. package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
  9. package/build/cjs/cc/BasicCC.js +354 -260
  10. package/build/cjs/cc/BasicCC.js.map +3 -3
  11. package/build/cjs/cc/BatteryCC.js +427 -345
  12. package/build/cjs/cc/BatteryCC.js.map +3 -3
  13. package/build/cjs/cc/BinarySensorCC.js +391 -276
  14. package/build/cjs/cc/BinarySensorCC.js.map +3 -3
  15. package/build/cjs/cc/BinarySwitchCC.js +347 -253
  16. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  17. package/build/cjs/cc/CRC16CC.js +160 -85
  18. package/build/cjs/cc/CRC16CC.js.map +3 -3
  19. package/build/cjs/cc/CentralSceneCC.js +459 -324
  20. package/build/cjs/cc/CentralSceneCC.js.map +3 -3
  21. package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
  23. package/build/cjs/cc/ClockCC.js +254 -150
  24. package/build/cjs/cc/ClockCC.js.map +3 -3
  25. package/build/cjs/cc/ColorSwitchCC.js +758 -610
  26. package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
  27. package/build/cjs/cc/ConfigurationCC.js +1700 -1453
  28. package/build/cjs/cc/ConfigurationCC.js.map +3 -3
  29. package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
  30. package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
  31. package/build/cjs/cc/DoorLockCC.js +904 -777
  32. package/build/cjs/cc/DoorLockCC.js.map +3 -3
  33. package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
  34. package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
  35. package/build/cjs/cc/EnergyProductionCC.js +249 -160
  36. package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
  37. package/build/cjs/cc/EntryControlCC.js +619 -458
  38. package/build/cjs/cc/EntryControlCC.js.map +3 -3
  39. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
  40. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
  41. package/build/cjs/cc/HailCC.js +57 -11
  42. package/build/cjs/cc/HailCC.js.map +2 -2
  43. package/build/cjs/cc/HumidityControlModeCC.js +359 -233
  44. package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
  45. package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
  46. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
  47. package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
  48. package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
  49. package/build/cjs/cc/InclusionControllerCC.js +205 -114
  50. package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
  51. package/build/cjs/cc/IndicatorCC.js +897 -736
  52. package/build/cjs/cc/IndicatorCC.js.map +3 -3
  53. package/build/cjs/cc/IrrigationCC.js +1651 -1405
  54. package/build/cjs/cc/IrrigationCC.js.map +3 -3
  55. package/build/cjs/cc/LanguageCC.js +268 -171
  56. package/build/cjs/cc/LanguageCC.js.map +3 -3
  57. package/build/cjs/cc/LockCC.js +254 -154
  58. package/build/cjs/cc/LockCC.js.map +3 -3
  59. package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
  60. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  61. package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
  62. package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
  63. package/build/cjs/cc/MeterCC.js +827 -707
  64. package/build/cjs/cc/MeterCC.js.map +3 -3
  65. package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
  66. package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
  67. package/build/cjs/cc/MultiChannelCC.js +1037 -819
  68. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  69. package/build/cjs/cc/MultiCommandCC.js +172 -97
  70. package/build/cjs/cc/MultiCommandCC.js.map +3 -3
  71. package/build/cjs/cc/MultilevelSensorCC.js +589 -449
  72. package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
  73. package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
  74. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  75. package/build/cjs/cc/NoOperationCC.js +89 -27
  76. package/build/cjs/cc/NoOperationCC.js.map +2 -2
  77. package/build/cjs/cc/NodeNamingCC.js +417 -277
  78. package/build/cjs/cc/NodeNamingCC.js.map +3 -3
  79. package/build/cjs/cc/NotificationCC.js +972 -818
  80. package/build/cjs/cc/NotificationCC.js.map +3 -3
  81. package/build/cjs/cc/PowerlevelCC.js +450 -303
  82. package/build/cjs/cc/PowerlevelCC.js.map +3 -3
  83. package/build/cjs/cc/ProtectionCC.js +686 -494
  84. package/build/cjs/cc/ProtectionCC.js.map +3 -3
  85. package/build/cjs/cc/SceneActivationCC.js +165 -97
  86. package/build/cjs/cc/SceneActivationCC.js.map +3 -3
  87. package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
  88. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
  89. package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
  90. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
  91. package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
  92. package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
  93. package/build/cjs/cc/Security2CC.js +1483 -1219
  94. package/build/cjs/cc/Security2CC.js.map +3 -3
  95. package/build/cjs/cc/SecurityCC.js +839 -619
  96. package/build/cjs/cc/SecurityCC.js.map +3 -3
  97. package/build/cjs/cc/SoundSwitchCC.js +707 -515
  98. package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
  99. package/build/cjs/cc/SupervisionCC.js +327 -237
  100. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  101. package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
  102. package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
  103. package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
  104. package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
  105. package/build/cjs/cc/ThermostatModeCC.js +425 -302
  106. package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
  107. package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
  108. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
  109. package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
  110. package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
  111. package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
  112. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  113. package/build/cjs/cc/TimeCC.js +515 -353
  114. package/build/cjs/cc/TimeCC.js.map +3 -3
  115. package/build/cjs/cc/TimeParametersCC.js +302 -202
  116. package/build/cjs/cc/TimeParametersCC.js.map +3 -3
  117. package/build/cjs/cc/TransportServiceCC.js +433 -315
  118. package/build/cjs/cc/TransportServiceCC.js.map +3 -3
  119. package/build/cjs/cc/UserCodeCC.js +1385 -1102
  120. package/build/cjs/cc/UserCodeCC.js.map +3 -3
  121. package/build/cjs/cc/VersionCC.js +696 -562
  122. package/build/cjs/cc/VersionCC.js.map +3 -3
  123. package/build/cjs/cc/WakeUpCC.js +499 -346
  124. package/build/cjs/cc/WakeUpCC.js.map +3 -3
  125. package/build/cjs/cc/WindowCoveringCC.js +626 -478
  126. package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
  127. package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
  128. package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
  129. package/build/cjs/cc/ZWavePlusCC.js +233 -159
  130. package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
  131. package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
  132. package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
  133. package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  134. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
  135. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
  136. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
  137. package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
  138. package/build/cjs/lib/CommandClassDecorators.js +19 -20
  139. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  140. package/build/cjs/lib/Security2/Extension.d.ts +1 -1
  141. package/build/cjs/lib/Security2/Extension.js +217 -126
  142. package/build/cjs/lib/Security2/Extension.js.map +3 -3
  143. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  144. package/build/esm/cc/AlarmSensorCC.js +389 -291
  145. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  146. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  147. package/build/esm/cc/AssociationCC.js +678 -537
  148. package/build/esm/cc/AssociationCC.js.map +1 -1
  149. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  150. package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
  151. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  152. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  153. package/build/esm/cc/BarrierOperatorCC.js +634 -493
  154. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  155. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  156. package/build/esm/cc/BasicCC.js +380 -302
  157. package/build/esm/cc/BasicCC.js.map +1 -1
  158. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  159. package/build/esm/cc/BatteryCC.js +449 -384
  160. package/build/esm/cc/BatteryCC.js.map +1 -1
  161. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  162. package/build/esm/cc/BinarySensorCC.js +395 -297
  163. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  164. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  165. package/build/esm/cc/BinarySwitchCC.js +353 -274
  166. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  167. package/build/esm/cc/CRC16CC.js +162 -98
  168. package/build/esm/cc/CRC16CC.js.map +1 -1
  169. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  170. package/build/esm/cc/CentralSceneCC.js +465 -351
  171. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  172. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  173. package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
  174. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  175. package/build/esm/cc/ClockCC.js +248 -159
  176. package/build/esm/cc/ClockCC.js.map +1 -1
  177. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  178. package/build/esm/cc/ColorSwitchCC.js +802 -677
  179. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  180. package/build/esm/cc/ConfigurationCC.js +1899 -1687
  181. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  182. package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
  183. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  184. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  185. package/build/esm/cc/DoorLockCC.js +951 -849
  186. package/build/esm/cc/DoorLockCC.js.map +1 -1
  187. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  188. package/build/esm/cc/DoorLockLoggingCC.js +316 -218
  189. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  190. package/build/esm/cc/EnergyProductionCC.js +240 -164
  191. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  192. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  193. package/build/esm/cc/EntryControlCC.js +629 -493
  194. package/build/esm/cc/EntryControlCC.js.map +1 -1
  195. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  196. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
  197. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  198. package/build/esm/cc/HailCC.js +51 -12
  199. package/build/esm/cc/HailCC.js.map +1 -1
  200. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  201. package/build/esm/cc/HumidityControlModeCC.js +357 -250
  202. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  203. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  204. package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
  205. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  206. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  207. package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
  208. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  209. package/build/esm/cc/InclusionControllerCC.js +197 -119
  210. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  211. package/build/esm/cc/IndicatorCC.js +973 -835
  212. package/build/esm/cc/IndicatorCC.js.map +1 -1
  213. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  214. package/build/esm/cc/IrrigationCC.js +1697 -1496
  215. package/build/esm/cc/IrrigationCC.js.map +1 -1
  216. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  217. package/build/esm/cc/LanguageCC.js +266 -184
  218. package/build/esm/cc/LanguageCC.js.map +1 -1
  219. package/build/esm/cc/LockCC.d.ts.map +1 -1
  220. package/build/esm/cc/LockCC.js +247 -162
  221. package/build/esm/cc/LockCC.js.map +1 -1
  222. package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
  223. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  224. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  225. package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
  226. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  227. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  228. package/build/esm/cc/MeterCC.js +896 -795
  229. package/build/esm/cc/MeterCC.js.map +1 -1
  230. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  231. package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
  232. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  233. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  234. package/build/esm/cc/MultiChannelCC.js +1106 -921
  235. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  236. package/build/esm/cc/MultiCommandCC.js +166 -102
  237. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  238. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  239. package/build/esm/cc/MultilevelSensorCC.js +616 -497
  240. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  241. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  242. package/build/esm/cc/MultilevelSwitchCC.js +621 -496
  243. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  244. package/build/esm/cc/NoOperationCC.js +82 -29
  245. package/build/esm/cc/NoOperationCC.js.map +1 -1
  246. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  247. package/build/esm/cc/NodeNamingCC.js +413 -294
  248. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  249. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  250. package/build/esm/cc/NotificationCC.js +1097 -966
  251. package/build/esm/cc/NotificationCC.js.map +1 -1
  252. package/build/esm/cc/PowerlevelCC.js +437 -311
  253. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  254. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  255. package/build/esm/cc/ProtectionCC.js +704 -543
  256. package/build/esm/cc/ProtectionCC.js.map +1 -1
  257. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  258. package/build/esm/cc/SceneActivationCC.js +157 -100
  259. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  260. package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
  261. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  262. package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
  263. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  264. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  265. package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
  266. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  267. package/build/esm/cc/Security2CC.js +1633 -1406
  268. package/build/esm/cc/Security2CC.js.map +1 -1
  269. package/build/esm/cc/SecurityCC.js +876 -687
  270. package/build/esm/cc/SecurityCC.js.map +1 -1
  271. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  272. package/build/esm/cc/SoundSwitchCC.js +689 -526
  273. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  274. package/build/esm/cc/SupervisionCC.js +349 -272
  275. package/build/esm/cc/SupervisionCC.js.map +1 -1
  276. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  277. package/build/esm/cc/ThermostatFanModeCC.js +388 -284
  278. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  279. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  280. package/build/esm/cc/ThermostatFanStateCC.js +184 -111
  281. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  282. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  283. package/build/esm/cc/ThermostatModeCC.js +435 -331
  284. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  285. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  286. package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
  287. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  288. package/build/esm/cc/ThermostatSetbackCC.js +274 -185
  289. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  290. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  291. package/build/esm/cc/ThermostatSetpointCC.js +674 -543
  292. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  293. package/build/esm/cc/TimeCC.js +499 -360
  294. package/build/esm/cc/TimeCC.js.map +1 -1
  295. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  296. package/build/esm/cc/TimeParametersCC.js +296 -211
  297. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  298. package/build/esm/cc/TransportServiceCC.js +464 -363
  299. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  300. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  301. package/build/esm/cc/UserCodeCC.js +1443 -1205
  302. package/build/esm/cc/UserCodeCC.js.map +1 -1
  303. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  304. package/build/esm/cc/VersionCC.js +744 -635
  305. package/build/esm/cc/VersionCC.js.map +1 -1
  306. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  307. package/build/esm/cc/WakeUpCC.js +494 -364
  308. package/build/esm/cc/WakeUpCC.js.map +1 -1
  309. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  310. package/build/esm/cc/WindowCoveringCC.js +655 -530
  311. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  312. package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
  313. package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
  314. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  315. package/build/esm/cc/ZWavePlusCC.js +223 -162
  316. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  317. package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
  318. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  319. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  320. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  321. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
  322. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  323. package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
  324. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  325. package/build/esm/lib/CommandClassDecorators.js +24 -24
  326. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  327. package/build/esm/lib/Security2/Extension.d.ts +1 -1
  328. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  329. package/build/esm/lib/Security2/Extension.js +207 -123
  330. package/build/esm/lib/Security2/Extension.js.map +1 -1
  331. package/package.json +6 -6
@@ -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 MultilevelSwitchCCSet_1, MultilevelSwitchCCReport_1, MultilevelSwitchCCStartLevelChange_1, MultilevelSwitchCCSupportedReport_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -175,7 +202,7 @@ import { Bytes } from "@zwave-js/shared/safe";
175
202
  import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
176
203
  import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
177
204
  import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
178
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
205
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
179
206
  import { V } from "../lib/Values.js";
180
207
  import { LevelChangeDirection, MultilevelSwitchCommand, SwitchType, } from "../lib/_Types.js";
181
208
  /**
@@ -277,534 +304,632 @@ export const MultilevelSwitchCCValues = Object.freeze({
277
304
  }),
278
305
  }),
279
306
  });
280
- let MultilevelSwitchCCAPI = class MultilevelSwitchCCAPI extends CCAPI {
281
- supportsCommand(cmd) {
282
- switch (cmd) {
283
- case MultilevelSwitchCommand.Get:
284
- return this.isSinglecast();
285
- case MultilevelSwitchCommand.Set:
286
- case MultilevelSwitchCommand.StartLevelChange:
287
- case MultilevelSwitchCommand.StopLevelChange:
288
- return true; // This is mandatory
289
- case MultilevelSwitchCommand.SupportedGet:
290
- return this.version >= 3 && this.isSinglecast();
291
- }
292
- return super.supportsCommand(cmd);
293
- }
294
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
295
- async get() {
296
- this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.Get);
297
- const cc = new MultilevelSwitchCCGet({
298
- nodeId: this.endpoint.nodeId,
299
- endpointIndex: this.endpoint.index,
300
- });
301
- const response = await this.host.sendCommand(cc, this.commandOptions);
302
- if (response) {
303
- return pick(response, ["currentValue", "targetValue", "duration"]);
307
+ let MultilevelSwitchCCAPI = (() => {
308
+ let _classDecorators = [API(CommandClasses["Multilevel Switch"])];
309
+ let _classDescriptor;
310
+ let _classExtraInitializers = [];
311
+ let _classThis;
312
+ let _classSuper = CCAPI;
313
+ var MultilevelSwitchCCAPI = class extends _classSuper {
314
+ static { _classThis = this; }
315
+ static {
316
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
317
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
318
+ MultilevelSwitchCCAPI = _classThis = _classDescriptor.value;
319
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
320
+ __runInitializers(_classThis, _classExtraInitializers);
304
321
  }
305
- }
306
- /**
307
- * Sets the switch to a new value
308
- * @param targetValue The new target value for the switch
309
- * @param duration The duration after which the target value should be reached. Can be a Duration instance or a user-friendly duration string like `"1m17s"`. Only supported in V2 and above.
310
- * @returns A promise indicating whether the command was completed
311
- */
312
- async set(targetValue, duration) {
313
- __assertType("targetValue", "number", __assertType__number.bind(void 0, targetValue));
314
- __assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
315
- this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.Set);
316
- const cc = new MultilevelSwitchCCSet({
317
- nodeId: this.endpoint.nodeId,
318
- endpointIndex: this.endpoint.index,
319
- targetValue,
320
- duration,
321
- });
322
- return this.host.sendCommand(cc, this.commandOptions);
323
- }
324
- async startLevelChange(options) {
325
- __assertType("options", "MultilevelSwitchCCStartLevelChangeOptions", __assertType__MultilevelSwitchCCStartLevelChangeOptions.bind(void 0, options));
326
- this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.StartLevelChange);
327
- const cc = new MultilevelSwitchCCStartLevelChange({
328
- nodeId: this.endpoint.nodeId,
329
- endpointIndex: this.endpoint.index,
330
- ...options,
331
- });
332
- return this.host.sendCommand(cc, this.commandOptions);
333
- }
334
- async stopLevelChange() {
335
- this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.StopLevelChange);
336
- const cc = new MultilevelSwitchCCStopLevelChange({
337
- nodeId: this.endpoint.nodeId,
338
- endpointIndex: this.endpoint.index,
339
- });
340
- return this.host.sendCommand(cc, this.commandOptions);
341
- }
342
- async getSupported() {
343
- this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.SupportedGet);
344
- const cc = new MultilevelSwitchCCSupportedGet({
345
- nodeId: this.endpoint.nodeId,
346
- endpointIndex: this.endpoint.index,
347
- });
348
- const response = await this.host.sendCommand(cc, this.commandOptions);
349
- return response?.switchType;
350
- }
351
- get [SET_VALUE]() {
352
- return async function ({ property }, value, options) {
353
- // Enable restoring the previous non-zero value
354
- if (property === "restorePrevious") {
355
- property = "targetValue";
356
- value = 255;
322
+ supportsCommand(cmd) {
323
+ switch (cmd) {
324
+ case MultilevelSwitchCommand.Get:
325
+ return this.isSinglecast();
326
+ case MultilevelSwitchCommand.Set:
327
+ case MultilevelSwitchCommand.StartLevelChange:
328
+ case MultilevelSwitchCommand.StopLevelChange:
329
+ return true; // This is mandatory
330
+ case MultilevelSwitchCommand.SupportedGet:
331
+ return this.version >= 3 && this.isSinglecast();
357
332
  }
358
- if (property === "targetValue") {
359
- if (typeof value !== "number") {
360
- throwWrongValueType(this.ccId, property, "number", typeof value);
361
- }
362
- const duration = Duration.from(options?.transitionDuration);
363
- return this.set(value, duration);
333
+ return super.supportsCommand(cmd);
334
+ }
335
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
336
+ async get() {
337
+ this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.Get);
338
+ const cc = new MultilevelSwitchCCGet({
339
+ nodeId: this.endpoint.nodeId,
340
+ endpointIndex: this.endpoint.index,
341
+ });
342
+ const response = await this.host.sendCommand(cc, this.commandOptions);
343
+ if (response) {
344
+ return pick(response, ["currentValue", "targetValue", "duration"]);
364
345
  }
365
- else if (switchTypeProperties.includes(property)) {
366
- // Since the switch only supports one of the switch types, we would
367
- // need to check if the correct one is used. But since the names are
368
- // purely cosmetic, we just accept all of them
369
- if (typeof value !== "boolean") {
370
- throwWrongValueType(this.ccId, property, "number", typeof value);
346
+ }
347
+ /**
348
+ * Sets the switch to a new value
349
+ * @param targetValue The new target value for the switch
350
+ * @param duration The duration after which the target value should be reached. Can be a Duration instance or a user-friendly duration string like `"1m17s"`. Only supported in V2 and above.
351
+ * @returns A promise indicating whether the command was completed
352
+ */
353
+ async set(targetValue, duration) {
354
+ __assertType("targetValue", "number", __assertType__number.bind(void 0, targetValue));
355
+ __assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
356
+ this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.Set);
357
+ const cc = new MultilevelSwitchCCSet({
358
+ nodeId: this.endpoint.nodeId,
359
+ endpointIndex: this.endpoint.index,
360
+ targetValue,
361
+ duration,
362
+ });
363
+ return this.host.sendCommand(cc, this.commandOptions);
364
+ }
365
+ async startLevelChange(options) {
366
+ __assertType("options", "MultilevelSwitchCCStartLevelChangeOptions", __assertType__MultilevelSwitchCCStartLevelChangeOptions.bind(void 0, options));
367
+ this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.StartLevelChange);
368
+ const cc = new MultilevelSwitchCCStartLevelChange({
369
+ nodeId: this.endpoint.nodeId,
370
+ endpointIndex: this.endpoint.index,
371
+ ...options,
372
+ });
373
+ return this.host.sendCommand(cc, this.commandOptions);
374
+ }
375
+ async stopLevelChange() {
376
+ this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.StopLevelChange);
377
+ const cc = new MultilevelSwitchCCStopLevelChange({
378
+ nodeId: this.endpoint.nodeId,
379
+ endpointIndex: this.endpoint.index,
380
+ });
381
+ return this.host.sendCommand(cc, this.commandOptions);
382
+ }
383
+ async getSupported() {
384
+ this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.SupportedGet);
385
+ const cc = new MultilevelSwitchCCSupportedGet({
386
+ nodeId: this.endpoint.nodeId,
387
+ endpointIndex: this.endpoint.index,
388
+ });
389
+ const response = await this.host.sendCommand(cc, this.commandOptions);
390
+ return response?.switchType;
391
+ }
392
+ get [SET_VALUE]() {
393
+ return async function ({ property }, value, options) {
394
+ // Enable restoring the previous non-zero value
395
+ if (property === "restorePrevious") {
396
+ property = "targetValue";
397
+ value = 255;
371
398
  }
372
- if (value) {
373
- // The property names are organized so that positive motions are
374
- // at odd indices and negative motions at even indices
375
- const direction = switchTypeProperties.indexOf(property) % 2
376
- === 0
377
- ? "down"
378
- : "up";
379
- // Singlecast only: Try to retrieve the current value to use as the start level,
380
- // even if the target node is going to ignore it. There might
381
- // be some bugged devices that ignore the ignore start level flag.
382
- const startLevel = this.tryGetValueDB()?.getValue(MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index));
383
- // And perform the level change
399
+ if (property === "targetValue") {
400
+ if (typeof value !== "number") {
401
+ throwWrongValueType(this.ccId, property, "number", typeof value);
402
+ }
384
403
  const duration = Duration.from(options?.transitionDuration);
385
- return this.startLevelChange({
386
- direction,
387
- ignoreStartLevel: true,
388
- startLevel: typeof startLevel === "number"
389
- ? startLevel
390
- : undefined,
391
- duration,
392
- });
404
+ return this.set(value, duration);
405
+ }
406
+ else if (switchTypeProperties.includes(property)) {
407
+ // Since the switch only supports one of the switch types, we would
408
+ // need to check if the correct one is used. But since the names are
409
+ // purely cosmetic, we just accept all of them
410
+ if (typeof value !== "boolean") {
411
+ throwWrongValueType(this.ccId, property, "number", typeof value);
412
+ }
413
+ if (value) {
414
+ // The property names are organized so that positive motions are
415
+ // at odd indices and negative motions at even indices
416
+ const direction = switchTypeProperties.indexOf(property) % 2
417
+ === 0
418
+ ? "down"
419
+ : "up";
420
+ // Singlecast only: Try to retrieve the current value to use as the start level,
421
+ // even if the target node is going to ignore it. There might
422
+ // be some bugged devices that ignore the ignore start level flag.
423
+ const startLevel = this.tryGetValueDB()?.getValue(MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index));
424
+ // And perform the level change
425
+ const duration = Duration.from(options?.transitionDuration);
426
+ return this.startLevelChange({
427
+ direction,
428
+ ignoreStartLevel: true,
429
+ startLevel: typeof startLevel === "number"
430
+ ? startLevel
431
+ : undefined,
432
+ duration,
433
+ });
434
+ }
435
+ else {
436
+ return this.stopLevelChange();
437
+ }
393
438
  }
394
439
  else {
395
- return this.stopLevelChange();
440
+ throwUnsupportedProperty(this.ccId, property);
396
441
  }
442
+ };
443
+ }
444
+ [SET_VALUE_HOOKS] = ({ property }, value, options) => {
445
+ // Enable restoring the previous non-zero value
446
+ if (property === "restorePrevious") {
447
+ property = "targetValue";
448
+ value = 255;
397
449
  }
398
- else {
399
- throwUnsupportedProperty(this.ccId, property);
400
- }
401
- };
402
- }
403
- [SET_VALUE_HOOKS] = ({ property }, value, options) => {
404
- // Enable restoring the previous non-zero value
405
- if (property === "restorePrevious") {
406
- property = "targetValue";
407
- value = 255;
408
- }
409
- if (property === "targetValue") {
410
- const duration = Duration.from(options?.transitionDuration);
411
- const currentValueValueId = MultilevelSwitchCCValues.currentValue
412
- .endpoint(this.endpoint.index);
413
- return {
414
- // Multilevel Switch commands may take some time to be executed.
415
- // Therefore we try to supervise the command execution and delay the
416
- // optimistic update until the final result is received.
417
- supervisionDelayedUpdates: true,
418
- supervisionOnSuccess: async () => {
419
- // Only update currentValue for valid target values
420
- if (typeof value === "number"
421
- && value >= 0
422
- && value <= 99) {
423
- this.tryGetValueDB()?.setValue(currentValueValueId, value);
424
- }
425
- else if (value === 255) {
426
- // We don't know the status now, so refresh the current value
450
+ if (property === "targetValue") {
451
+ const duration = Duration.from(options?.transitionDuration);
452
+ const currentValueValueId = MultilevelSwitchCCValues.currentValue
453
+ .endpoint(this.endpoint.index);
454
+ return {
455
+ // Multilevel Switch commands may take some time to be executed.
456
+ // Therefore we try to supervise the command execution and delay the
457
+ // optimistic update until the final result is received.
458
+ supervisionDelayedUpdates: true,
459
+ supervisionOnSuccess: async () => {
460
+ // Only update currentValue for valid target values
461
+ if (typeof value === "number"
462
+ && value >= 0
463
+ && value <= 99) {
464
+ this.tryGetValueDB()?.setValue(currentValueValueId, value);
465
+ }
466
+ else if (value === 255) {
467
+ // We don't know the status now, so refresh the current value
468
+ try {
469
+ await this.get();
470
+ }
471
+ catch {
472
+ // ignore
473
+ }
474
+ }
475
+ },
476
+ supervisionOnFailure: async () => {
477
+ // The transition failed, so now we don't know the status - refresh the current value
427
478
  try {
428
479
  await this.get();
429
480
  }
430
481
  catch {
431
482
  // ignore
432
483
  }
433
- }
434
- },
435
- supervisionOnFailure: async () => {
436
- // The transition failed, so now we don't know the status - refresh the current value
437
- try {
438
- await this.get();
439
- }
440
- catch {
441
- // ignore
442
- }
443
- },
444
- optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
445
- // Only update currentValue for valid target values
446
- if (typeof value === "number"
447
- && value >= 0
448
- && value <= 99) {
449
- if (this.isSinglecast()) {
450
- this.tryGetValueDB()?.setValue(currentValueValueId, value);
451
- }
452
- else if (this.isMulticast()) {
453
- // Figure out which nodes were affected by this command
454
- const affectedNodes = this.endpoint.node
455
- .physicalNodes.filter((node) => node
456
- .getEndpoint(this.endpoint.index)
457
- ?.supportsCC(this.ccId));
458
- // and optimistically update the currentValue
459
- for (const node of affectedNodes) {
460
- this.host
461
- .tryGetValueDB(node.id)
462
- ?.setValue(currentValueValueId, value);
484
+ },
485
+ optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
486
+ // Only update currentValue for valid target values
487
+ if (typeof value === "number"
488
+ && value >= 0
489
+ && value <= 99) {
490
+ if (this.isSinglecast()) {
491
+ this.tryGetValueDB()?.setValue(currentValueValueId, value);
492
+ }
493
+ else if (this.isMulticast()) {
494
+ // Figure out which nodes were affected by this command
495
+ const affectedNodes = this.endpoint.node
496
+ .physicalNodes.filter((node) => node
497
+ .getEndpoint(this.endpoint.index)
498
+ ?.supportsCC(this.ccId));
499
+ // and optimistically update the currentValue
500
+ for (const node of affectedNodes) {
501
+ this.host
502
+ .tryGetValueDB(node.id)
503
+ ?.setValue(currentValueValueId, value);
504
+ }
463
505
  }
464
506
  }
465
- }
466
- },
467
- forceVerifyChanges: () => {
468
- // If we don't know the actual value, we need to verify the change, regardless of the supervision result
469
- return value === 255;
470
- },
471
- verifyChanges: () => {
472
- if (this.isSinglecast()
473
- // We generally don't want to poll for multicasts because of how much traffic it can cause
474
- // However, when setting the value 255 (ON), we don't know the actual state
475
- || (this.isMulticast() && value === 255)) {
476
- // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
477
- this.schedulePoll(currentValueValueId, value === 255 ? undefined : value, { duration });
478
- }
479
- },
507
+ },
508
+ forceVerifyChanges: () => {
509
+ // If we don't know the actual value, we need to verify the change, regardless of the supervision result
510
+ return value === 255;
511
+ },
512
+ verifyChanges: () => {
513
+ if (this.isSinglecast()
514
+ // We generally don't want to poll for multicasts because of how much traffic it can cause
515
+ // However, when setting the value 255 (ON), we don't know the actual state
516
+ || (this.isMulticast() && value === 255)) {
517
+ // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
518
+ this.schedulePoll(currentValueValueId, value === 255 ? undefined : value, { duration });
519
+ }
520
+ },
521
+ };
522
+ }
523
+ };
524
+ get [POLL_VALUE]() {
525
+ return async function ({ property }) {
526
+ switch (property) {
527
+ case "currentValue":
528
+ case "targetValue":
529
+ case "duration":
530
+ return (await this.get())?.[property];
531
+ default:
532
+ throwUnsupportedProperty(this.ccId, property);
533
+ }
480
534
  };
481
535
  }
482
536
  };
483
- get [POLL_VALUE]() {
484
- return async function ({ property }) {
485
- switch (property) {
486
- case "currentValue":
487
- case "targetValue":
488
- case "duration":
489
- return (await this.get())?.[property];
490
- default:
491
- throwUnsupportedProperty(this.ccId, property);
492
- }
493
- };
494
- }
495
- };
496
- MultilevelSwitchCCAPI = __decorate([
497
- API(CommandClasses["Multilevel Switch"])
498
- ], MultilevelSwitchCCAPI);
537
+ return MultilevelSwitchCCAPI = _classThis;
538
+ })();
499
539
  export { MultilevelSwitchCCAPI };
500
- let MultilevelSwitchCC = class MultilevelSwitchCC extends CommandClass {
501
- async interview(ctx) {
502
- const node = this.getNode(ctx);
503
- const endpoint = this.getEndpoint(ctx);
504
- const api = CCAPI.create(CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
505
- priority: MessagePriority.NodeQuery,
506
- });
507
- ctx.logNode(node.id, {
508
- endpoint: this.endpointIndex,
509
- message: `Interviewing ${this.ccName}...`,
510
- direction: "none",
511
- });
512
- if (api.version >= 3) {
513
- // Find out which kind of switch this is
540
+ let MultilevelSwitchCC = (() => {
541
+ let _classDecorators = [commandClass(CommandClasses["Multilevel Switch"]), implementedVersion(4), ccValues(MultilevelSwitchCCValues)];
542
+ let _classDescriptor;
543
+ let _classExtraInitializers = [];
544
+ let _classThis;
545
+ let _classSuper = CommandClass;
546
+ var MultilevelSwitchCC = class extends _classSuper {
547
+ static { _classThis = this; }
548
+ static {
549
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
550
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
551
+ MultilevelSwitchCC = _classThis = _classDescriptor.value;
552
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
553
+ __runInitializers(_classThis, _classExtraInitializers);
554
+ }
555
+ async interview(ctx) {
556
+ const node = this.getNode(ctx);
557
+ const endpoint = this.getEndpoint(ctx);
558
+ const api = CCAPI.create(CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
559
+ priority: MessagePriority.NodeQuery,
560
+ });
514
561
  ctx.logNode(node.id, {
515
562
  endpoint: this.endpointIndex,
516
- message: "requesting switch type...",
517
- direction: "outbound",
563
+ message: `Interviewing ${this.ccName}...`,
564
+ direction: "none",
518
565
  });
519
- const switchType = await api.getSupported();
520
- if (switchType != undefined) {
566
+ if (api.version >= 3) {
567
+ // Find out which kind of switch this is
521
568
  ctx.logNode(node.id, {
522
569
  endpoint: this.endpointIndex,
523
- message: `has switch type ${getEnumMemberName(SwitchType, switchType)}`,
524
- direction: "inbound",
570
+ message: "requesting switch type...",
571
+ direction: "outbound",
525
572
  });
573
+ const switchType = await api.getSupported();
574
+ if (switchType != undefined) {
575
+ ctx.logNode(node.id, {
576
+ endpoint: this.endpointIndex,
577
+ message: `has switch type ${getEnumMemberName(SwitchType, switchType)}`,
578
+ direction: "inbound",
579
+ });
580
+ }
581
+ }
582
+ else {
583
+ // requesting the switch type automatically creates the up/down actions
584
+ // We need to do this manually for V1 and V2
585
+ this.createMetadataForLevelChangeActions(ctx);
526
586
  }
587
+ await this.refreshValues(ctx);
588
+ // Remember that the interview is complete
589
+ this.setInterviewComplete(ctx, true);
527
590
  }
528
- else {
529
- // requesting the switch type automatically creates the up/down actions
530
- // We need to do this manually for V1 and V2
531
- this.createMetadataForLevelChangeActions(ctx);
591
+ async refreshValues(ctx) {
592
+ const node = this.getNode(ctx);
593
+ const endpoint = this.getEndpoint(ctx);
594
+ const api = CCAPI.create(CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
595
+ priority: MessagePriority.NodeQuery,
596
+ });
597
+ ctx.logNode(node.id, {
598
+ endpoint: this.endpointIndex,
599
+ message: "requesting current switch state...",
600
+ direction: "outbound",
601
+ });
602
+ await api.get();
532
603
  }
533
- await this.refreshValues(ctx);
534
- // Remember that the interview is complete
535
- this.setInterviewComplete(ctx, true);
536
- }
537
- async refreshValues(ctx) {
538
- const node = this.getNode(ctx);
539
- const endpoint = this.getEndpoint(ctx);
540
- const api = CCAPI.create(CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
541
- priority: MessagePriority.NodeQuery,
542
- });
543
- ctx.logNode(node.id, {
544
- endpoint: this.endpointIndex,
545
- message: "requesting current switch state...",
546
- direction: "outbound",
547
- });
548
- await api.get();
549
- }
550
- setMappedBasicValue(ctx, value) {
551
- this.setValue(ctx, MultilevelSwitchCCValues.currentValue, value);
552
- return true;
553
- }
554
- createMetadataForLevelChangeActions(ctx,
555
- // SDS13781: The Primary Switch Type SHOULD be 0x02 (Up/Down)
556
- switchType = SwitchType["Down/Up"]) {
557
- this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeUp(switchType));
558
- this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeDown(switchType));
559
- }
560
- };
561
- MultilevelSwitchCC = __decorate([
562
- commandClass(CommandClasses["Multilevel Switch"]),
563
- implementedVersion(4),
564
- ccValues(MultilevelSwitchCCValues)
565
- ], MultilevelSwitchCC);
604
+ setMappedBasicValue(ctx, value) {
605
+ this.setValue(ctx, MultilevelSwitchCCValues.currentValue, value);
606
+ return true;
607
+ }
608
+ createMetadataForLevelChangeActions(ctx,
609
+ // SDS13781: The Primary Switch Type SHOULD be 0x02 (Up/Down)
610
+ switchType = SwitchType["Down/Up"]) {
611
+ this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeUp(switchType));
612
+ this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeDown(switchType));
613
+ }
614
+ };
615
+ return MultilevelSwitchCC = _classThis;
616
+ })();
566
617
  export { MultilevelSwitchCC };
567
- let MultilevelSwitchCCSet = MultilevelSwitchCCSet_1 = class MultilevelSwitchCCSet extends MultilevelSwitchCC {
568
- constructor(options) {
569
- super(options);
570
- this.targetValue = options.targetValue;
571
- this.duration = Duration.from(options.duration);
572
- }
573
- static from(raw, ctx) {
574
- validatePayload(raw.payload.length >= 1);
575
- const targetValue = raw.payload[0];
576
- let duration;
577
- if (raw.payload.length >= 2) {
578
- duration = Duration.parseReport(raw.payload[1]);
579
- }
580
- return new MultilevelSwitchCCSet_1({
581
- nodeId: ctx.sourceNodeId,
582
- targetValue,
583
- duration,
584
- });
585
- }
586
- targetValue;
587
- duration;
588
- serialize(ctx) {
589
- this.payload = Bytes.from([
590
- this.targetValue,
591
- (this.duration ?? Duration.default()).serializeSet(),
592
- ]);
593
- const ccVersion = getEffectiveCCVersion(ctx, this);
594
- if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
595
- // When forcing CC version 1, only include the target value
596
- this.payload = this.payload.subarray(0, 1);
597
- }
598
- return super.serialize(ctx);
599
- }
600
- toLogEntry(ctx) {
601
- const message = {
602
- "target value": this.targetValue,
603
- };
604
- if (this.duration) {
605
- message.duration = this.duration.toString();
618
+ let MultilevelSwitchCCSet = (() => {
619
+ let _classDecorators = [CCCommand(MultilevelSwitchCommand.Set), useSupervision()];
620
+ let _classDescriptor;
621
+ let _classExtraInitializers = [];
622
+ let _classThis;
623
+ let _classSuper = MultilevelSwitchCC;
624
+ var MultilevelSwitchCCSet = class extends _classSuper {
625
+ static { _classThis = this; }
626
+ static {
627
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
628
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
629
+ MultilevelSwitchCCSet = _classThis = _classDescriptor.value;
630
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
631
+ __runInitializers(_classThis, _classExtraInitializers);
606
632
  }
607
- return {
608
- ...super.toLogEntry(ctx),
609
- message,
610
- };
611
- }
612
- };
613
- MultilevelSwitchCCSet = MultilevelSwitchCCSet_1 = __decorate([
614
- CCCommand(MultilevelSwitchCommand.Set),
615
- useSupervision()
616
- ], MultilevelSwitchCCSet);
633
+ constructor(options) {
634
+ super(options);
635
+ this.targetValue = options.targetValue;
636
+ this.duration = Duration.from(options.duration);
637
+ }
638
+ static from(raw, ctx) {
639
+ validatePayload(raw.payload.length >= 1);
640
+ const targetValue = raw.payload[0];
641
+ let duration;
642
+ if (raw.payload.length >= 2) {
643
+ duration = Duration.parseReport(raw.payload[1]);
644
+ }
645
+ return new this({
646
+ nodeId: ctx.sourceNodeId,
647
+ targetValue,
648
+ duration,
649
+ });
650
+ }
651
+ targetValue;
652
+ duration;
653
+ serialize(ctx) {
654
+ this.payload = Bytes.from([
655
+ this.targetValue,
656
+ (this.duration ?? Duration.default()).serializeSet(),
657
+ ]);
658
+ const ccVersion = getEffectiveCCVersion(ctx, this);
659
+ if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
660
+ // When forcing CC version 1, only include the target value
661
+ this.payload = this.payload.subarray(0, 1);
662
+ }
663
+ return super.serialize(ctx);
664
+ }
665
+ toLogEntry(ctx) {
666
+ const message = {
667
+ "target value": this.targetValue,
668
+ };
669
+ if (this.duration) {
670
+ message.duration = this.duration.toString();
671
+ }
672
+ return {
673
+ ...super.toLogEntry(ctx),
674
+ message,
675
+ };
676
+ }
677
+ };
678
+ return MultilevelSwitchCCSet = _classThis;
679
+ })();
617
680
  export { MultilevelSwitchCCSet };
618
- let MultilevelSwitchCCReport = MultilevelSwitchCCReport_1 = class MultilevelSwitchCCReport extends MultilevelSwitchCC {
619
- constructor(options) {
620
- super(options);
621
- this.currentValue = options.currentValue;
622
- this.targetValue = options.targetValue;
623
- this.duration = Duration.from(options.duration);
624
- }
625
- static from(raw, ctx) {
626
- validatePayload(raw.payload.length >= 1);
627
- const currentValue =
628
- // 0xff is a legacy value for 100% (99)
629
- raw.payload[0] === 0xff
630
- ? 99
631
- : parseMaybeNumber(raw.payload[0]);
632
- let targetValue;
633
- let duration;
634
- if (raw.payload.length >= 3) {
635
- targetValue = parseMaybeNumber(raw.payload[1]);
636
- duration = Duration.parseReport(raw.payload[2]);
637
- }
638
- return new MultilevelSwitchCCReport_1({
639
- nodeId: ctx.sourceNodeId,
640
- currentValue,
641
- targetValue,
642
- duration,
643
- });
644
- }
645
- targetValue;
646
- duration;
647
- currentValue;
648
- serialize(ctx) {
649
- this.payload = Bytes.from([
650
- this.currentValue ?? 0xfe,
651
- this.targetValue ?? 0xfe,
652
- (this.duration ?? Duration.default()).serializeReport(),
653
- ]);
654
- return super.serialize(ctx);
655
- }
656
- toLogEntry(ctx) {
657
- const message = {
658
- "current value": maybeUnknownToString(this.currentValue),
659
- };
660
- if (this.targetValue !== NOT_KNOWN && this.duration) {
661
- message["target value"] = maybeUnknownToString(this.targetValue);
662
- message.duration = this.duration.toString();
681
+ let MultilevelSwitchCCReport = (() => {
682
+ let _classDecorators = [CCCommand(MultilevelSwitchCommand.Report), ccValueProperty("targetValue", MultilevelSwitchCCValues.targetValue), ccValueProperty("duration", MultilevelSwitchCCValues.duration), ccValueProperty("currentValue", MultilevelSwitchCCValues.currentValue)];
683
+ let _classDescriptor;
684
+ let _classExtraInitializers = [];
685
+ let _classThis;
686
+ let _classSuper = MultilevelSwitchCC;
687
+ var MultilevelSwitchCCReport = class extends _classSuper {
688
+ static { _classThis = this; }
689
+ static {
690
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
691
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
692
+ MultilevelSwitchCCReport = _classThis = _classDescriptor.value;
693
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
694
+ __runInitializers(_classThis, _classExtraInitializers);
663
695
  }
664
- return {
665
- ...super.toLogEntry(ctx),
666
- message,
667
- };
668
- }
669
- };
670
- __decorate([
671
- ccValue(MultilevelSwitchCCValues.targetValue)
672
- ], MultilevelSwitchCCReport.prototype, "targetValue", void 0);
673
- __decorate([
674
- ccValue(MultilevelSwitchCCValues.duration)
675
- ], MultilevelSwitchCCReport.prototype, "duration", void 0);
676
- __decorate([
677
- ccValue(MultilevelSwitchCCValues.currentValue)
678
- ], MultilevelSwitchCCReport.prototype, "currentValue", void 0);
679
- MultilevelSwitchCCReport = MultilevelSwitchCCReport_1 = __decorate([
680
- CCCommand(MultilevelSwitchCommand.Report)
681
- ], MultilevelSwitchCCReport);
696
+ constructor(options) {
697
+ super(options);
698
+ this.currentValue = options.currentValue;
699
+ this.targetValue = options.targetValue;
700
+ this.duration = Duration.from(options.duration);
701
+ }
702
+ static from(raw, ctx) {
703
+ validatePayload(raw.payload.length >= 1);
704
+ const currentValue =
705
+ // 0xff is a legacy value for 100% (99)
706
+ raw.payload[0] === 0xff
707
+ ? 99
708
+ : parseMaybeNumber(raw.payload[0]);
709
+ let targetValue;
710
+ let duration;
711
+ if (raw.payload.length >= 3) {
712
+ targetValue = parseMaybeNumber(raw.payload[1]);
713
+ duration = Duration.parseReport(raw.payload[2]);
714
+ }
715
+ return new this({
716
+ nodeId: ctx.sourceNodeId,
717
+ currentValue,
718
+ targetValue,
719
+ duration,
720
+ });
721
+ }
722
+ targetValue;
723
+ duration;
724
+ currentValue;
725
+ serialize(ctx) {
726
+ this.payload = Bytes.from([
727
+ this.currentValue ?? 0xfe,
728
+ this.targetValue ?? 0xfe,
729
+ (this.duration ?? Duration.default()).serializeReport(),
730
+ ]);
731
+ return super.serialize(ctx);
732
+ }
733
+ toLogEntry(ctx) {
734
+ const message = {
735
+ "current value": maybeUnknownToString(this.currentValue),
736
+ };
737
+ if (this.targetValue !== NOT_KNOWN && this.duration) {
738
+ message["target value"] = maybeUnknownToString(this.targetValue);
739
+ message.duration = this.duration.toString();
740
+ }
741
+ return {
742
+ ...super.toLogEntry(ctx),
743
+ message,
744
+ };
745
+ }
746
+ };
747
+ return MultilevelSwitchCCReport = _classThis;
748
+ })();
682
749
  export { MultilevelSwitchCCReport };
683
- let MultilevelSwitchCCGet = class MultilevelSwitchCCGet extends MultilevelSwitchCC {
684
- };
685
- MultilevelSwitchCCGet = __decorate([
686
- CCCommand(MultilevelSwitchCommand.Get),
687
- expectedCCResponse(MultilevelSwitchCCReport)
688
- ], MultilevelSwitchCCGet);
750
+ let MultilevelSwitchCCGet = (() => {
751
+ let _classDecorators = [CCCommand(MultilevelSwitchCommand.Get), expectedCCResponse(MultilevelSwitchCCReport)];
752
+ let _classDescriptor;
753
+ let _classExtraInitializers = [];
754
+ let _classThis;
755
+ let _classSuper = MultilevelSwitchCC;
756
+ var MultilevelSwitchCCGet = class extends _classSuper {
757
+ static { _classThis = this; }
758
+ static {
759
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
760
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
761
+ MultilevelSwitchCCGet = _classThis = _classDescriptor.value;
762
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
763
+ __runInitializers(_classThis, _classExtraInitializers);
764
+ }
765
+ };
766
+ return MultilevelSwitchCCGet = _classThis;
767
+ })();
689
768
  export { MultilevelSwitchCCGet };
690
- let MultilevelSwitchCCStartLevelChange = MultilevelSwitchCCStartLevelChange_1 = class MultilevelSwitchCCStartLevelChange extends MultilevelSwitchCC {
691
- constructor(options) {
692
- super(options);
693
- this.duration = Duration.from(options.duration);
694
- this.ignoreStartLevel = options.ignoreStartLevel;
695
- this.startLevel = options.startLevel ?? 0;
696
- this.direction = options.direction;
697
- }
698
- static from(raw, ctx) {
699
- validatePayload(raw.payload.length >= 2);
700
- const ignoreStartLevel = !!((raw.payload[0] & 0b0_0_1_00000) >>> 5);
701
- const direction = ((raw.payload[0] & 0b0_1_0_00000) >>> 6)
702
- ? "down"
703
- : "up";
704
- const startLevel = raw.payload[1];
705
- let duration;
706
- if (raw.payload.length >= 3) {
707
- duration = Duration.parseSet(raw.payload[2]);
708
- }
709
- return new MultilevelSwitchCCStartLevelChange_1({
710
- nodeId: ctx.sourceNodeId,
711
- ignoreStartLevel,
712
- direction,
713
- startLevel,
714
- duration,
715
- });
716
- }
717
- duration;
718
- startLevel;
719
- ignoreStartLevel;
720
- direction;
721
- serialize(ctx) {
722
- const controlByte = (LevelChangeDirection[this.direction] << 6)
723
- | (this.ignoreStartLevel ? 0b0010_0000 : 0);
724
- this.payload = Bytes.from([
725
- controlByte,
726
- this.startLevel,
727
- (this.duration ?? Duration.default()).serializeSet(),
728
- ]);
729
- const ccVersion = getEffectiveCCVersion(ctx, this);
730
- if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
731
- // When forcing CC version 1, omit the duration byte
732
- this.payload = this.payload.subarray(0, -1);
733
- }
734
- return super.serialize(ctx);
735
- }
736
- toLogEntry(ctx) {
737
- const message = {
738
- startLevel: `${this.startLevel}${this.ignoreStartLevel ? " (ignored)" : ""}`,
739
- direction: this.direction,
740
- };
741
- if (this.duration) {
742
- message.duration = this.duration.toString();
769
+ let MultilevelSwitchCCStartLevelChange = (() => {
770
+ let _classDecorators = [CCCommand(MultilevelSwitchCommand.StartLevelChange), useSupervision()];
771
+ let _classDescriptor;
772
+ let _classExtraInitializers = [];
773
+ let _classThis;
774
+ let _classSuper = MultilevelSwitchCC;
775
+ var MultilevelSwitchCCStartLevelChange = class extends _classSuper {
776
+ static { _classThis = this; }
777
+ static {
778
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
779
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
780
+ MultilevelSwitchCCStartLevelChange = _classThis = _classDescriptor.value;
781
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
782
+ __runInitializers(_classThis, _classExtraInitializers);
743
783
  }
744
- return {
745
- ...super.toLogEntry(ctx),
746
- message,
747
- };
748
- }
749
- };
750
- MultilevelSwitchCCStartLevelChange = MultilevelSwitchCCStartLevelChange_1 = __decorate([
751
- CCCommand(MultilevelSwitchCommand.StartLevelChange),
752
- useSupervision()
753
- ], MultilevelSwitchCCStartLevelChange);
784
+ constructor(options) {
785
+ super(options);
786
+ this.duration = Duration.from(options.duration);
787
+ this.ignoreStartLevel = options.ignoreStartLevel;
788
+ this.startLevel = options.startLevel ?? 0;
789
+ this.direction = options.direction;
790
+ }
791
+ static from(raw, ctx) {
792
+ validatePayload(raw.payload.length >= 2);
793
+ const ignoreStartLevel = !!((raw.payload[0] & 0b0_0_1_00000) >>> 5);
794
+ const direction = ((raw.payload[0] & 0b0_1_0_00000) >>> 6)
795
+ ? "down"
796
+ : "up";
797
+ const startLevel = raw.payload[1];
798
+ let duration;
799
+ if (raw.payload.length >= 3) {
800
+ duration = Duration.parseSet(raw.payload[2]);
801
+ }
802
+ return new this({
803
+ nodeId: ctx.sourceNodeId,
804
+ ignoreStartLevel,
805
+ direction,
806
+ startLevel,
807
+ duration,
808
+ });
809
+ }
810
+ duration;
811
+ startLevel;
812
+ ignoreStartLevel;
813
+ direction;
814
+ serialize(ctx) {
815
+ const controlByte = (LevelChangeDirection[this.direction] << 6)
816
+ | (this.ignoreStartLevel ? 0b0010_0000 : 0);
817
+ this.payload = Bytes.from([
818
+ controlByte,
819
+ this.startLevel,
820
+ (this.duration ?? Duration.default()).serializeSet(),
821
+ ]);
822
+ const ccVersion = getEffectiveCCVersion(ctx, this);
823
+ if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
824
+ // When forcing CC version 1, omit the duration byte
825
+ this.payload = this.payload.subarray(0, -1);
826
+ }
827
+ return super.serialize(ctx);
828
+ }
829
+ toLogEntry(ctx) {
830
+ const message = {
831
+ startLevel: `${this.startLevel}${this.ignoreStartLevel ? " (ignored)" : ""}`,
832
+ direction: this.direction,
833
+ };
834
+ if (this.duration) {
835
+ message.duration = this.duration.toString();
836
+ }
837
+ return {
838
+ ...super.toLogEntry(ctx),
839
+ message,
840
+ };
841
+ }
842
+ };
843
+ return MultilevelSwitchCCStartLevelChange = _classThis;
844
+ })();
754
845
  export { MultilevelSwitchCCStartLevelChange };
755
- let MultilevelSwitchCCStopLevelChange = class MultilevelSwitchCCStopLevelChange extends MultilevelSwitchCC {
756
- };
757
- MultilevelSwitchCCStopLevelChange = __decorate([
758
- CCCommand(MultilevelSwitchCommand.StopLevelChange),
759
- useSupervision()
760
- ], MultilevelSwitchCCStopLevelChange);
846
+ let MultilevelSwitchCCStopLevelChange = (() => {
847
+ let _classDecorators = [CCCommand(MultilevelSwitchCommand.StopLevelChange), useSupervision()];
848
+ let _classDescriptor;
849
+ let _classExtraInitializers = [];
850
+ let _classThis;
851
+ let _classSuper = MultilevelSwitchCC;
852
+ var MultilevelSwitchCCStopLevelChange = class extends _classSuper {
853
+ static { _classThis = this; }
854
+ static {
855
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
856
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
857
+ MultilevelSwitchCCStopLevelChange = _classThis = _classDescriptor.value;
858
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
859
+ __runInitializers(_classThis, _classExtraInitializers);
860
+ }
861
+ };
862
+ return MultilevelSwitchCCStopLevelChange = _classThis;
863
+ })();
761
864
  export { MultilevelSwitchCCStopLevelChange };
762
- let MultilevelSwitchCCSupportedReport = MultilevelSwitchCCSupportedReport_1 = class MultilevelSwitchCCSupportedReport extends MultilevelSwitchCC {
763
- constructor(options) {
764
- super(options);
765
- this.switchType = options.switchType;
766
- }
767
- static from(raw, ctx) {
768
- validatePayload(raw.payload.length >= 1);
769
- const switchType = raw.payload[0] & 0b11111;
770
- return new MultilevelSwitchCCSupportedReport_1({
771
- nodeId: ctx.sourceNodeId,
772
- switchType,
773
- });
774
- }
775
- // This is the primary switch type. We're not supporting secondary switch types
776
- switchType;
777
- persistValues(ctx) {
778
- if (!super.persistValues(ctx))
779
- return false;
780
- this.createMetadataForLevelChangeActions(ctx, this.switchType);
781
- return true;
782
- }
783
- serialize(ctx) {
784
- this.payload = Bytes.from([this.switchType & 0b11111]);
785
- return super.serialize(ctx);
786
- }
787
- toLogEntry(ctx) {
788
- return {
789
- ...super.toLogEntry(ctx),
790
- message: {
791
- "switch type": getEnumMemberName(SwitchType, this.switchType),
792
- },
793
- };
794
- }
795
- };
796
- __decorate([
797
- ccValue(MultilevelSwitchCCValues.switchType)
798
- ], MultilevelSwitchCCSupportedReport.prototype, "switchType", void 0);
799
- MultilevelSwitchCCSupportedReport = MultilevelSwitchCCSupportedReport_1 = __decorate([
800
- CCCommand(MultilevelSwitchCommand.SupportedReport)
801
- ], MultilevelSwitchCCSupportedReport);
865
+ let MultilevelSwitchCCSupportedReport = (() => {
866
+ let _classDecorators = [CCCommand(MultilevelSwitchCommand.SupportedReport), ccValueProperty("switchType", MultilevelSwitchCCValues.switchType)];
867
+ let _classDescriptor;
868
+ let _classExtraInitializers = [];
869
+ let _classThis;
870
+ let _classSuper = MultilevelSwitchCC;
871
+ var MultilevelSwitchCCSupportedReport = class extends _classSuper {
872
+ static { _classThis = this; }
873
+ static {
874
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
875
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
876
+ MultilevelSwitchCCSupportedReport = _classThis = _classDescriptor.value;
877
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
878
+ __runInitializers(_classThis, _classExtraInitializers);
879
+ }
880
+ constructor(options) {
881
+ super(options);
882
+ this.switchType = options.switchType;
883
+ }
884
+ static from(raw, ctx) {
885
+ validatePayload(raw.payload.length >= 1);
886
+ const switchType = raw.payload[0] & 0b11111;
887
+ return new this({
888
+ nodeId: ctx.sourceNodeId,
889
+ switchType,
890
+ });
891
+ }
892
+ // This is the primary switch type. We're not supporting secondary switch types
893
+ switchType;
894
+ persistValues(ctx) {
895
+ if (!super.persistValues(ctx))
896
+ return false;
897
+ this.createMetadataForLevelChangeActions(ctx, this.switchType);
898
+ return true;
899
+ }
900
+ serialize(ctx) {
901
+ this.payload = Bytes.from([this.switchType & 0b11111]);
902
+ return super.serialize(ctx);
903
+ }
904
+ toLogEntry(ctx) {
905
+ return {
906
+ ...super.toLogEntry(ctx),
907
+ message: {
908
+ "switch type": getEnumMemberName(SwitchType, this.switchType),
909
+ },
910
+ };
911
+ }
912
+ };
913
+ return MultilevelSwitchCCSupportedReport = _classThis;
914
+ })();
802
915
  export { MultilevelSwitchCCSupportedReport };
803
- let MultilevelSwitchCCSupportedGet = class MultilevelSwitchCCSupportedGet extends MultilevelSwitchCC {
804
- };
805
- MultilevelSwitchCCSupportedGet = __decorate([
806
- CCCommand(MultilevelSwitchCommand.SupportedGet),
807
- expectedCCResponse(MultilevelSwitchCCSupportedReport)
808
- ], MultilevelSwitchCCSupportedGet);
916
+ let MultilevelSwitchCCSupportedGet = (() => {
917
+ let _classDecorators = [CCCommand(MultilevelSwitchCommand.SupportedGet), expectedCCResponse(MultilevelSwitchCCSupportedReport)];
918
+ let _classDescriptor;
919
+ let _classExtraInitializers = [];
920
+ let _classThis;
921
+ let _classSuper = MultilevelSwitchCC;
922
+ var MultilevelSwitchCCSupportedGet = class extends _classSuper {
923
+ static { _classThis = this; }
924
+ static {
925
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
926
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
927
+ MultilevelSwitchCCSupportedGet = _classThis = _classDescriptor.value;
928
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
929
+ __runInitializers(_classThis, _classExtraInitializers);
930
+ }
931
+ };
932
+ return MultilevelSwitchCCSupportedGet = _classThis;
933
+ })();
809
934
  export { MultilevelSwitchCCSupportedGet };
810
935
  //# sourceMappingURL=MultilevelSwitchCC.js.map