@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 WindowCoveringCCSupportedReport_1, WindowCoveringCCReport_1, WindowCoveringCCGet_1, WindowCoveringCCSet_1, WindowCoveringCCStartLevelChange_1, WindowCoveringCCStopLevelChange_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -104,7 +131,7 @@ import { Bytes } from "@zwave-js/shared/safe";
104
131
  import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
105
132
  import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from "../lib/API.js";
106
133
  import { CommandClass, } from "../lib/CommandClass.js";
107
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
134
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
108
135
  import { V } from "../lib/Values.js";
109
136
  import { WindowCoveringCommand, WindowCoveringParameter, } from "../lib/_Types.js";
110
137
  function parameterToMetadataStates(parameter) {
@@ -210,571 +237,669 @@ export const WindowCoveringCCValues = Object.freeze({
210
237
  }),
211
238
  }),
212
239
  });
213
- let WindowCoveringCCAPI = class WindowCoveringCCAPI extends CCAPI {
214
- supportsCommand(cmd) {
215
- switch (cmd) {
216
- case WindowCoveringCommand.Get:
217
- case WindowCoveringCommand.Set:
218
- case WindowCoveringCommand.SupportedGet:
219
- case WindowCoveringCommand.StartLevelChange:
220
- case WindowCoveringCommand.StopLevelChange:
221
- return true; // This is mandatory
222
- }
223
- return super.supportsCommand(cmd);
224
- }
225
- get [SET_VALUE]() {
226
- return async function ({ property, propertyKey }, value, options) {
240
+ let WindowCoveringCCAPI = (() => {
241
+ let _classDecorators = [API(CommandClasses["Window Covering"])];
242
+ let _classDescriptor;
243
+ let _classExtraInitializers = [];
244
+ let _classThis;
245
+ let _classSuper = CCAPI;
246
+ var WindowCoveringCCAPI = class extends _classSuper {
247
+ static { _classThis = this; }
248
+ static {
249
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
250
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
251
+ WindowCoveringCCAPI = _classThis = _classDescriptor.value;
252
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
253
+ __runInitializers(_classThis, _classExtraInitializers);
254
+ }
255
+ supportsCommand(cmd) {
256
+ switch (cmd) {
257
+ case WindowCoveringCommand.Get:
258
+ case WindowCoveringCommand.Set:
259
+ case WindowCoveringCommand.SupportedGet:
260
+ case WindowCoveringCommand.StartLevelChange:
261
+ case WindowCoveringCommand.StopLevelChange:
262
+ return true; // This is mandatory
263
+ }
264
+ return super.supportsCommand(cmd);
265
+ }
266
+ get [SET_VALUE]() {
267
+ return async function ({ property, propertyKey }, value, options) {
268
+ const valueId = {
269
+ commandClass: this.ccId,
270
+ property,
271
+ propertyKey,
272
+ };
273
+ if (WindowCoveringCCValues.targetValue.is(valueId)) {
274
+ if (typeof propertyKey !== "number"
275
+ // Only odd-numbered parameters have position support and are writable
276
+ || propertyKey % 2 === 0) {
277
+ throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
278
+ }
279
+ if (typeof value !== "number") {
280
+ throwWrongValueType(this.ccId, property, "number", typeof value);
281
+ }
282
+ const parameter = propertyKey;
283
+ const duration = Duration.from(options?.transitionDuration);
284
+ return this.set([{ parameter, value }], duration);
285
+ }
286
+ else if (WindowCoveringCCValues.levelChangeUp.is(valueId)
287
+ || WindowCoveringCCValues.levelChangeDown.is(valueId)) {
288
+ if (typeof value !== "boolean") {
289
+ throwWrongValueType(this.ccId, property, "boolean", typeof value);
290
+ }
291
+ const parameter = propertyKey;
292
+ const direction = WindowCoveringCCValues.levelChangeUp.is(valueId)
293
+ ? "up"
294
+ : "down";
295
+ if (value) {
296
+ // Perform the level change
297
+ const duration = Duration.from(options?.transitionDuration);
298
+ return this.startLevelChange(parameter, direction, duration);
299
+ }
300
+ else {
301
+ return this.stopLevelChange(parameter);
302
+ }
303
+ }
304
+ else {
305
+ throwUnsupportedProperty(this.ccId, property);
306
+ }
307
+ };
308
+ }
309
+ [SET_VALUE_HOOKS] = ({ property, propertyKey }, value, options) => {
227
310
  const valueId = {
228
311
  commandClass: this.ccId,
229
312
  property,
230
313
  propertyKey,
231
314
  };
232
315
  if (WindowCoveringCCValues.targetValue.is(valueId)) {
233
- if (typeof propertyKey !== "number"
234
- // Only odd-numbered parameters have position support and are writable
235
- || propertyKey % 2 === 0) {
236
- throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
237
- }
238
- if (typeof value !== "number") {
239
- throwWrongValueType(this.ccId, property, "number", typeof value);
240
- }
316
+ if (typeof propertyKey !== "number")
317
+ return;
241
318
  const parameter = propertyKey;
242
319
  const duration = Duration.from(options?.transitionDuration);
243
- return this.set([{ parameter, value }], duration);
244
- }
245
- else if (WindowCoveringCCValues.levelChangeUp.is(valueId)
246
- || WindowCoveringCCValues.levelChangeDown.is(valueId)) {
247
- if (typeof value !== "boolean") {
248
- throwWrongValueType(this.ccId, property, "boolean", typeof value);
249
- }
250
- const parameter = propertyKey;
251
- const direction = WindowCoveringCCValues.levelChangeUp.is(valueId)
252
- ? "up"
253
- : "down";
254
- if (value) {
255
- // Perform the level change
256
- const duration = Duration.from(options?.transitionDuration);
257
- return this.startLevelChange(parameter, direction, duration);
258
- }
259
- else {
260
- return this.stopLevelChange(parameter);
261
- }
262
- }
263
- else {
264
- throwUnsupportedProperty(this.ccId, property);
265
- }
266
- };
267
- }
268
- [SET_VALUE_HOOKS] = ({ property, propertyKey }, value, options) => {
269
- const valueId = {
270
- commandClass: this.ccId,
271
- property,
272
- propertyKey,
273
- };
274
- if (WindowCoveringCCValues.targetValue.is(valueId)) {
275
- if (typeof propertyKey !== "number")
276
- return;
277
- const parameter = propertyKey;
278
- const duration = Duration.from(options?.transitionDuration);
279
- const currentValueValueId = WindowCoveringCCValues.currentValue(parameter).endpoint(this.endpoint.index);
280
- return {
281
- // Window Covering commands may take some time to be executed.
282
- // Therefore we try to supervise the command execution and delay the
283
- // optimistic update until the final result is received.
284
- supervisionDelayedUpdates: true,
285
- supervisionOnSuccess: async () => {
286
- // Only update currentValue for valid target values
287
- if (typeof value === "number"
288
- && value >= 0
289
- && value <= 99) {
290
- this.tryGetValueDB()?.setValue(currentValueValueId, value);
291
- }
292
- else if (value === 255) {
293
- // We don't know the status now, so refresh the current value
320
+ const currentValueValueId = WindowCoveringCCValues.currentValue(parameter).endpoint(this.endpoint.index);
321
+ return {
322
+ // Window Covering commands may take some time to be executed.
323
+ // Therefore we try to supervise the command execution and delay the
324
+ // optimistic update until the final result is received.
325
+ supervisionDelayedUpdates: true,
326
+ supervisionOnSuccess: async () => {
327
+ // Only update currentValue for valid target values
328
+ if (typeof value === "number"
329
+ && value >= 0
330
+ && value <= 99) {
331
+ this.tryGetValueDB()?.setValue(currentValueValueId, value);
332
+ }
333
+ else if (value === 255) {
334
+ // We don't know the status now, so refresh the current value
335
+ try {
336
+ await this.get(parameter);
337
+ }
338
+ catch {
339
+ // ignore
340
+ }
341
+ }
342
+ },
343
+ supervisionOnFailure: async () => {
344
+ // The transition failed, so now we don't know the status - refresh the current value
294
345
  try {
295
346
  await this.get(parameter);
296
347
  }
297
348
  catch {
298
349
  // ignore
299
350
  }
300
- }
301
- },
302
- supervisionOnFailure: async () => {
303
- // The transition failed, so now we don't know the status - refresh the current value
304
- try {
305
- await this.get(parameter);
306
- }
307
- catch {
308
- // ignore
309
- }
310
- },
311
- optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
312
- // Only update currentValue for valid target values
313
- if (typeof value === "number"
314
- && value >= 0
315
- && value <= 99) {
351
+ },
352
+ optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
353
+ // Only update currentValue for valid target values
354
+ if (typeof value === "number"
355
+ && value >= 0
356
+ && value <= 99) {
357
+ if (this.isSinglecast()) {
358
+ this.tryGetValueDB()?.setValue(currentValueValueId, value);
359
+ }
360
+ else if (this.isMulticast()) {
361
+ // Figure out which nodes were affected by this command
362
+ const affectedNodes = this.endpoint.node
363
+ .physicalNodes.filter((node) => node
364
+ .getEndpoint(this.endpoint.index)
365
+ ?.supportsCC(this.ccId));
366
+ // and optimistically update the currentValue
367
+ for (const node of affectedNodes) {
368
+ this.host
369
+ .tryGetValueDB(node.id)
370
+ ?.setValue(currentValueValueId, value);
371
+ }
372
+ }
373
+ }
374
+ },
375
+ verifyChanges: () => {
316
376
  if (this.isSinglecast()) {
317
- this.tryGetValueDB()?.setValue(currentValueValueId, value);
377
+ // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
378
+ this.schedulePoll(currentValueValueId, value, {
379
+ duration,
380
+ });
318
381
  }
319
- else if (this.isMulticast()) {
320
- // Figure out which nodes were affected by this command
321
- const affectedNodes = this.endpoint.node
322
- .physicalNodes.filter((node) => node
323
- .getEndpoint(this.endpoint.index)
324
- ?.supportsCC(this.ccId));
325
- // and optimistically update the currentValue
326
- for (const node of affectedNodes) {
327
- this.host
328
- .tryGetValueDB(node.id)
329
- ?.setValue(currentValueValueId, value);
330
- }
382
+ else {
383
+ // For multicasts, do not schedule a refresh - this could cause a LOT of traffic
331
384
  }
332
- }
333
- },
334
- verifyChanges: () => {
335
- if (this.isSinglecast()) {
336
- // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
337
- this.schedulePoll(currentValueValueId, value, {
338
- duration,
339
- });
340
- }
341
- else {
342
- // For multicasts, do not schedule a refresh - this could cause a LOT of traffic
343
- }
344
- },
385
+ },
386
+ };
387
+ }
388
+ };
389
+ get [POLL_VALUE]() {
390
+ return async function ({ property, propertyKey }) {
391
+ switch (property) {
392
+ case "currentValue":
393
+ case "targetValue":
394
+ case "duration":
395
+ if (propertyKey == undefined) {
396
+ throwMissingPropertyKey(this.ccId, property);
397
+ }
398
+ else if (typeof propertyKey !== "number") {
399
+ throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
400
+ }
401
+ return (await this.get(propertyKey))?.[property];
402
+ default:
403
+ throwUnsupportedProperty(this.ccId, property);
404
+ }
345
405
  };
346
406
  }
347
- };
348
- get [POLL_VALUE]() {
349
- return async function ({ property, propertyKey }) {
350
- switch (property) {
351
- case "currentValue":
352
- case "targetValue":
353
- case "duration":
354
- if (propertyKey == undefined) {
355
- throwMissingPropertyKey(this.ccId, property);
356
- }
357
- else if (typeof propertyKey !== "number") {
358
- throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
359
- }
360
- return (await this.get(propertyKey))?.[property];
361
- default:
362
- throwUnsupportedProperty(this.ccId, property);
407
+ async getSupported() {
408
+ this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.SupportedGet);
409
+ const cc = new WindowCoveringCCSupportedGet({
410
+ nodeId: this.endpoint.nodeId,
411
+ endpointIndex: this.endpoint.index,
412
+ });
413
+ const response = await this.host.sendCommand(cc, this.commandOptions);
414
+ return response?.supportedParameters;
415
+ }
416
+ async get(parameter) {
417
+ __assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
418
+ this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.Get);
419
+ const cc = new WindowCoveringCCGet({
420
+ nodeId: this.endpoint.nodeId,
421
+ endpointIndex: this.endpoint.index,
422
+ parameter,
423
+ });
424
+ const response = await this.host.sendCommand(cc, this.commandOptions);
425
+ if (response) {
426
+ return pick(response, ["currentValue", "targetValue", "duration"]);
363
427
  }
364
- };
365
- }
366
- async getSupported() {
367
- this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.SupportedGet);
368
- const cc = new WindowCoveringCCSupportedGet({
369
- nodeId: this.endpoint.nodeId,
370
- endpointIndex: this.endpoint.index,
371
- });
372
- const response = await this.host.sendCommand(cc, this.commandOptions);
373
- return response?.supportedParameters;
374
- }
375
- async get(parameter) {
376
- __assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
377
- this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.Get);
378
- const cc = new WindowCoveringCCGet({
379
- nodeId: this.endpoint.nodeId,
380
- endpointIndex: this.endpoint.index,
381
- parameter,
382
- });
383
- const response = await this.host.sendCommand(cc, this.commandOptions);
384
- if (response) {
385
- return pick(response, ["currentValue", "targetValue", "duration"]);
386
428
  }
387
- }
388
- async set(targetValues, duration) {
389
- __assertType("targetValues", undefined, __assertType__sa__2_ea_2.bind(void 0, targetValues));
390
- __assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
391
- this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);
392
- const cc = new WindowCoveringCCSet({
393
- nodeId: this.endpoint.nodeId,
394
- endpointIndex: this.endpoint.index,
395
- targetValues,
396
- duration,
397
- });
398
- return this.host.sendCommand(cc, this.commandOptions);
399
- }
400
- async startLevelChange(parameter, direction, duration) {
401
- __assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
402
- __assertType("direction", undefined, __assertType__su__1__2_eu.bind(void 0, direction));
403
- __assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
404
- this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);
405
- const cc = new WindowCoveringCCStartLevelChange({
406
- nodeId: this.endpoint.nodeId,
407
- endpointIndex: this.endpoint.index,
408
- parameter,
409
- direction,
410
- duration,
411
- });
412
- return this.host.sendCommand(cc, this.commandOptions);
413
- }
414
- async stopLevelChange(parameter) {
415
- __assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
416
- this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StopLevelChange);
417
- const cc = new WindowCoveringCCStopLevelChange({
418
- nodeId: this.endpoint.nodeId,
419
- endpointIndex: this.endpoint.index,
420
- parameter,
421
- });
422
- return this.host.sendCommand(cc, this.commandOptions);
423
- }
424
- };
425
- WindowCoveringCCAPI = __decorate([
426
- API(CommandClasses["Window Covering"])
427
- ], WindowCoveringCCAPI);
429
+ async set(targetValues, duration) {
430
+ __assertType("targetValues", undefined, __assertType__sa__2_ea_2.bind(void 0, targetValues));
431
+ __assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
432
+ this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);
433
+ const cc = new WindowCoveringCCSet({
434
+ nodeId: this.endpoint.nodeId,
435
+ endpointIndex: this.endpoint.index,
436
+ targetValues,
437
+ duration,
438
+ });
439
+ return this.host.sendCommand(cc, this.commandOptions);
440
+ }
441
+ async startLevelChange(parameter, direction, duration) {
442
+ __assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
443
+ __assertType("direction", undefined, __assertType__su__1__2_eu.bind(void 0, direction));
444
+ __assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
445
+ this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);
446
+ const cc = new WindowCoveringCCStartLevelChange({
447
+ nodeId: this.endpoint.nodeId,
448
+ endpointIndex: this.endpoint.index,
449
+ parameter,
450
+ direction,
451
+ duration,
452
+ });
453
+ return this.host.sendCommand(cc, this.commandOptions);
454
+ }
455
+ async stopLevelChange(parameter) {
456
+ __assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
457
+ this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StopLevelChange);
458
+ const cc = new WindowCoveringCCStopLevelChange({
459
+ nodeId: this.endpoint.nodeId,
460
+ endpointIndex: this.endpoint.index,
461
+ parameter,
462
+ });
463
+ return this.host.sendCommand(cc, this.commandOptions);
464
+ }
465
+ };
466
+ return WindowCoveringCCAPI = _classThis;
467
+ })();
428
468
  export { WindowCoveringCCAPI };
