@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
@@ -38,13 +38,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
38
38
  var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
39
39
  var import_Values = require("../lib/Values.js");
40
40
  var import_Types = require("../lib/_Types.js");
41
- var __decorate = function(decorators, target, key, desc) {
42
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
43
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
44
- 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;
45
- return c > 3 && r && Object.defineProperty(target, key, r), r;
41
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
42
+ function accept(f) {
43
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
44
+ return f;
45
+ }
46
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
47
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
48
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
49
+ var _, done = false;
50
+ for (var i = decorators.length - 1; i >= 0; i--) {
51
+ var context = {};
52
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
53
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
54
+ context.addInitializer = function(f) {
55
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
56
+ extraInitializers.push(accept(f || null));
57
+ };
58
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
59
+ if (kind === "accessor") {
60
+ if (result === void 0) continue;
61
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
62
+ if (_ = accept(result.get)) descriptor.get = _;
63
+ if (_ = accept(result.set)) descriptor.set = _;
64
+ if (_ = accept(result.init)) initializers.unshift(_);
65
+ } else if (_ = accept(result)) {
66
+ if (kind === "field") initializers.unshift(_);
67
+ else descriptor[key] = _;
68
+ }
69
+ }
70
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
71
+ done = true;
72
+ };
73
+ var __runInitializers = function(thisArg, initializers, value) {
74
+ var useValue = arguments.length > 2;
75
+ for (var i = 0; i < initializers.length; i++) {
76
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
77
+ }
78
+ return useValue ? value : void 0;
46
79
  };
47
- var MultilevelSwitchCCSet_1, MultilevelSwitchCCReport_1, MultilevelSwitchCCStartLevelChange_1, MultilevelSwitchCCSupportedReport_1;
48
80
  function __assertType(argName, typeName, boundHasError) {
49
81
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
50
82
  if (boundHasError()) {
@@ -301,469 +333,585 @@ const MultilevelSwitchCCValues = Object.freeze({
301
333
  )
302
334
  })
303
335
  });