429
- let WindowCoveringCC = class WindowCoveringCC extends CommandClass {
430
- async interview(ctx) {
431
- const node = this.getNode(ctx);
432
- const endpoint = this.getEndpoint(ctx);
433
- const api = CCAPI.create(CommandClasses["Window Covering"], ctx, endpoint).withOptions({
434
- priority: MessagePriority.NodeQuery,
435
- });
436
- ctx.logNode(node.id, {
437
- endpoint: this.endpointIndex,
438
- message: `Interviewing ${this.ccName}...`,
439
- direction: "none",
440
- });
441
- ctx.logNode(node.id, {
442
- endpoint: this.endpointIndex,
443
- message: "querying supported window covering parameters...",
444
- direction: "outbound",
445
- });
446
- const supported = await api.getSupported();
447
- if (supported?.length) {
448
- const logMessage = `supported window covering parameters:
449
- ${supported
450
- .map((p) => `· ${getEnumMemberName(WindowCoveringParameter, p)}`)
451
- .join("\n")}`;
469
+ let WindowCoveringCC = (() => {
470
+ let _classDecorators = [commandClass(CommandClasses["Window Covering"]), implementedVersion(1), ccValues(WindowCoveringCCValues)];
471
+ let _classDescriptor;
472
+ let _classExtraInitializers = [];
473
+ let _classThis;
474
+ let _classSuper = CommandClass;
475
+ var WindowCoveringCC = class extends _classSuper {
476
+ static { _classThis = this; }
477
+ static {
478
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
479
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
480
+ WindowCoveringCC = _classThis = _classDescriptor.value;
481
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
482
+ __runInitializers(_classThis, _classExtraInitializers);
483
+ }
484
+ async interview(ctx) {
485
+ const node = this.getNode(ctx);
486
+ const endpoint = this.getEndpoint(ctx);
487
+ const api = CCAPI.create(CommandClasses["Window Covering"], ctx, endpoint).withOptions({
488
+ priority: MessagePriority.NodeQuery,
489
+ });
452
490
  ctx.logNode(node.id, {
453
491
  endpoint: this.endpointIndex,
454
- message: logMessage,
455
- direction: "inbound",
492
+ message: `Interviewing ${this.ccName}...`,
493
+ direction: "none",
456
494
  });
457
- // Create metadata for all supported parameters
458
- for (const param of supported) {
459
- // Default values
460
- this.setMetadata(ctx, WindowCoveringCCValues.currentValue(param));
461
- this.setMetadata(ctx, WindowCoveringCCValues.targetValue(param));
462
- this.setMetadata(ctx, WindowCoveringCCValues.duration(param));
463
- // Level change values
464
- this.setMetadata(ctx, WindowCoveringCCValues.levelChangeUp(param));
465
- this.setMetadata(ctx, WindowCoveringCCValues.levelChangeDown(param));
466
- // And for the odd parameters (with position support), query the position
467
- if (param % 2 === 1) {
468
- ctx.logNode(node.id, {
469
- endpoint: this.endpointIndex,
470
- message: `querying position for parameter ${getEnumMemberName(WindowCoveringParameter, param)}...`,
471
- direction: "outbound",
472
- });
473
- await api.get(param);
495
+ ctx.logNode(node.id, {
496
+ endpoint: this.endpointIndex,
497
+ message: "querying supported window covering parameters...",
498
+ direction: "outbound",
499
+ });
500
+ const supported = await api.getSupported();
501
+ if (supported?.length) {
502
+ const logMessage = `supported window covering parameters:
503
+ ${supported
504
+ .map((p) => `· ${getEnumMemberName(WindowCoveringParameter, p)}`)
505
+ .join("\n")}`;
506
+ ctx.logNode(node.id, {
507
+ endpoint: this.endpointIndex,
508
+ message: logMessage,
509
+ direction: "inbound",
510
+ });
511
+ // Create metadata for all supported parameters
512
+ for (const param of supported) {
513
+ // Default values
514
+ this.setMetadata(ctx, WindowCoveringCCValues.currentValue(param));
515
+ this.setMetadata(ctx, WindowCoveringCCValues.targetValue(param));
516
+ this.setMetadata(ctx, WindowCoveringCCValues.duration(param));
517
+ // Level change values
518
+ this.setMetadata(ctx, WindowCoveringCCValues.levelChangeUp(param));
519
+ this.setMetadata(ctx, WindowCoveringCCValues.levelChangeDown(param));
520
+ // And for the odd parameters (with position support), query the position
521
+ if (param % 2 === 1) {
522
+ ctx.logNode(node.id, {
523
+ endpoint: this.endpointIndex,
524
+ message: `querying position for parameter ${getEnumMemberName(WindowCoveringParameter, param)}...`,
525
+ direction: "outbound",
526
+ });
527
+ await api.get(param);
528
+ }
474
529
  }
475
530
  }
531
+ // Remember that the interview is complete
532
+ this.setInterviewComplete(ctx, true);
476
533
  }
477
- // Remember that the interview is complete
478
- this.setInterviewComplete(ctx, true);
479
- }
480
- translatePropertyKey(ctx, property, propertyKey) {
481
- if (typeof propertyKey === "number") {
482
- return getEnumMemberName(WindowCoveringParameter, propertyKey);
534
+ translatePropertyKey(ctx, property, propertyKey) {
535
+ if (typeof propertyKey === "number") {
536
+ return getEnumMemberName(WindowCoveringParameter, propertyKey);
537
+ }
538
+ return super.translatePropertyKey(ctx, property, propertyKey);
483
539
  }
484
- return super.translatePropertyKey(ctx, property, propertyKey);
485
- }
486
- };
487
- WindowCoveringCC = __decorate([
488
- commandClass(CommandClasses["Window Covering"]),
489
- implementedVersion(1),
490
- ccValues(WindowCoveringCCValues)
491
- ], WindowCoveringCC);
540
+ };
541
+ return WindowCoveringCC = _classThis;
542
+ })();
492
543
  export { WindowCoveringCC };
493
- let WindowCoveringCCSupportedReport = WindowCoveringCCSupportedReport_1 = class WindowCoveringCCSupportedReport extends WindowCoveringCC {
494
- constructor(options) {
495
- super(options);
496
- this.supportedParameters = options.supportedParameters;
497
- }
498
- static from(raw, ctx) {
499
- validatePayload(raw.payload.length >= 1);
500
- const numBitmaskBytes = raw.payload[0] & 0b1111;
501
- validatePayload(raw.payload.length >= 1 + numBitmaskBytes);
502
- const bitmask = raw.payload.subarray(1, 1 + numBitmaskBytes);
503
- const supportedParameters = parseBitMask(bitmask, WindowCoveringParameter["Outbound Left (no position)"]);
504
- return new WindowCoveringCCSupportedReport_1({
505
- nodeId: ctx.sourceNodeId,
506
- supportedParameters,
507
- });
508
- }
509
- supportedParameters;
510
- serialize(ctx) {
511
- const bitmask = encodeBitMask(this.supportedParameters, undefined, WindowCoveringParameter["Outbound Left (no position)"]).subarray(0, 15);
512
- const numBitmaskBytes = bitmask.length & 0b1111;
513
- this.payload = Bytes.concat([
514
- Bytes.from([numBitmaskBytes]),
515
- bitmask.subarray(0, numBitmaskBytes),
516
- ]);
517
- return super.serialize(ctx);
518
- }
519
- toLogEntry(ctx) {
520
- return {
521
- ...super.toLogEntry(ctx),
522
- message: {
523
- "supported parameters": this.supportedParameters
524
- .map((p) => `\n· ${getEnumMemberName(WindowCoveringParameter, p)}`)
525
- .join(""),
526
- },
527
- };
528
- }
529
- };
530
- __decorate([
531
- ccValue(WindowCoveringCCValues.supportedParameters)
532
- ], WindowCoveringCCSupportedReport.prototype, "supportedParameters", void 0);
533
- WindowCoveringCCSupportedReport = WindowCoveringCCSupportedReport_1 = __decorate([
534
- CCCommand(WindowCoveringCommand.SupportedReport)
535
- ], WindowCoveringCCSupportedReport);
544
+ let WindowCoveringCCSupportedReport = (() => {
545
+ let _classDecorators = [CCCommand(WindowCoveringCommand.SupportedReport), ccValueProperty("supportedParameters", WindowCoveringCCValues.supportedParameters)];
546
+ let _classDescriptor;
547
+ let _classExtraInitializers = [];
548
+ let _classThis;
549
+ let _classSuper = WindowCoveringCC;
550
+ var WindowCoveringCCSupportedReport = class extends _classSuper {
551
+ static { _classThis = this; }
552
+ static {
553
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
554
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
555
+ WindowCoveringCCSupportedReport = _classThis = _classDescriptor.value;
556
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
557
+ __runInitializers(_classThis, _classExtraInitializers);
558
+ }
559
+ constructor(options) {
560
+ super(options);
561
+ this.supportedParameters = options.supportedParameters;
562
+ }
563
+ static from(raw, ctx) {
564
+ validatePayload(raw.payload.length >= 1);
565
+ const numBitmaskBytes = raw.payload[0] & 0b1111;
566
+ validatePayload(raw.payload.length >= 1 + numBitmaskBytes);
567
+ const bitmask = raw.payload.subarray(1, 1 + numBitmaskBytes);
568
+ const supportedParameters = parseBitMask(bitmask, WindowCoveringParameter["Outbound Left (no position)"]);
569
+ return new this({
570
+ nodeId: ctx.sourceNodeId,
571
+ supportedParameters,
572
+ });
573
+ }
574
+ supportedParameters;
575
+ serialize(ctx) {
576
+ const bitmask = encodeBitMask(this.supportedParameters, undefined, WindowCoveringParameter["Outbound Left (no position)"]).subarray(0, 15);
577
+ const numBitmaskBytes = bitmask.length & 0b1111;
578
+ this.payload = Bytes.concat([
579
+ Bytes.from([numBitmaskBytes]),
580
+ bitmask.subarray(0, numBitmaskBytes),
581
+ ]);
582
+ return super.serialize(ctx);
583
+ }
584
+ toLogEntry(ctx) {
585
+ return {
586
+ ...super.toLogEntry(ctx),
587
+ message: {
588
+ "supported parameters": this.supportedParameters
589
+ .map((p) => `\n· ${getEnumMemberName(WindowCoveringParameter, p)}`)
590
+ .join(""),
591
+ },
592
+ };
593
+ }
594
+ };
595
+ return WindowCoveringCCSupportedReport = _classThis;
596
+ })();
536
597
  export { WindowCoveringCCSupportedReport };
537
- let WindowCoveringCCSupportedGet = class WindowCoveringCCSupportedGet extends WindowCoveringCC {
538
- };
539
- WindowCoveringCCSupportedGet = __decorate([
540
- CCCommand(WindowCoveringCommand.SupportedGet),
541
- expectedCCResponse(WindowCoveringCCSupportedReport)
542
- ], WindowCoveringCCSupportedGet);
598
+ let WindowCoveringCCSupportedGet = (() => {
599
+ let _classDecorators = [CCCommand(WindowCoveringCommand.SupportedGet), expectedCCResponse(WindowCoveringCCSupportedReport)];
600
+ let _classDescriptor;
601
+ let _classExtraInitializers = [];
602
+ let _classThis;
603
+ let _classSuper = WindowCoveringCC;
604
+ var WindowCoveringCCSupportedGet = class extends _classSuper {
605
+ static { _classThis = this; }
606
+ static {
607
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
608
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
609
+ WindowCoveringCCSupportedGet = _classThis = _classDescriptor.value;
610
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
611
+ __runInitializers(_classThis, _classExtraInitializers);
612
+ }
613
+ };
614
+ return WindowCoveringCCSupportedGet = _classThis;
615
+ })();
543
616
  export { WindowCoveringCCSupportedGet };
544
- let WindowCoveringCCReport = WindowCoveringCCReport_1 = class WindowCoveringCCReport extends WindowCoveringCC {
545
- constructor(options) {
546
- super(options);
547
- // TODO: Check implementation:
548
- this.parameter = options.parameter;
549
- this.currentValue = options.currentValue;
550
- this.targetValue = options.targetValue;
551
- this.duration = options.duration;
552
- }
553
- static from(raw, ctx) {
554
- validatePayload(raw.payload.length >= 4);
555
- const parameter = raw.payload[0];
556
- const currentValue = raw.payload[1];
557
- const targetValue = raw.payload[2];
558
- const duration = Duration.parseReport(raw.payload[3])
559
- ?? Duration.unknown();
560
- return new WindowCoveringCCReport_1({
561
- nodeId: ctx.sourceNodeId,
562
- parameter,
563
- currentValue,
564
- targetValue,
565
- duration,
566
- });
567
- }
568
- parameter;
569
- currentValue;
570
- targetValue;
571
- duration;
572
- toLogEntry(ctx) {
573
- return {
574
- ...super.toLogEntry(ctx),
575
- message: {
576
- parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
577
- "current value": this.currentValue,
578
- "target value": this.targetValue,
579
- duration: this.duration.toString(),
580
- },
581
- };
582
- }
583
- };
584
- __decorate([
585
- ccValue(WindowCoveringCCValues.currentValue, (self) => [self.parameter])
586
- ], WindowCoveringCCReport.prototype, "currentValue", void 0);
587
- __decorate([
588
- ccValue(WindowCoveringCCValues.targetValue, (self) => [self.parameter])
589
- ], WindowCoveringCCReport.prototype, "targetValue", void 0);
590
- __decorate([
591
- ccValue(WindowCoveringCCValues.duration, (self) => [self.parameter])
592
- ], WindowCoveringCCReport.prototype, "duration", void 0);
593
- WindowCoveringCCReport = WindowCoveringCCReport_1 = __decorate([
594
- CCCommand(WindowCoveringCommand.Report)
595
- ], WindowCoveringCCReport);
617
+ let WindowCoveringCCReport = (() => {
618
+ let _classDecorators = [CCCommand(WindowCoveringCommand.Report), ccValueProperty("currentValue", WindowCoveringCCValues.currentValue, (self) => [self.parameter]), ccValueProperty("targetValue", WindowCoveringCCValues.targetValue, (self) => [self.parameter]), ccValueProperty("duration", WindowCoveringCCValues.duration, (self) => [self.parameter])];
619
+ let _classDescriptor;
620
+ let _classExtraInitializers = [];
621
+ let _classThis;
622
+ let _classSuper = WindowCoveringCC;
623
+ var WindowCoveringCCReport = class extends _classSuper {
624
+ static { _classThis = this; }
625
+ static {
626
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
627
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
628
+ WindowCoveringCCReport = _classThis = _classDescriptor.value;
629
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
630
+ __runInitializers(_classThis, _classExtraInitializers);
631
+ }
632
+ constructor(options) {
633
+ super(options);
634
+ // TODO: Check implementation:
635
+ this.parameter = options.parameter;
636
+ this.currentValue = options.currentValue;
637
+ this.targetValue = options.targetValue;
638
+ this.duration = options.duration;
639
+ }
640
+ static from(raw, ctx) {
641
+ validatePayload(raw.payload.length >= 4);
642
+ const parameter = raw.payload[0];
643
+ const currentValue = raw.payload[1];
644
+ const targetValue = raw.payload[2];
645
+ const duration = Duration.parseReport(raw.payload[3])
646
+ ?? Duration.unknown();
647
+ return new this({
648
+ nodeId: ctx.sourceNodeId,
649
+ parameter,
650
+ currentValue,
651
+ targetValue,
652
+ duration,
653
+ });
654
+ }
655
+ parameter;
656
+ currentValue;
657
+ targetValue;
658
+ duration;
659
+ toLogEntry(ctx) {
660
+ return {
661
+ ...super.toLogEntry(ctx),
662
+ message: {
663
+ parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
664
+ "current value": this.currentValue,
665
+ "target value": this.targetValue,
666
+ duration: this.duration.toString(),
667
+ },
668
+ };
669
+ }
670
+ };
671
+ return WindowCoveringCCReport = _classThis;
672
+ })();
596
673
  export { WindowCoveringCCReport };
597
674
  function testResponseForWindowCoveringGet(sent, received) {
598
675
  return received.parameter === sent.parameter;
599
676
  }
600
- let WindowCoveringCCGet = WindowCoveringCCGet_1 = class WindowCoveringCCGet extends WindowCoveringCC {
601
- constructor(options) {
602
- super(options);
603
- this.parameter = options.parameter;
604
- }
605
- static from(raw, ctx) {
606
- validatePayload(raw.payload.length >= 1);
607
- const parameter = raw.payload[0];
608
- return new WindowCoveringCCGet_1({
609
- nodeId: ctx.sourceNodeId,
610
- parameter,
611
- });
612
- }
613
- parameter;
614
- serialize(ctx) {
615
- this.payload = Bytes.from([this.parameter]);
616
- return super.serialize(ctx);
617
- }
618
- toLogEntry(ctx) {
619
- return {
620
- ...super.toLogEntry(ctx),
621
- message: {
622
- parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
623
- },
624
- };
625
- }
626
- };
627
- WindowCoveringCCGet = WindowCoveringCCGet_1 = __decorate([
628
- CCCommand(WindowCoveringCommand.Get),
629
- expectedCCResponse(WindowCoveringCCReport, testResponseForWindowCoveringGet)
630
- ], WindowCoveringCCGet);
677
+ let WindowCoveringCCGet = (() => {
678
+ let _classDecorators = [CCCommand(WindowCoveringCommand.Get), expectedCCResponse(WindowCoveringCCReport, testResponseForWindowCoveringGet)];
679
+ let _classDescriptor;
680
+ let _classExtraInitializers = [];
681
+ let _classThis;
682
+ let _classSuper = WindowCoveringCC;
683
+ var WindowCoveringCCGet = class extends _classSuper {
684
+ static { _classThis = this; }
685
+ static {
686
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
687
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
688
+ WindowCoveringCCGet = _classThis = _classDescriptor.value;
689
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
690
+ __runInitializers(_classThis, _classExtraInitializers);
691
+ }
692
+ constructor(options) {
693
+ super(options);
694
+ this.parameter = options.parameter;
695
+ }
696
+ static from(raw, ctx) {
697
+ validatePayload(raw.payload.length >= 1);
698
+ const parameter = raw.payload[0];
699
+ return new this({
700
+ nodeId: ctx.sourceNodeId,
701
+ parameter,
702
+ });
703
+ }
704
+ parameter;
705
+ serialize(ctx) {
706
+ this.payload = Bytes.from([this.parameter]);
707
+ return super.serialize(ctx);
708
+ }
709
+ toLogEntry(ctx) {
710
+ return {
711
+ ...super.toLogEntry(ctx),
712
+ message: {
713
+ parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
714
+ },
715
+ };
716
+ }
717
+ };
718
+ return WindowCoveringCCGet = _classThis;
719
+ })();
631
720
  export { WindowCoveringCCGet };
632
- let WindowCoveringCCSet = WindowCoveringCCSet_1 = class WindowCoveringCCSet extends WindowCoveringCC {
633
- constructor(options) {
634
- super(options);
635
- this.targetValues = options.targetValues;
636
- this.duration = Duration.from(options.duration);
637
- }
638
- static from(raw, ctx) {
639
- validatePayload(raw.payload.length >= 1);
640
- const numEntries = raw.payload[0] & 0b11111;
641
- validatePayload(raw.payload.length >= 1 + numEntries * 2);
642
- const targetValues = [];
643
- for (let i = 0; i < numEntries; i++) {
644
- const offset = 1 + i * 2;
645
- targetValues.push({
646
- parameter: raw.payload[offset],
647
- value: raw.payload[offset + 1],
721
+ let WindowCoveringCCSet = (() => {
722
+ let _classDecorators = [CCCommand(WindowCoveringCommand.Set), useSupervision()];
723
+ let _classDescriptor;
724
+ let _classExtraInitializers = [];
725
+ let _classThis;
726
+ let _classSuper = WindowCoveringCC;
727
+ var WindowCoveringCCSet = class extends _classSuper {
728
+ static { _classThis = this; }
729
+ static {
730
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
731
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
732
+ WindowCoveringCCSet = _classThis = _classDescriptor.value;
733
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
734
+ __runInitializers(_classThis, _classExtraInitializers);
735
+ }
736
+ constructor(options) {
737
+ super(options);
738
+ this.targetValues = options.targetValues;
739
+ this.duration = Duration.from(options.duration);
740
+ }
741
+ static from(raw, ctx) {
742
+ validatePayload(raw.payload.length >= 1);
743
+ const numEntries = raw.payload[0] & 0b11111;
744
+ validatePayload(raw.payload.length >= 1 + numEntries * 2);
745
+ const targetValues = [];
746
+ for (let i = 0; i < numEntries; i++) {
747
+ const offset = 1 + i * 2;
748
+ targetValues.push({
749
+ parameter: raw.payload[offset],
750
+ value: raw.payload[offset + 1],
751
+ });
752
+ }
753
+ let duration;
754
+ if (raw.payload.length >= 2 + numEntries * 2) {
755
+ duration = Duration.parseSet(raw.payload[1 + numEntries * 2]);
756
+ }
757
+ return new this({
758
+ nodeId: ctx.sourceNodeId,
759
+ targetValues,
760
+ duration,
648
761
  });
649
762
  }
650
- let duration;
651
- if (raw.payload.length >= 2 + numEntries * 2) {
652
- duration = Duration.parseSet(raw.payload[1 + numEntries * 2]);
763
+ targetValues;
764
+ duration;
765
+ serialize(ctx) {
766
+ const numEntries = this.targetValues.length & 0b11111;
767
+ this.payload = new Bytes(2 + numEntries * 2);
768
+ this.payload[0] = numEntries;
769
+ for (let i = 0; i < numEntries; i++) {
770
+ const offset = 1 + i * 2;
771
+ this.payload[offset] = this.targetValues[i].parameter;
772
+ this.payload[offset + 1] = this.targetValues[i].value;
773
+ }
774
+ this.payload[this.payload.length - 1] = (this.duration ?? Duration.default()).serializeSet();
775
+ return super.serialize(ctx);
653
776
  }
654
- return new WindowCoveringCCSet_1({
655
- nodeId: ctx.sourceNodeId,
656
- targetValues,
657
- duration,
658
- });
659
- }
660
- targetValues;
661
- duration;
662
- serialize(ctx) {
663
- const numEntries = this.targetValues.length & 0b11111;
664
- this.payload = new Bytes(2 + numEntries * 2);
665
- this.payload[0] = numEntries;
666
- for (let i = 0; i < numEntries; i++) {
667
- const offset = 1 + i * 2;
668
- this.payload[offset] = this.targetValues[i].parameter;
669
- this.payload[offset + 1] = this.targetValues[i].value;
670
- }
671
- this.payload[this.payload.length - 1] = (this.duration ?? Duration.default()).serializeSet();
672
- return super.serialize(ctx);
673
- }
674
- toLogEntry(ctx) {
675
- const message = {};
676
- for (const { parameter, value } of this.targetValues) {
677
- message[getEnumMemberName(WindowCoveringParameter, parameter)] =
678
- value;
679
- }
680
- if (this.duration) {
681
- message.duration = this.duration.toString();
682
- }
683
- return {
684
- ...super.toLogEntry(ctx),
685
- message,
686
- };
687
- }
688
- };
689
- WindowCoveringCCSet = WindowCoveringCCSet_1 = __decorate([
690
- CCCommand(WindowCoveringCommand.Set),
691
- useSupervision()
692
- ], WindowCoveringCCSet);
777
+ toLogEntry(ctx) {
778
+ const message = {};
779
+ for (const { parameter, value } of this.targetValues) {
780
+ message[getEnumMemberName(WindowCoveringParameter, parameter)] =
781
+ value;
782
+ }
783
+ if (this.duration) {
784
+ message.duration = this.duration.toString();
785
+ }
786
+ return {
787
+ ...super.toLogEntry(ctx),
788
+ message,
789
+ };
790
+ }
791
+ };
792
+ return WindowCoveringCCSet = _classThis;
793
+ })();
693
794
  export { WindowCoveringCCSet };
694
- let WindowCoveringCCStartLevelChange = WindowCoveringCCStartLevelChange_1 = class WindowCoveringCCStartLevelChange extends WindowCoveringCC {
695
- constructor(options) {
696
- super(options);
697
- this.parameter = options.parameter;
698
- this.direction = options.direction;
699
- this.duration = Duration.from(options.duration);
700
- }
701
- static from(raw, ctx) {
702
- validatePayload(raw.payload.length >= 2);
703
- const direction = !!(raw.payload[0] & 0b0100_0000)
704
- ? "down"
705
- : "up";
706
- const parameter = raw.payload[1];
707
- let duration;
708
- if (raw.payload.length >= 3) {
709
- duration = Duration.parseSet(raw.payload[2]);
710
- }
711
- return new WindowCoveringCCStartLevelChange_1({
712
- nodeId: ctx.sourceNodeId,
713
- direction,
714
- parameter,
715
- duration,
716
- });
717
- }
718
- parameter;
719
- direction;
720
- duration;
721
- serialize(ctx) {
722
- this.payload = Bytes.from([
723
- this.direction === "down" ? 0b0100_0000 : 0b0000_0000,
724
- this.parameter,
725
- (this.duration ?? Duration.default()).serializeSet(),
726
- ]);
727
- return super.serialize(ctx);
728
- }
729
- toLogEntry(ctx) {
730
- const message = {
731
- parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
732
- direction: this.direction,
733
- };
734
- if (this.duration) {
735
- message.duration = this.duration.toString();
795
+ let WindowCoveringCCStartLevelChange = (() => {
796
+ let _classDecorators = [CCCommand(WindowCoveringCommand.StartLevelChange), useSupervision()];
797
+ let _classDescriptor;
798
+ let _classExtraInitializers = [];
799
+ let _classThis;
800
+ let _classSuper = WindowCoveringCC;
801
+ var WindowCoveringCCStartLevelChange = class extends _classSuper {
802
+ static { _classThis = this; }
803
+ static {
804
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
805
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
806
+ WindowCoveringCCStartLevelChange = _classThis = _classDescriptor.value;
807
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
808
+ __runInitializers(_classThis, _classExtraInitializers);
736
809
  }
737
- return {
738
- ...super.toLogEntry(ctx),
739
- message,
740
- };
741
- }
742
- };
743
- WindowCoveringCCStartLevelChange = WindowCoveringCCStartLevelChange_1 = __decorate([
744
- CCCommand(WindowCoveringCommand.StartLevelChange),
745
- useSupervision()
746
- ], WindowCoveringCCStartLevelChange);
747
- export { WindowCoveringCCStartLevelChange };
748
- let WindowCoveringCCStopLevelChange = WindowCoveringCCStopLevelChange_1 = class WindowCoveringCCStopLevelChange extends WindowCoveringCC {
749
- constructor(options) {
750
- super(options);
751
- this.parameter = options.parameter;
752
- }
753
- static from(raw, ctx) {
754
- validatePayload(raw.payload.length >= 1);
755
- const parameter = raw.payload[0];
756
- return new WindowCoveringCCStopLevelChange_1({
757
- nodeId: ctx.sourceNodeId,
758
- parameter,
759
- });
760
- }
761
- parameter;
762
- serialize(ctx) {
763
- this.payload = Bytes.from([this.parameter]);
764
- return super.serialize(ctx);
765
- }
766
- toLogEntry(ctx) {
767
- return {
768
- ...super.toLogEntry(ctx),
769
- message: {
810
+ constructor(options) {
811
+ super(options);
812
+ this.parameter = options.parameter;
813
+ this.direction = options.direction;
814
+ this.duration = Duration.from(options.duration);
815
+ }
816
+ static from(raw, ctx) {
817
+ validatePayload(raw.payload.length >= 2);
818
+ const direction = !!(raw.payload[0] & 0b0100_0000)
819
+ ? "down"
820
+ : "up";
821
+ const parameter = raw.payload[1];
822
+ let duration;
823
+ if (raw.payload.length >= 3) {
824
+ duration = Duration.parseSet(raw.payload[2]);
825
+ }
826
+ return new this({
827
+ nodeId: ctx.sourceNodeId,
828
+ direction,
829
+ parameter,
830
+ duration,
831
+ });
832
+ }
833
+ parameter;
834
+ direction;
835
+ duration;
836
+ serialize(ctx) {
837
+ this.payload = Bytes.from([
838
+ this.direction === "down" ? 0b0100_0000 : 0b0000_0000,
839
+ this.parameter,
840
+ (this.duration ?? Duration.default()).serializeSet(),
841
+ ]);
842
+ return super.serialize(ctx);
843
+ }
844
+ toLogEntry(ctx) {
845
+ const message = {
770
846
  parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
771
- },
772
- };
773
- }
774
- };
775
- WindowCoveringCCStopLevelChange = WindowCoveringCCStopLevelChange_1 = __decorate([
776
- CCCommand(WindowCoveringCommand.StopLevelChange),
777
- useSupervision()
778
- ], WindowCoveringCCStopLevelChange);
847
+ direction: this.direction,
848
+ };
849
+ if (this.duration) {
850
+ message.duration = this.duration.toString();
851
+ }
852
+ return {
853
+ ...super.toLogEntry(ctx),
854
+ message,
855
+ };
856
+ }
857
+ };
858
+ return WindowCoveringCCStartLevelChange = _classThis;
859
+ })();
860
+ export { WindowCoveringCCStartLevelChange };
861
+ let WindowCoveringCCStopLevelChange = (() => {
862
+ let _classDecorators = [CCCommand(WindowCoveringCommand.StopLevelChange), useSupervision()];
863
+ let _classDescriptor;
864
+ let _classExtraInitializers = [];
865
+ let _classThis;
866
+ let _classSuper = WindowCoveringCC;
867
+ var WindowCoveringCCStopLevelChange = class extends _classSuper {
868
+ static { _classThis = this; }
869
+ static {
870
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
871
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
872
+ WindowCoveringCCStopLevelChange = _classThis = _classDescriptor.value;
873
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
874
+ __runInitializers(_classThis, _classExtraInitializers);
875
+ }
876
+ constructor(options) {
877
+ super(options);
878
+ this.parameter = options.parameter;
879
+ }
880
+ static from(raw, ctx) {
881
+ validatePayload(raw.payload.length >= 1);
882
+ const parameter = raw.payload[0];
883
+ return new this({
884
+ nodeId: ctx.sourceNodeId,
885
+ parameter,
886
+ });
887
+ }
888
+ parameter;
889
+ serialize(ctx) {
890
+ this.payload = Bytes.from([this.parameter]);
891
+ return super.serialize(ctx);
892
+ }
893
+ toLogEntry(ctx) {
894
+ return {
895
+ ...super.toLogEntry(ctx),
896
+ message: {
897
+ parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
898
+ },
899
+ };
900
+ }
901
+ };
902
+ return WindowCoveringCCStopLevelChange = _classThis;
903
+ })();
779
904
  export { WindowCoveringCCStopLevelChange };
780
905
  //# sourceMappingURL=WindowCoveringCC.js.map