304
- let MultilevelSwitchCCAPI = class MultilevelSwitchCCAPI2 extends import_API.CCAPI {
305
- supportsCommand(cmd) {
306
- switch (cmd) {
307
- case import_Types.MultilevelSwitchCommand.Get:
308
- return this.isSinglecast();
309
- case import_Types.MultilevelSwitchCommand.Set:
310
- case import_Types.MultilevelSwitchCommand.StartLevelChange:
311
- case import_Types.MultilevelSwitchCommand.StopLevelChange:
312
- return true;
313
- // This is mandatory
314
- case import_Types.MultilevelSwitchCommand.SupportedGet:
315
- return this.version >= 3 && this.isSinglecast();
316
- }
317
- return super.supportsCommand(cmd);
318
- }
319
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
320
- async get() {
321
- this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.Get);
322
- const cc = new MultilevelSwitchCCGet({
323
- nodeId: this.endpoint.nodeId,
324
- endpointIndex: this.endpoint.index
325
- });
326
- const response = await this.host.sendCommand(cc, this.commandOptions);
327
- if (response) {
328
- return (0, import_safe3.pick)(response, ["currentValue", "targetValue", "duration"]);
336
+ let MultilevelSwitchCCAPI = (() => {
337
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multilevel Switch"])];
338
+ let _classDescriptor;
339
+ let _classExtraInitializers = [];
340
+ let _classThis;
341
+ let _classSuper = import_API.CCAPI;
342
+ var MultilevelSwitchCCAPI2 = class extends _classSuper {
343
+ static {
344
+ _classThis = this;
329
345
  }
330
- }
331
- /**
332
- * Sets the switch to a new value
333
- * @param targetValue The new target value for the switch
334
- * @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.
335
- * @returns A promise indicating whether the command was completed
336
- */
337
- async set(targetValue, duration) {
338
- __assertType("targetValue", "number", __assertType__number.bind(void 0, targetValue));
339
- __assertType("duration", void 0, __assertType__optional_su__string__2_eu.bind(void 0, duration));
340
- this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.Set);
341
- const cc = new MultilevelSwitchCCSet({
342
- nodeId: this.endpoint.nodeId,
343
- endpointIndex: this.endpoint.index,
344
- targetValue,
345
- duration
346
- });
347
- return this.host.sendCommand(cc, this.commandOptions);
348
- }
349
- async startLevelChange(options) {
350
- __assertType("options", "MultilevelSwitchCCStartLevelChangeOptions", __assertType__MultilevelSwitchCCStartLevelChangeOptions.bind(void 0, options));
351
- this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.StartLevelChange);
352
- const cc = new MultilevelSwitchCCStartLevelChange({
353
- nodeId: this.endpoint.nodeId,
354
- endpointIndex: this.endpoint.index,
355
- ...options
356
- });
357
- return this.host.sendCommand(cc, this.commandOptions);
358
- }
359
- async stopLevelChange() {
360
- this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.StopLevelChange);
361
- const cc = new MultilevelSwitchCCStopLevelChange({
362
- nodeId: this.endpoint.nodeId,
363
- endpointIndex: this.endpoint.index
364
- });
365
- return this.host.sendCommand(cc, this.commandOptions);
366
- }
367
- async getSupported() {
368
- this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.SupportedGet);
369
- const cc = new MultilevelSwitchCCSupportedGet({
370
- nodeId: this.endpoint.nodeId,
371
- endpointIndex: this.endpoint.index
372
- });
373
- const response = await this.host.sendCommand(cc, this.commandOptions);
374
- return response?.switchType;
375
- }
376
- get [import_API.SET_VALUE]() {
377
- return async function({ property }, value, options) {
378
- if (property === "restorePrevious") {
379
- property = "targetValue";
380
- value = 255;
346
+ static {
347
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
348
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
349
+ MultilevelSwitchCCAPI2 = _classThis = _classDescriptor.value;
350
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
351
+ __runInitializers(_classThis, _classExtraInitializers);
352
+ }
353
+ supportsCommand(cmd) {
354
+ switch (cmd) {
355
+ case import_Types.MultilevelSwitchCommand.Get:
356
+ return this.isSinglecast();
357
+ case import_Types.MultilevelSwitchCommand.Set:
358
+ case import_Types.MultilevelSwitchCommand.StartLevelChange:
359
+ case import_Types.MultilevelSwitchCommand.StopLevelChange:
360
+ return true;
361
+ // This is mandatory
362
+ case import_Types.MultilevelSwitchCommand.SupportedGet:
363
+ return this.version >= 3 && this.isSinglecast();
381
364
  }
382
- if (property === "targetValue") {
383
- if (typeof value !== "number") {
384
- (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
385
- }
386
- const duration = import_safe.Duration.from(options?.transitionDuration);
387
- return this.set(value, duration);
388
- } else if (switchTypeProperties.includes(property)) {
389
- if (typeof value !== "boolean") {
390
- (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
365
+ return super.supportsCommand(cmd);
366
+ }
367
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
368
+ async get() {
369
+ this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.Get);
370
+ const cc = new MultilevelSwitchCCGet({
371
+ nodeId: this.endpoint.nodeId,
372
+ endpointIndex: this.endpoint.index
373
+ });
374
+ const response = await this.host.sendCommand(cc, this.commandOptions);
375
+ if (response) {
376
+ return (0, import_safe3.pick)(response, ["currentValue", "targetValue", "duration"]);
377
+ }
378
+ }
379
+ /**
380
+ * Sets the switch to a new value
381
+ * @param targetValue The new target value for the switch
382
+ * @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.
383
+ * @returns A promise indicating whether the command was completed
384
+ */
385
+ async set(targetValue, duration) {
386
+ __assertType("targetValue", "number", __assertType__number.bind(void 0, targetValue));
387
+ __assertType("duration", void 0, __assertType__optional_su__string__2_eu.bind(void 0, duration));
388
+ this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.Set);
389
+ const cc = new MultilevelSwitchCCSet({
390
+ nodeId: this.endpoint.nodeId,
391
+ endpointIndex: this.endpoint.index,
392
+ targetValue,
393
+ duration
394
+ });
395
+ return this.host.sendCommand(cc, this.commandOptions);
396
+ }
397
+ async startLevelChange(options) {
398
+ __assertType("options", "MultilevelSwitchCCStartLevelChangeOptions", __assertType__MultilevelSwitchCCStartLevelChangeOptions.bind(void 0, options));
399
+ this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.StartLevelChange);
400
+ const cc = new MultilevelSwitchCCStartLevelChange({
401
+ nodeId: this.endpoint.nodeId,
402
+ endpointIndex: this.endpoint.index,
403
+ ...options
404
+ });
405
+ return this.host.sendCommand(cc, this.commandOptions);
406
+ }
407
+ async stopLevelChange() {
408
+ this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.StopLevelChange);
409
+ const cc = new MultilevelSwitchCCStopLevelChange({
410
+ nodeId: this.endpoint.nodeId,
411
+ endpointIndex: this.endpoint.index
412
+ });
413
+ return this.host.sendCommand(cc, this.commandOptions);
414
+ }
415
+ async getSupported() {
416
+ this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.SupportedGet);
417
+ const cc = new MultilevelSwitchCCSupportedGet({
418
+ nodeId: this.endpoint.nodeId,
419
+ endpointIndex: this.endpoint.index
420
+ });
421
+ const response = await this.host.sendCommand(cc, this.commandOptions);
422
+ return response?.switchType;
423
+ }
424
+ get [import_API.SET_VALUE]() {
425
+ return async function({ property }, value, options) {
426
+ if (property === "restorePrevious") {
427
+ property = "targetValue";
428
+ value = 255;
391
429
  }
392
- if (value) {
393
- const direction = switchTypeProperties.indexOf(property) % 2 === 0 ? "down" : "up";
394
- const startLevel = this.tryGetValueDB()?.getValue(MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index));
430
+ if (property === "targetValue") {
431
+ if (typeof value !== "number") {
432
+ (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
433
+ }
395
434
  const duration = import_safe.Duration.from(options?.transitionDuration);
396
- return this.startLevelChange({
397
- direction,
398
- ignoreStartLevel: true,
399
- startLevel: typeof startLevel === "number" ? startLevel : void 0,
400
- duration
401
- });
435
+ return this.set(value, duration);
436
+ } else if (switchTypeProperties.includes(property)) {
437
+ if (typeof value !== "boolean") {
438
+ (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
439
+ }
440
+ if (value) {
441
+ const direction = switchTypeProperties.indexOf(property) % 2 === 0 ? "down" : "up";
442
+ const startLevel = this.tryGetValueDB()?.getValue(MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index));
443
+ const duration = import_safe.Duration.from(options?.transitionDuration);
444
+ return this.startLevelChange({
445
+ direction,
446
+ ignoreStartLevel: true,
447
+ startLevel: typeof startLevel === "number" ? startLevel : void 0,
448
+ duration
449
+ });
450
+ } else {
451
+ return this.stopLevelChange();
452
+ }
402
453
  } else {
403
- return this.stopLevelChange();
454
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
404
455
  }
405
- } else {
406
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
456
+ };
457
+ }
458
+ [import_API.SET_VALUE_HOOKS] = ({ property }, value, options) => {
459
+ if (property === "restorePrevious") {
460
+ property = "targetValue";
461
+ value = 255;
407
462
  }
408
- };
409
- }
410
- [import_API.SET_VALUE_HOOKS] = ({ property }, value, options) => {
411
- if (property === "restorePrevious") {
412
- property = "targetValue";
413
- value = 255;
414
- }
415
- if (property === "targetValue") {
416
- const duration = import_safe.Duration.from(options?.transitionDuration);
417
- const currentValueValueId = MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index);
418
- return {
419
- // Multilevel Switch commands may take some time to be executed.
420
- // Therefore we try to supervise the command execution and delay the
421
- // optimistic update until the final result is received.
422
- supervisionDelayedUpdates: true,
423
- supervisionOnSuccess: async () => {
424
- if (typeof value === "number" && value >= 0 && value <= 99) {
425
- this.tryGetValueDB()?.setValue(currentValueValueId, value);
426
- } else if (value === 255) {
463
+ if (property === "targetValue") {
464
+ const duration = import_safe.Duration.from(options?.transitionDuration);
465
+ const currentValueValueId = MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index);
466
+ return {
467
+ // Multilevel Switch commands may take some time to be executed.
468
+ // Therefore we try to supervise the command execution and delay the
469
+ // optimistic update until the final result is received.
470
+ supervisionDelayedUpdates: true,
471
+ supervisionOnSuccess: async () => {
472
+ if (typeof value === "number" && value >= 0 && value <= 99) {
473
+ this.tryGetValueDB()?.setValue(currentValueValueId, value);
474
+ } else if (value === 255) {
475
+ try {
476
+ await this.get();
477
+ } catch {
478
+ }
479
+ }
480
+ },
481
+ supervisionOnFailure: async () => {
427
482
  try {
428
483
  await this.get();
429
484
  } catch {
430
485
  }
431
- }
432
- },
433
- supervisionOnFailure: async () => {
434
- try {
435
- await this.get();
436
- } catch {
437
- }
438
- },
439
- optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
440
- if (typeof value === "number" && value >= 0 && value <= 99) {
441
- if (this.isSinglecast()) {
442
- this.tryGetValueDB()?.setValue(currentValueValueId, value);
443
- } else if (this.isMulticast()) {
444
- const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node.getEndpoint(this.endpoint.index)?.supportsCC(this.ccId));
445
- for (const node of affectedNodes) {
446
- this.host.tryGetValueDB(node.id)?.setValue(currentValueValueId, value);
486
+ },
487
+ optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
488
+ if (typeof value === "number" && value >= 0 && value <= 99) {
489
+ if (this.isSinglecast()) {
490
+ this.tryGetValueDB()?.setValue(currentValueValueId, value);
491
+ } else if (this.isMulticast()) {
492
+ const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node.getEndpoint(this.endpoint.index)?.supportsCC(this.ccId));
493
+ for (const node of affectedNodes) {
494
+ this.host.tryGetValueDB(node.id)?.setValue(currentValueValueId, value);
495
+ }
447
496
  }
448
497
  }
498
+ },
499
+ forceVerifyChanges: () => {
500
+ return value === 255;
501
+ },
502
+ verifyChanges: () => {
503
+ if (this.isSinglecast() || this.isMulticast() && value === 255) {
504
+ this.schedulePoll(currentValueValueId, value === 255 ? void 0 : value, { duration });
505
+ }
449
506
  }
450
- },
451
- forceVerifyChanges: () => {
452
- return value === 255;
453
- },
454
- verifyChanges: () => {
455
- if (this.isSinglecast() || this.isMulticast() && value === 255) {
456
- this.schedulePoll(currentValueValueId, value === 255 ? void 0 : value, { duration });
457
- }
507
+ };
508
+ }
509
+ };
510
+ get [import_API.POLL_VALUE]() {
511
+ return async function({ property }) {
512
+ switch (property) {
513
+ case "currentValue":
514
+ case "targetValue":
515
+ case "duration":
516
+ return (await this.get())?.[property];
517
+ default:
518
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
458
519
  }
459
520
  };
460
521
  }
461
522
  };
462
- get [import_API.POLL_VALUE]() {
463
- return async function({ property }) {
464
- switch (property) {
465
- case "currentValue":
466
- case "targetValue":
467
- case "duration":
468
- return (await this.get())?.[property];
469
- default:
470
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
471
- }
472
- };
473
- }
474
- };
475
- MultilevelSwitchCCAPI = __decorate([
476
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multilevel Switch"])
477
- ], MultilevelSwitchCCAPI);
478
- let MultilevelSwitchCC = class MultilevelSwitchCC2 extends import_CommandClass.CommandClass {
479
- async interview(ctx) {
480
- const node = this.getNode(ctx);
481
- const endpoint = this.getEndpoint(ctx);
482
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
483
- priority: import_safe.MessagePriority.NodeQuery
484
- });
485
- ctx.logNode(node.id, {
486
- endpoint: this.endpointIndex,
487
- message: `Interviewing ${this.ccName}...`,
488
- direction: "none"
489
- });
490
- if (api.version >= 3) {
523
+ return MultilevelSwitchCCAPI2 = _classThis;
524
+ })();
525
+ let MultilevelSwitchCC = (() => {
526
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multilevel Switch"]), (0, import_CommandClassDecorators.implementedVersion)(4), (0, import_CommandClassDecorators.ccValues)(MultilevelSwitchCCValues)];
527
+ let _classDescriptor;
528
+ let _classExtraInitializers = [];
529
+ let _classThis;
530
+ let _classSuper = import_CommandClass.CommandClass;
531
+ var MultilevelSwitchCC2 = class extends _classSuper {
532
+ static {
533
+ _classThis = this;
534
+ }
535
+ static {
536
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
537
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
538
+ MultilevelSwitchCC2 = _classThis = _classDescriptor.value;
539
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
540
+ __runInitializers(_classThis, _classExtraInitializers);
541
+ }
542
+ async interview(ctx) {
543
+ const node = this.getNode(ctx);
544
+ const endpoint = this.getEndpoint(ctx);
545
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
546
+ priority: import_safe.MessagePriority.NodeQuery
547
+ });
491
548
  ctx.logNode(node.id, {
492
549
  endpoint: this.endpointIndex,
493
- message: "requesting switch type...",
494
- direction: "outbound"
550
+ message: `Interviewing ${this.ccName}...`,
551
+ direction: "none"
495
552
  });
496
- const switchType = await api.getSupported();
497
- if (switchType != void 0) {
553
+ if (api.version >= 3) {
498
554
  ctx.logNode(node.id, {
499
555
  endpoint: this.endpointIndex,
500
- message: `has switch type ${(0, import_safe3.getEnumMemberName)(import_Types.SwitchType, switchType)}`,
501
- direction: "inbound"
556
+ message: "requesting switch type...",
557
+ direction: "outbound"
502
558
  });
559
+ const switchType = await api.getSupported();
560
+ if (switchType != void 0) {
561
+ ctx.logNode(node.id, {
562
+ endpoint: this.endpointIndex,
563
+ message: `has switch type ${(0, import_safe3.getEnumMemberName)(import_Types.SwitchType, switchType)}`,
564
+ direction: "inbound"
565
+ });
566
+ }
567
+ } else {
568
+ this.createMetadataForLevelChangeActions(ctx);
503
569
  }
504
- } else {
505
- this.createMetadataForLevelChangeActions(ctx);
570
+ await this.refreshValues(ctx);
571
+ this.setInterviewComplete(ctx, true);
506
572
  }
507
- await this.refreshValues(ctx);
508
- this.setInterviewComplete(ctx, true);
509
- }
510
- async refreshValues(ctx) {
511
- const node = this.getNode(ctx);
512
- const endpoint = this.getEndpoint(ctx);
513
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
514
- priority: import_safe.MessagePriority.NodeQuery
515
- });
516
- ctx.logNode(node.id, {
517
- endpoint: this.endpointIndex,
518
- message: "requesting current switch state...",
519
- direction: "outbound"
520
- });
521
- await api.get();
522
- }
523
- setMappedBasicValue(ctx, value) {
524
- this.setValue(ctx, MultilevelSwitchCCValues.currentValue, value);
525
- return true;
526
- }
527
- createMetadataForLevelChangeActions(ctx, switchType = import_Types.SwitchType["Down/Up"]) {
528
- this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeUp(switchType));
529
- this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeDown(switchType));
530
- }
531
- };
532
- MultilevelSwitchCC = __decorate([
533
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multilevel Switch"]),
534
- (0, import_CommandClassDecorators.implementedVersion)(4),
535
- (0, import_CommandClassDecorators.ccValues)(MultilevelSwitchCCValues)
536
- ], MultilevelSwitchCC);
537
- let MultilevelSwitchCCSet = MultilevelSwitchCCSet_1 = class MultilevelSwitchCCSet2 extends MultilevelSwitchCC {
538
- constructor(options) {
539
- super(options);
540
- this.targetValue = options.targetValue;
541
- this.duration = import_safe.Duration.from(options.duration);
542
- }
543
- static from(raw, ctx) {
544
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
545
- const targetValue = raw.payload[0];
546
- let duration;
547
- if (raw.payload.length >= 2) {
548
- duration = import_safe.Duration.parseReport(raw.payload[1]);
549
- }
550
- return new MultilevelSwitchCCSet_1({
551
- nodeId: ctx.sourceNodeId,
552
- targetValue,
553
- duration
554
- });
555
- }
556
- targetValue;
557
- duration;
558
- serialize(ctx) {
559
- this.payload = import_safe2.Bytes.from([
560
- this.targetValue,
561
- (this.duration ?? import_safe.Duration.default()).serializeSet()
562
- ]);
563
- const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
564
- if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
565
- this.payload = this.payload.subarray(0, 1);
566
- }
567
- return super.serialize(ctx);
568
- }
569
- toLogEntry(ctx) {
570
- const message = {
571
- "target value": this.targetValue
572
- };
573
- if (this.duration) {
574
- message.duration = this.duration.toString();
573
+ async refreshValues(ctx) {
574
+ const node = this.getNode(ctx);
575
+ const endpoint = this.getEndpoint(ctx);
576
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
577
+ priority: import_safe.MessagePriority.NodeQuery
578
+ });
579
+ ctx.logNode(node.id, {
580
+ endpoint: this.endpointIndex,
581
+ message: "requesting current switch state...",
582
+ direction: "outbound"
583
+ });
584
+ await api.get();
575
585
  }
576
- return {
577
- ...super.toLogEntry(ctx),
578
- message
579
- };
580
- }
581
- };
582
- MultilevelSwitchCCSet = MultilevelSwitchCCSet_1 = __decorate([
583
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Set),
584
- (0, import_CommandClassDecorators.useSupervision)()
585
- ], MultilevelSwitchCCSet);
586
- let MultilevelSwitchCCReport = MultilevelSwitchCCReport_1 = class MultilevelSwitchCCReport2 extends MultilevelSwitchCC {
587
- constructor(options) {
588
- super(options);
589
- this.currentValue = options.currentValue;
590
- this.targetValue = options.targetValue;
591
- this.duration = import_safe.Duration.from(options.duration);
592
- }
593
- static from(raw, ctx) {
594
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
595
- const currentValue = (
596
- // 0xff is a legacy value for 100% (99)
597
- raw.payload[0] === 255 ? 99 : (0, import_safe.parseMaybeNumber)(raw.payload[0])
598
- );
599
- let targetValue;
600
- let duration;
601
- if (raw.payload.length >= 3) {
602
- targetValue = (0, import_safe.parseMaybeNumber)(raw.payload[1]);
603
- duration = import_safe.Duration.parseReport(raw.payload[2]);
604
- }
605
- return new MultilevelSwitchCCReport_1({
606
- nodeId: ctx.sourceNodeId,
607
- currentValue,
608
- targetValue,
609
- duration
610
- });
611
- }
612
- targetValue;
613
- duration;
614
- currentValue;
615
- serialize(ctx) {
616
- this.payload = import_safe2.Bytes.from([
617
- this.currentValue ?? 254,
618
- this.targetValue ?? 254,
619
- (this.duration ?? import_safe.Duration.default()).serializeReport()
620
- ]);
621
- return super.serialize(ctx);
622
- }
623
- toLogEntry(ctx) {
624
- const message = {
625
- "current value": (0, import_safe.maybeUnknownToString)(this.currentValue)
626
- };
627
- if (this.targetValue !== import_safe.NOT_KNOWN && this.duration) {
628
- message["target value"] = (0, import_safe.maybeUnknownToString)(this.targetValue);
629
- message.duration = this.duration.toString();
586
+ setMappedBasicValue(ctx, value) {
587
+ this.setValue(ctx, MultilevelSwitchCCValues.currentValue, value);
588
+ return true;
630
589
  }
631
- return {
632
- ...super.toLogEntry(ctx),
633
- message
634
- };
635
- }
636
- };
637
- __decorate([
638
- (0, import_CommandClassDecorators.ccValue)(MultilevelSwitchCCValues.targetValue)
639
- ], MultilevelSwitchCCReport.prototype, "targetValue", void 0);
640
- __decorate([
641
- (0, import_CommandClassDecorators.ccValue)(MultilevelSwitchCCValues.duration)
642
- ], MultilevelSwitchCCReport.prototype, "duration", void 0);
643
- __decorate([
644
- (0, import_CommandClassDecorators.ccValue)(MultilevelSwitchCCValues.currentValue)
645
- ], MultilevelSwitchCCReport.prototype, "currentValue", void 0);
646
- MultilevelSwitchCCReport = MultilevelSwitchCCReport_1 = __decorate([
647
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Report)
648
- ], MultilevelSwitchCCReport);
649
- let MultilevelSwitchCCGet = class MultilevelSwitchCCGet2 extends MultilevelSwitchCC {
650
- };
651
- MultilevelSwitchCCGet = __decorate([
652
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Get),
653
- (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSwitchCCReport)
654
- ], MultilevelSwitchCCGet);
655
- let MultilevelSwitchCCStartLevelChange = MultilevelSwitchCCStartLevelChange_1 = class MultilevelSwitchCCStartLevelChange2 extends MultilevelSwitchCC {
656
- constructor(options) {
657
- super(options);
658
- this.duration = import_safe.Duration.from(options.duration);
659
- this.ignoreStartLevel = options.ignoreStartLevel;
660
- this.startLevel = options.startLevel ?? 0;
661
- this.direction = options.direction;
662
- }
663
- static from(raw, ctx) {
664
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
665
- const ignoreStartLevel = !!((raw.payload[0] & 32) >>> 5);
666
- const direction = (raw.payload[0] & 64) >>> 6 ? "down" : "up";
667
- const startLevel = raw.payload[1];
668
- let duration;
669
- if (raw.payload.length >= 3) {
670
- duration = import_safe.Duration.parseSet(raw.payload[2]);
671
- }
672
- return new MultilevelSwitchCCStartLevelChange_1({
673
- nodeId: ctx.sourceNodeId,
674
- ignoreStartLevel,
675
- direction,
676
- startLevel,
677
- duration
678
- });
679
- }
680
- duration;
681
- startLevel;
682
- ignoreStartLevel;
683
- direction;
684
- serialize(ctx) {
685
- const controlByte = import_Types.LevelChangeDirection[this.direction] << 6 | (this.ignoreStartLevel ? 32 : 0);
686
- this.payload = import_safe2.Bytes.from([
687
- controlByte,
688
- this.startLevel,
689
- (this.duration ?? import_safe.Duration.default()).serializeSet()
690
- ]);
691
- const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
692
- if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
693
- this.payload = this.payload.subarray(0, -1);
694
- }
695
- return super.serialize(ctx);
696
- }
697
- toLogEntry(ctx) {
698
- const message = {
699
- startLevel: `${this.startLevel}${this.ignoreStartLevel ? " (ignored)" : ""}`,
700
- direction: this.direction
701
- };
702
- if (this.duration) {
703
- message.duration = this.duration.toString();
590
+ createMetadataForLevelChangeActions(ctx, switchType = import_Types.SwitchType["Down/Up"]) {
591
+ this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeUp(switchType));
592
+ this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeDown(switchType));
704
593
  }
705
- return {
706
- ...super.toLogEntry(ctx),
707
- message
708
- };
709
- }
710
- };
711
- MultilevelSwitchCCStartLevelChange = MultilevelSwitchCCStartLevelChange_1 = __decorate([
712
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.StartLevelChange),
713
- (0, import_CommandClassDecorators.useSupervision)()
714
- ], MultilevelSwitchCCStartLevelChange);
715
- let MultilevelSwitchCCStopLevelChange = class MultilevelSwitchCCStopLevelChange2 extends MultilevelSwitchCC {
716
- };
717
- MultilevelSwitchCCStopLevelChange = __decorate([
718
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.StopLevelChange),
719
- (0, import_CommandClassDecorators.useSupervision)()
720
- ], MultilevelSwitchCCStopLevelChange);
721
- let MultilevelSwitchCCSupportedReport = MultilevelSwitchCCSupportedReport_1 = class MultilevelSwitchCCSupportedReport2 extends MultilevelSwitchCC {
722
- constructor(options) {
723
- super(options);
724
- this.switchType = options.switchType;
725
- }
726
- static from(raw, ctx) {
727
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
728
- const switchType = raw.payload[0] & 31;
729
- return new MultilevelSwitchCCSupportedReport_1({
730
- nodeId: ctx.sourceNodeId,
731
- switchType
732
- });
733
- }
734
- // This is the primary switch type. We're not supporting secondary switch types
735
- switchType;
736
- persistValues(ctx) {
737
- if (!super.persistValues(ctx))
738
- return false;
739
- this.createMetadataForLevelChangeActions(ctx, this.switchType);
740
- return true;
741
- }
742
- serialize(ctx) {
743
- this.payload = import_safe2.Bytes.from([this.switchType & 31]);
744
- return super.serialize(ctx);
745
- }
746
- toLogEntry(ctx) {
747
- return {
748
- ...super.toLogEntry(ctx),
749
- message: {
750
- "switch type": (0, import_safe3.getEnumMemberName)(import_Types.SwitchType, this.switchType)
594
+ };
595
+ return MultilevelSwitchCC2 = _classThis;
596
+ })();
597
+ let MultilevelSwitchCCSet = (() => {
598
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Set), (0, import_CommandClassDecorators.useSupervision)()];
599
+ let _classDescriptor;
600
+ let _classExtraInitializers = [];
601
+ let _classThis;
602
+ let _classSuper = MultilevelSwitchCC;
603
+ var MultilevelSwitchCCSet2 = class extends _classSuper {
604
+ static {
605
+ _classThis = this;
606
+ }
607
+ static {
608
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
609
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
610
+ MultilevelSwitchCCSet2 = _classThis = _classDescriptor.value;
611
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
612
+ __runInitializers(_classThis, _classExtraInitializers);
613
+ }
614
+ constructor(options) {
615
+ super(options);
616
+ this.targetValue = options.targetValue;
617
+ this.duration = import_safe.Duration.from(options.duration);
618
+ }
619
+ static from(raw, ctx) {
620
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
621
+ const targetValue = raw.payload[0];
622
+ let duration;
623
+ if (raw.payload.length >= 2) {
624
+ duration = import_safe.Duration.parseReport(raw.payload[1]);
751
625
  }
752
- };
753
- }
754
- };
755
- __decorate([
756
- (0, import_CommandClassDecorators.ccValue)(MultilevelSwitchCCValues.switchType)
757
- ], MultilevelSwitchCCSupportedReport.prototype, "switchType", void 0);
758
- MultilevelSwitchCCSupportedReport = MultilevelSwitchCCSupportedReport_1 = __decorate([
759
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.SupportedReport)
760
- ], MultilevelSwitchCCSupportedReport);
761
- let MultilevelSwitchCCSupportedGet = class MultilevelSwitchCCSupportedGet2 extends MultilevelSwitchCC {
762
- };
763
- MultilevelSwitchCCSupportedGet = __decorate([
764
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.SupportedGet),
765
- (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSwitchCCSupportedReport)
766
- ], MultilevelSwitchCCSupportedGet);
626
+ return new this({
627
+ nodeId: ctx.sourceNodeId,
628
+ targetValue,
629
+ duration
630
+ });
631
+ }
632
+ targetValue;
633
+ duration;
634
+ serialize(ctx) {
635
+ this.payload = import_safe2.Bytes.from([
636
+ this.targetValue,
637
+ (this.duration ?? import_safe.Duration.default()).serializeSet()
638
+ ]);
639
+ const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
640
+ if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
641
+ this.payload = this.payload.subarray(0, 1);
642
+ }
643
+ return super.serialize(ctx);
644
+ }
645
+ toLogEntry(ctx) {
646
+ const message = {
647
+ "target value": this.targetValue
648
+ };
649
+ if (this.duration) {
650
+ message.duration = this.duration.toString();
651
+ }
652
+ return {
653
+ ...super.toLogEntry(ctx),
654
+ message
655
+ };
656
+ }
657
+ };
658
+ return MultilevelSwitchCCSet2 = _classThis;
659
+ })();
660
+ let MultilevelSwitchCCReport = (() => {
661
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Report), (0, import_CommandClassDecorators.ccValueProperty)("targetValue", MultilevelSwitchCCValues.targetValue), (0, import_CommandClassDecorators.ccValueProperty)("duration", MultilevelSwitchCCValues.duration), (0, import_CommandClassDecorators.ccValueProperty)("currentValue", MultilevelSwitchCCValues.currentValue)];
662
+ let _classDescriptor;
663
+ let _classExtraInitializers = [];
664
+ let _classThis;
665
+ let _classSuper = MultilevelSwitchCC;
666
+ var MultilevelSwitchCCReport2 = class extends _classSuper {
667
+ static {
668
+ _classThis = this;
669
+ }
670
+ static {
671
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
672
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
673
+ MultilevelSwitchCCReport2 = _classThis = _classDescriptor.value;
674
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
675
+ __runInitializers(_classThis, _classExtraInitializers);
676
+ }
677
+ constructor(options) {
678
+ super(options);
679
+ this.currentValue = options.currentValue;
680
+ this.targetValue = options.targetValue;
681
+ this.duration = import_safe.Duration.from(options.duration);
682
+ }
683
+ static from(raw, ctx) {
684
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
685
+ const currentValue = (
686
+ // 0xff is a legacy value for 100% (99)
687
+ raw.payload[0] === 255 ? 99 : (0, import_safe.parseMaybeNumber)(raw.payload[0])
688
+ );
689
+ let targetValue;
690
+ let duration;
691
+ if (raw.payload.length >= 3) {
692
+ targetValue = (0, import_safe.parseMaybeNumber)(raw.payload[1]);
693
+ duration = import_safe.Duration.parseReport(raw.payload[2]);
694
+ }
695
+ return new this({
696
+ nodeId: ctx.sourceNodeId,
697
+ currentValue,
698
+ targetValue,
699
+ duration
700
+ });
701
+ }
702
+ targetValue;
703
+ duration;
704
+ currentValue;
705
+ serialize(ctx) {
706
+ this.payload = import_safe2.Bytes.from([
707
+ this.currentValue ?? 254,
708
+ this.targetValue ?? 254,
709
+ (this.duration ?? import_safe.Duration.default()).serializeReport()
710
+ ]);
711
+ return super.serialize(ctx);
712
+ }
713
+ toLogEntry(ctx) {
714
+ const message = {
715
+ "current value": (0, import_safe.maybeUnknownToString)(this.currentValue)
716
+ };
717
+ if (this.targetValue !== import_safe.NOT_KNOWN && this.duration) {
718
+ message["target value"] = (0, import_safe.maybeUnknownToString)(this.targetValue);
719
+ message.duration = this.duration.toString();
720
+ }
721
+ return {
722
+ ...super.toLogEntry(ctx),
723
+ message
724
+ };
725
+ }
726
+ };
727
+ return MultilevelSwitchCCReport2 = _classThis;
728
+ })();
729
+ let MultilevelSwitchCCGet = (() => {
730
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSwitchCCReport)];
731
+ let _classDescriptor;
732
+ let _classExtraInitializers = [];
733
+ let _classThis;
734
+ let _classSuper = MultilevelSwitchCC;
735
+ var MultilevelSwitchCCGet2 = class extends _classSuper {
736
+ static {
737
+ _classThis = this;
738
+ }
739
+ static {
740
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
741
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
742
+ MultilevelSwitchCCGet2 = _classThis = _classDescriptor.value;
743
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
744
+ __runInitializers(_classThis, _classExtraInitializers);
745
+ }
746
+ };
747
+ return MultilevelSwitchCCGet2 = _classThis;
748
+ })();
749
+ let MultilevelSwitchCCStartLevelChange = (() => {
750
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.StartLevelChange), (0, import_CommandClassDecorators.useSupervision)()];
751
+ let _classDescriptor;
752
+ let _classExtraInitializers = [];
753
+ let _classThis;
754
+ let _classSuper = MultilevelSwitchCC;
755
+ var MultilevelSwitchCCStartLevelChange2 = class extends _classSuper {
756
+ static {
757
+ _classThis = this;
758
+ }
759
+ static {
760
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
761
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
762
+ MultilevelSwitchCCStartLevelChange2 = _classThis = _classDescriptor.value;
763
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
764
+ __runInitializers(_classThis, _classExtraInitializers);
765
+ }
766
+ constructor(options) {
767
+ super(options);
768
+ this.duration = import_safe.Duration.from(options.duration);
769
+ this.ignoreStartLevel = options.ignoreStartLevel;
770
+ this.startLevel = options.startLevel ?? 0;
771
+ this.direction = options.direction;
772
+ }
773
+ static from(raw, ctx) {
774
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
775
+ const ignoreStartLevel = !!((raw.payload[0] & 32) >>> 5);
776
+ const direction = (raw.payload[0] & 64) >>> 6 ? "down" : "up";
777
+ const startLevel = raw.payload[1];
778
+ let duration;
779
+ if (raw.payload.length >= 3) {
780
+ duration = import_safe.Duration.parseSet(raw.payload[2]);
781
+ }
782
+ return new this({
783
+ nodeId: ctx.sourceNodeId,
784
+ ignoreStartLevel,
785
+ direction,
786
+ startLevel,
787
+ duration
788
+ });
789
+ }
790
+ duration;
791
+ startLevel;
792
+ ignoreStartLevel;
793
+ direction;
794
+ serialize(ctx) {
795
+ const controlByte = import_Types.LevelChangeDirection[this.direction] << 6 | (this.ignoreStartLevel ? 32 : 0);
796
+ this.payload = import_safe2.Bytes.from([
797
+ controlByte,
798
+ this.startLevel,
799
+ (this.duration ?? import_safe.Duration.default()).serializeSet()
800
+ ]);
801
+ const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
802
+ if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
803
+ this.payload = this.payload.subarray(0, -1);
804
+ }
805
+ return super.serialize(ctx);
806
+ }
807
+ toLogEntry(ctx) {
808
+ const message = {
809
+ startLevel: `${this.startLevel}${this.ignoreStartLevel ? " (ignored)" : ""}`,
810
+ direction: this.direction
811
+ };
812
+ if (this.duration) {
813
+ message.duration = this.duration.toString();
814
+ }
815
+ return {
816
+ ...super.toLogEntry(ctx),
817
+ message
818
+ };
819
+ }
820
+ };
821
+ return MultilevelSwitchCCStartLevelChange2 = _classThis;
822
+ })();
823
+ let MultilevelSwitchCCStopLevelChange = (() => {
824
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.StopLevelChange), (0, import_CommandClassDecorators.useSupervision)()];
825
+ let _classDescriptor;
826
+ let _classExtraInitializers = [];
827
+ let _classThis;
828
+ let _classSuper = MultilevelSwitchCC;
829
+ var MultilevelSwitchCCStopLevelChange2 = class extends _classSuper {
830
+ static {
831
+ _classThis = this;
832
+ }
833
+ static {
834
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
835
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
836
+ MultilevelSwitchCCStopLevelChange2 = _classThis = _classDescriptor.value;
837
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
838
+ __runInitializers(_classThis, _classExtraInitializers);
839
+ }
840
+ };
841
+ return MultilevelSwitchCCStopLevelChange2 = _classThis;
842
+ })();
843
+ let MultilevelSwitchCCSupportedReport = (() => {
844
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.SupportedReport), (0, import_CommandClassDecorators.ccValueProperty)("switchType", MultilevelSwitchCCValues.switchType)];
845
+ let _classDescriptor;
846
+ let _classExtraInitializers = [];
847
+ let _classThis;
848
+ let _classSuper = MultilevelSwitchCC;
849
+ var MultilevelSwitchCCSupportedReport2 = class extends _classSuper {
850
+ static {
851
+ _classThis = this;
852
+ }
853
+ static {
854
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
855
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
856
+ MultilevelSwitchCCSupportedReport2 = _classThis = _classDescriptor.value;
857
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
858
+ __runInitializers(_classThis, _classExtraInitializers);
859
+ }
860
+ constructor(options) {
861
+ super(options);
862
+ this.switchType = options.switchType;
863
+ }
864
+ static from(raw, ctx) {
865
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
866
+ const switchType = raw.payload[0] & 31;
867
+ return new this({
868
+ nodeId: ctx.sourceNodeId,
869
+ switchType
870
+ });
871
+ }
872
+ // This is the primary switch type. We're not supporting secondary switch types
873
+ switchType;
874
+ persistValues(ctx) {
875
+ if (!super.persistValues(ctx))
876
+ return false;
877
+ this.createMetadataForLevelChangeActions(ctx, this.switchType);
878
+ return true;
879
+ }
880
+ serialize(ctx) {
881
+ this.payload = import_safe2.Bytes.from([this.switchType & 31]);
882
+ return super.serialize(ctx);
883
+ }
884
+ toLogEntry(ctx) {
885
+ return {
886
+ ...super.toLogEntry(ctx),
887
+ message: {
888
+ "switch type": (0, import_safe3.getEnumMemberName)(import_Types.SwitchType, this.switchType)
889
+ }
890
+ };
891
+ }
892
+ };
893
+ return MultilevelSwitchCCSupportedReport2 = _classThis;
894
+ })();
895
+ let MultilevelSwitchCCSupportedGet = (() => {
896
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.SupportedGet), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSwitchCCSupportedReport)];
897
+ let _classDescriptor;
898
+ let _classExtraInitializers = [];
899
+ let _classThis;
900
+ let _classSuper = MultilevelSwitchCC;
901
+ var MultilevelSwitchCCSupportedGet2 = class extends _classSuper {
902
+ static {
903
+ _classThis = this;
904
+ }
905
+ static {
906
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
907
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
908
+ MultilevelSwitchCCSupportedGet2 = _classThis = _classDescriptor.value;
909
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
910
+ __runInitializers(_classThis, _classExtraInitializers);
911
+ }
912
+ };
913
+ return MultilevelSwitchCCSupportedGet2 = _classThis;
914
+ })();
767
915
  // Annotate the CommonJS export names for ESM import in node:
768
916
  0 && (module.exports = {
769
917
  MultilevelSwitchCC,