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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +381 -266
  2. package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
  3. package/build/cjs/cc/AssociationCC.js +669 -503
  4. package/build/cjs/cc/AssociationCC.js.map +3 -3
  5. package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
  6. package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
  7. package/build/cjs/cc/BarrierOperatorCC.js +595 -429
  8. package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
  9. package/build/cjs/cc/BasicCC.js +354 -260
  10. package/build/cjs/cc/BasicCC.js.map +3 -3
  11. package/build/cjs/cc/BatteryCC.js +427 -345
  12. package/build/cjs/cc/BatteryCC.js.map +3 -3
  13. package/build/cjs/cc/BinarySensorCC.js +391 -276
  14. package/build/cjs/cc/BinarySensorCC.js.map +3 -3
  15. package/build/cjs/cc/BinarySwitchCC.js +347 -253
  16. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  17. package/build/cjs/cc/CRC16CC.js +160 -85
  18. package/build/cjs/cc/CRC16CC.js.map +3 -3
  19. package/build/cjs/cc/CentralSceneCC.js +459 -324
  20. package/build/cjs/cc/CentralSceneCC.js.map +3 -3
  21. package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
  23. package/build/cjs/cc/ClockCC.js +254 -150
  24. package/build/cjs/cc/ClockCC.js.map +3 -3
  25. package/build/cjs/cc/ColorSwitchCC.js +758 -610
  26. package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
  27. package/build/cjs/cc/ConfigurationCC.js +1700 -1453
  28. package/build/cjs/cc/ConfigurationCC.js.map +3 -3
  29. package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
  30. package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
  31. package/build/cjs/cc/DoorLockCC.js +904 -777
  32. package/build/cjs/cc/DoorLockCC.js.map +3 -3
  33. package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
  34. package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
  35. package/build/cjs/cc/EnergyProductionCC.js +249 -160
  36. package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
  37. package/build/cjs/cc/EntryControlCC.js +619 -458
  38. package/build/cjs/cc/EntryControlCC.js.map +3 -3
  39. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
  40. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
  41. package/build/cjs/cc/HailCC.js +57 -11
  42. package/build/cjs/cc/HailCC.js.map +2 -2
  43. package/build/cjs/cc/HumidityControlModeCC.js +359 -233
  44. package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
  45. package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
  46. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
  47. package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
  48. package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
  49. package/build/cjs/cc/InclusionControllerCC.js +205 -114
  50. package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
  51. package/build/cjs/cc/IndicatorCC.js +897 -736
  52. package/build/cjs/cc/IndicatorCC.js.map +3 -3
  53. package/build/cjs/cc/IrrigationCC.js +1651 -1405
  54. package/build/cjs/cc/IrrigationCC.js.map +3 -3
  55. package/build/cjs/cc/LanguageCC.js +268 -171
  56. package/build/cjs/cc/LanguageCC.js.map +3 -3
  57. package/build/cjs/cc/LockCC.js +254 -154
  58. package/build/cjs/cc/LockCC.js.map +3 -3
  59. package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
  60. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  61. package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
  62. package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
  63. package/build/cjs/cc/MeterCC.js +827 -707
  64. package/build/cjs/cc/MeterCC.js.map +3 -3
  65. package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
  66. package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
  67. package/build/cjs/cc/MultiChannelCC.js +1037 -819
  68. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  69. package/build/cjs/cc/MultiCommandCC.js +172 -97
  70. package/build/cjs/cc/MultiCommandCC.js.map +3 -3
  71. package/build/cjs/cc/MultilevelSensorCC.js +589 -449
  72. package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
  73. package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
  74. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  75. package/build/cjs/cc/NoOperationCC.js +89 -27
  76. package/build/cjs/cc/NoOperationCC.js.map +2 -2
  77. package/build/cjs/cc/NodeNamingCC.js +417 -277
  78. package/build/cjs/cc/NodeNamingCC.js.map +3 -3
  79. package/build/cjs/cc/NotificationCC.js +972 -818
  80. package/build/cjs/cc/NotificationCC.js.map +3 -3
  81. package/build/cjs/cc/PowerlevelCC.js +450 -303
  82. package/build/cjs/cc/PowerlevelCC.js.map +3 -3
  83. package/build/cjs/cc/ProtectionCC.js +686 -494
  84. package/build/cjs/cc/ProtectionCC.js.map +3 -3
  85. package/build/cjs/cc/SceneActivationCC.js +165 -97
  86. package/build/cjs/cc/SceneActivationCC.js.map +3 -3
  87. package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
  88. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
  89. package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
  90. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
  91. package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
  92. package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
  93. package/build/cjs/cc/Security2CC.js +1483 -1219
  94. package/build/cjs/cc/Security2CC.js.map +3 -3
  95. package/build/cjs/cc/SecurityCC.js +839 -619
  96. package/build/cjs/cc/SecurityCC.js.map +3 -3
  97. package/build/cjs/cc/SoundSwitchCC.js +707 -515
  98. package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
  99. package/build/cjs/cc/SupervisionCC.js +327 -237
  100. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  101. package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
  102. package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
  103. package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
  104. package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
  105. package/build/cjs/cc/ThermostatModeCC.js +425 -302
  106. package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
  107. package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
  108. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
  109. package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
  110. package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
  111. package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
  112. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  113. package/build/cjs/cc/TimeCC.js +515 -353
  114. package/build/cjs/cc/TimeCC.js.map +3 -3
  115. package/build/cjs/cc/TimeParametersCC.js +302 -202
  116. package/build/cjs/cc/TimeParametersCC.js.map +3 -3
  117. package/build/cjs/cc/TransportServiceCC.js +433 -315
  118. package/build/cjs/cc/TransportServiceCC.js.map +3 -3
  119. package/build/cjs/cc/UserCodeCC.js +1385 -1102
  120. package/build/cjs/cc/UserCodeCC.js.map +3 -3
  121. package/build/cjs/cc/VersionCC.js +696 -562
  122. package/build/cjs/cc/VersionCC.js.map +3 -3
  123. package/build/cjs/cc/WakeUpCC.js +499 -346
  124. package/build/cjs/cc/WakeUpCC.js.map +3 -3
  125. package/build/cjs/cc/WindowCoveringCC.js +626 -478
  126. package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
  127. package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
  128. package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
  129. package/build/cjs/cc/ZWavePlusCC.js +233 -159
  130. package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
  131. package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
  132. package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
  133. package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  134. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
  135. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
  136. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
  137. package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
  138. package/build/cjs/lib/CommandClassDecorators.js +19 -20
  139. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  140. package/build/cjs/lib/Security2/Extension.d.ts +1 -1
  141. package/build/cjs/lib/Security2/Extension.js +217 -126
  142. package/build/cjs/lib/Security2/Extension.js.map +3 -3
  143. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  144. package/build/esm/cc/AlarmSensorCC.js +389 -291
  145. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  146. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  147. package/build/esm/cc/AssociationCC.js +678 -537
  148. package/build/esm/cc/AssociationCC.js.map +1 -1
  149. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  150. package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
  151. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  152. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  153. package/build/esm/cc/BarrierOperatorCC.js +634 -493
  154. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  155. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  156. package/build/esm/cc/BasicCC.js +380 -302
  157. package/build/esm/cc/BasicCC.js.map +1 -1
  158. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  159. package/build/esm/cc/BatteryCC.js +449 -384
  160. package/build/esm/cc/BatteryCC.js.map +1 -1
  161. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  162. package/build/esm/cc/BinarySensorCC.js +395 -297
  163. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  164. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  165. package/build/esm/cc/BinarySwitchCC.js +353 -274
  166. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  167. package/build/esm/cc/CRC16CC.js +162 -98
  168. package/build/esm/cc/CRC16CC.js.map +1 -1
  169. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  170. package/build/esm/cc/CentralSceneCC.js +465 -351
  171. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  172. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  173. package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
  174. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  175. package/build/esm/cc/ClockCC.js +248 -159
  176. package/build/esm/cc/ClockCC.js.map +1 -1
  177. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  178. package/build/esm/cc/ColorSwitchCC.js +802 -677
  179. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  180. package/build/esm/cc/ConfigurationCC.js +1899 -1687
  181. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  182. package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
  183. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  184. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  185. package/build/esm/cc/DoorLockCC.js +951 -849
  186. package/build/esm/cc/DoorLockCC.js.map +1 -1
  187. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  188. package/build/esm/cc/DoorLockLoggingCC.js +316 -218
  189. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  190. package/build/esm/cc/EnergyProductionCC.js +240 -164
  191. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  192. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  193. package/build/esm/cc/EntryControlCC.js +629 -493
  194. package/build/esm/cc/EntryControlCC.js.map +1 -1
  195. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  196. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
  197. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  198. package/build/esm/cc/HailCC.js +51 -12
  199. package/build/esm/cc/HailCC.js.map +1 -1
  200. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  201. package/build/esm/cc/HumidityControlModeCC.js +357 -250
  202. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  203. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  204. package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
  205. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  206. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  207. package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
  208. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  209. package/build/esm/cc/InclusionControllerCC.js +197 -119
  210. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  211. package/build/esm/cc/IndicatorCC.js +973 -835
  212. package/build/esm/cc/IndicatorCC.js.map +1 -1
  213. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  214. package/build/esm/cc/IrrigationCC.js +1697 -1496
  215. package/build/esm/cc/IrrigationCC.js.map +1 -1
  216. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  217. package/build/esm/cc/LanguageCC.js +266 -184
  218. package/build/esm/cc/LanguageCC.js.map +1 -1
  219. package/build/esm/cc/LockCC.d.ts.map +1 -1
  220. package/build/esm/cc/LockCC.js +247 -162
  221. package/build/esm/cc/LockCC.js.map +1 -1
  222. package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
  223. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  224. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  225. package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
  226. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  227. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  228. package/build/esm/cc/MeterCC.js +896 -795
  229. package/build/esm/cc/MeterCC.js.map +1 -1
  230. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  231. package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
  232. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  233. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  234. package/build/esm/cc/MultiChannelCC.js +1106 -921
  235. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  236. package/build/esm/cc/MultiCommandCC.js +166 -102
  237. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  238. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  239. package/build/esm/cc/MultilevelSensorCC.js +616 -497
  240. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  241. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  242. package/build/esm/cc/MultilevelSwitchCC.js +621 -496
  243. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  244. package/build/esm/cc/NoOperationCC.js +82 -29
  245. package/build/esm/cc/NoOperationCC.js.map +1 -1
  246. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  247. package/build/esm/cc/NodeNamingCC.js +413 -294
  248. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  249. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  250. package/build/esm/cc/NotificationCC.js +1097 -966
  251. package/build/esm/cc/NotificationCC.js.map +1 -1
  252. package/build/esm/cc/PowerlevelCC.js +437 -311
  253. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  254. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  255. package/build/esm/cc/ProtectionCC.js +704 -543
  256. package/build/esm/cc/ProtectionCC.js.map +1 -1
  257. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  258. package/build/esm/cc/SceneActivationCC.js +157 -100
  259. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  260. package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
  261. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  262. package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
  263. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  264. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  265. package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
  266. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  267. package/build/esm/cc/Security2CC.js +1633 -1406
  268. package/build/esm/cc/Security2CC.js.map +1 -1
  269. package/build/esm/cc/SecurityCC.js +876 -687
  270. package/build/esm/cc/SecurityCC.js.map +1 -1
  271. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  272. package/build/esm/cc/SoundSwitchCC.js +689 -526
  273. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  274. package/build/esm/cc/SupervisionCC.js +349 -272
  275. package/build/esm/cc/SupervisionCC.js.map +1 -1
  276. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  277. package/build/esm/cc/ThermostatFanModeCC.js +388 -284
  278. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  279. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  280. package/build/esm/cc/ThermostatFanStateCC.js +184 -111
  281. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  282. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  283. package/build/esm/cc/ThermostatModeCC.js +435 -331
  284. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  285. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  286. package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
  287. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  288. package/build/esm/cc/ThermostatSetbackCC.js +274 -185
  289. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  290. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  291. package/build/esm/cc/ThermostatSetpointCC.js +674 -543
  292. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  293. package/build/esm/cc/TimeCC.js +499 -360
  294. package/build/esm/cc/TimeCC.js.map +1 -1
  295. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  296. package/build/esm/cc/TimeParametersCC.js +296 -211
  297. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  298. package/build/esm/cc/TransportServiceCC.js +464 -363
  299. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  300. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  301. package/build/esm/cc/UserCodeCC.js +1443 -1205
  302. package/build/esm/cc/UserCodeCC.js.map +1 -1
  303. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  304. package/build/esm/cc/VersionCC.js +744 -635
  305. package/build/esm/cc/VersionCC.js.map +1 -1
  306. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  307. package/build/esm/cc/WakeUpCC.js +494 -364
  308. package/build/esm/cc/WakeUpCC.js.map +1 -1
  309. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  310. package/build/esm/cc/WindowCoveringCC.js +655 -530
  311. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  312. package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
  313. package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
  314. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  315. package/build/esm/cc/ZWavePlusCC.js +223 -162
  316. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  317. package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
  318. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  319. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  320. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  321. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
  322. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  323. package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
  324. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  325. package/build/esm/lib/CommandClassDecorators.js +24 -24
  326. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  327. package/build/esm/lib/Security2/Extension.d.ts +1 -1
  328. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  329. package/build/esm/lib/Security2/Extension.js +207 -123
  330. package/build/esm/lib/Security2/Extension.js.map +1 -1
  331. package/package.json +6 -6
@@ -1,10 +1,37 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
6
34
  };
7
- var SoundSwitchCCTonesNumberReport_1, SoundSwitchCCToneInfoReport_1, SoundSwitchCCToneInfoGet_1, SoundSwitchCCConfigurationSet_1, SoundSwitchCCConfigurationReport_1, SoundSwitchCCTonePlaySet_1, SoundSwitchCCTonePlayReport_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -37,7 +64,7 @@ import { pick } from "@zwave-js/shared/safe";
37
64
  import { clamp } from "alcalzone-shared/math/index.js";
38
65
  import { CCAPI, POLL_VALUE, SET_VALUE, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
39
66
  import { CommandClass, } from "../lib/CommandClass.js";
40
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
67
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
41
68
  import { V } from "../lib/Values.js";
42
69
  import { SoundSwitchCommand } from "../lib/_Types.js";
43
70
  export const SoundSwitchCCValues = Object.freeze({
@@ -73,561 +100,697 @@ export const SoundSwitchCCValues = Object.freeze({
73
100
  }),
74
101
  }),
75
102
  });
76
- let SoundSwitchCCAPI = class SoundSwitchCCAPI extends CCAPI {
77
- supportsCommand(cmd) {
78
- switch (cmd) {
79
- case SoundSwitchCommand.TonesNumberGet:
80
- case SoundSwitchCommand.ToneInfoGet:
81
- case SoundSwitchCommand.ConfigurationGet:
82
- case SoundSwitchCommand.TonePlayGet:
83
- return this.isSinglecast();
84
- case SoundSwitchCommand.ConfigurationSet:
85
- case SoundSwitchCommand.TonePlaySet:
86
- return true; // This is mandatory
87
- }
88
- return super.supportsCommand(cmd);
89
- }
90
- async getToneCount() {
91
- this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonesNumberGet);
92
- const cc = new SoundSwitchCCTonesNumberGet({
93
- nodeId: this.endpoint.nodeId,
94
- endpointIndex: this.endpoint.index,
95
- });
96
- const response = await this.host.sendCommand(cc, this.commandOptions);
97
- return response?.toneCount;
98
- }
99
- async getToneInfo(toneId) {
100
- __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
101
- this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ToneInfoGet);
102
- const cc = new SoundSwitchCCToneInfoGet({
103
- nodeId: this.endpoint.nodeId,
104
- endpointIndex: this.endpoint.index,
105
- toneId,
106
- });
107
- const response = await this.host.sendCommand(cc, this.commandOptions);
108
- if (response)
109
- return pick(response, ["duration", "name"]);
110
- }
111
- async setConfiguration(defaultToneId, defaultVolume) {
112
- __assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
113
- __assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
114
- this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ConfigurationSet);
115
- const cc = new SoundSwitchCCConfigurationSet({
116
- nodeId: this.endpoint.nodeId,
117
- endpointIndex: this.endpoint.index,
118
- defaultToneId,
119
- defaultVolume,
120
- });
121
- return this.host.sendCommand(cc, this.commandOptions);
122
- }
123
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
124
- async getConfiguration() {
125
- this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ConfigurationGet);
126
- const cc = new SoundSwitchCCConfigurationGet({
127
- nodeId: this.endpoint.nodeId,
128
- endpointIndex: this.endpoint.index,
129
- });
130
- const response = await this.host.sendCommand(cc, this.commandOptions);
131
- if (response) {
132
- return pick(response, ["defaultToneId", "defaultVolume"]);
103
+ let SoundSwitchCCAPI = (() => {
104
+ let _classDecorators = [API(CommandClasses["Sound Switch"])];
105
+ let _classDescriptor;
106
+ let _classExtraInitializers = [];
107
+ let _classThis;
108
+ let _classSuper = CCAPI;
109
+ var SoundSwitchCCAPI = class extends _classSuper {
110
+ static { _classThis = this; }
111
+ static {
112
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
113
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
114
+ SoundSwitchCCAPI = _classThis = _classDescriptor.value;
115
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
116
+ __runInitializers(_classThis, _classExtraInitializers);
133
117
  }
134
- }
135
- async play(toneId, volume) {
136
- __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
137
- __assertType("volume", "(optional) number", __assertType__optional_number.bind(void 0, volume));
138
- this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlaySet);
139
- if (toneId === 0) {
140
- throw new ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, ZWaveErrorCodes.Argument_Invalid);
141
- }
142
- const cc = new SoundSwitchCCTonePlaySet({
143
- nodeId: this.endpoint.nodeId,
144
- endpointIndex: this.endpoint.index,
145
- toneId,
146
- volume,
147
- });
148
- return this.host.sendCommand(cc, this.commandOptions);
149
- }
150
- async stopPlaying() {
151
- this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlaySet);
152
- const cc = new SoundSwitchCCTonePlaySet({
153
- nodeId: this.endpoint.nodeId,
154
- endpointIndex: this.endpoint.index,
155
- toneId: 0x00,
156
- volume: 0x00,
157
- });
158
- return this.host.sendCommand(cc, this.commandOptions);
159
- }
160
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
161
- async getPlaying() {
162
- this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlayGet);
163
- const cc = new SoundSwitchCCTonePlayGet({
164
- nodeId: this.endpoint.nodeId,
165
- endpointIndex: this.endpoint.index,
166
- });
167
- const response = await this.host.sendCommand(cc, this.commandOptions);
168
- if (response) {
169
- return pick(response, ["toneId", "volume"]);
118
+ supportsCommand(cmd) {
119
+ switch (cmd) {
120
+ case SoundSwitchCommand.TonesNumberGet:
121
+ case SoundSwitchCommand.ToneInfoGet:
122
+ case SoundSwitchCommand.ConfigurationGet:
123
+ case SoundSwitchCommand.TonePlayGet:
124
+ return this.isSinglecast();
125
+ case SoundSwitchCommand.ConfigurationSet:
126
+ case SoundSwitchCommand.TonePlaySet:
127
+ return true; // This is mandatory
128
+ }
129
+ return super.supportsCommand(cmd);
170
130
  }
171
- }
172
- get [SET_VALUE]() {
173
- return async function ({ property }, value, options) {
174
- if (property === "defaultToneId") {
175
- if (typeof value !== "number") {
176
- throwWrongValueType(this.ccId, property, "number", typeof value);
177
- }
178
- return this.setConfiguration(value, 0xff);
131
+ async getToneCount() {
132
+ this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonesNumberGet);
133
+ const cc = new SoundSwitchCCTonesNumberGet({
134
+ nodeId: this.endpoint.nodeId,
135
+ endpointIndex: this.endpoint.index,
136
+ });
137
+ const response = await this.host.sendCommand(cc, this.commandOptions);
138
+ return response?.toneCount;
139
+ }
140
+ async getToneInfo(toneId) {
141
+ __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
142
+ this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ToneInfoGet);
143
+ const cc = new SoundSwitchCCToneInfoGet({
144
+ nodeId: this.endpoint.nodeId,
145
+ endpointIndex: this.endpoint.index,
146
+ toneId,
147
+ });
148
+ const response = await this.host.sendCommand(cc, this.commandOptions);
149
+ if (response)
150
+ return pick(response, ["duration", "name"]);
151
+ }
152
+ async setConfiguration(defaultToneId, defaultVolume) {
153
+ __assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
154
+ __assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
155
+ this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ConfigurationSet);
156
+ const cc = new SoundSwitchCCConfigurationSet({
157
+ nodeId: this.endpoint.nodeId,
158
+ endpointIndex: this.endpoint.index,
159
+ defaultToneId,
160
+ defaultVolume,
161
+ });
162
+ return this.host.sendCommand(cc, this.commandOptions);
163
+ }
164
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
165
+ async getConfiguration() {
166
+ this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ConfigurationGet);
167
+ const cc = new SoundSwitchCCConfigurationGet({
168
+ nodeId: this.endpoint.nodeId,
169
+ endpointIndex: this.endpoint.index,
170
+ });
171
+ const response = await this.host.sendCommand(cc, this.commandOptions);
172
+ if (response) {
173
+ return pick(response, ["defaultToneId", "defaultVolume"]);
179
174
  }
180
- else if (property === "defaultVolume") {
181
- if (typeof value !== "number") {
182
- throwWrongValueType(this.ccId, property, "number", typeof value);
183
- }
184
- return this.setConfiguration(0x00, /* keep current tone */ value);
175
+ }
176
+ async play(toneId, volume) {
177
+ __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
178
+ __assertType("volume", "(optional) number", __assertType__optional_number.bind(void 0, volume));
179
+ this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlaySet);
180
+ if (toneId === 0) {
181
+ throw new ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, ZWaveErrorCodes.Argument_Invalid);
185
182
  }
186
- else if (property === "volume") {
187
- if (typeof value !== "number") {
188
- throwWrongValueType(this.ccId, property, "number", typeof value);
189
- }
190
- // Allow playing a tone by first setting the volume, then the tone ID
191
- this.tryGetValueDB()?.setValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index), value, { source: "driver", updateTimestamp: false });
183
+ const cc = new SoundSwitchCCTonePlaySet({
184
+ nodeId: this.endpoint.nodeId,
185
+ endpointIndex: this.endpoint.index,
186
+ toneId,
187
+ volume,
188
+ });
189
+ return this.host.sendCommand(cc, this.commandOptions);
190
+ }
191
+ async stopPlaying() {
192
+ this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlaySet);
193
+ const cc = new SoundSwitchCCTonePlaySet({
194
+ nodeId: this.endpoint.nodeId,
195
+ endpointIndex: this.endpoint.index,
196
+ toneId: 0x00,
197
+ volume: 0x00,
198
+ });
199
+ return this.host.sendCommand(cc, this.commandOptions);
200
+ }
201
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
202
+ async getPlaying() {
203
+ this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlayGet);
204
+ const cc = new SoundSwitchCCTonePlayGet({
205
+ nodeId: this.endpoint.nodeId,
206
+ endpointIndex: this.endpoint.index,
207
+ });
208
+ const response = await this.host.sendCommand(cc, this.commandOptions);
209
+ if (response) {
210
+ return pick(response, ["toneId", "volume"]);
192
211
  }
193
- else if (property === "toneId") {
194
- if (typeof value !== "number") {
195
- throwWrongValueType(this.ccId, property, "number", typeof value);
212
+ }
213
+ get [SET_VALUE]() {
214
+ return async function ({ property }, value, options) {
215
+ if (property === "defaultToneId") {
216
+ if (typeof value !== "number") {
217
+ throwWrongValueType(this.ccId, property, "number", typeof value);
218
+ }
219
+ return this.setConfiguration(value, 0xff);
196
220
  }
197
- let result;
198
- if (value > 0) {
199
- // Use provided volume or try to use the current volume if it exists
200
- const volume = options?.volume !== undefined
201
- ? options.volume
202
- : this.tryGetValueDB()?.getValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index));
203
- result = await this.play(value, volume);
221
+ else if (property === "defaultVolume") {
222
+ if (typeof value !== "number") {
223
+ throwWrongValueType(this.ccId, property, "number", typeof value);
224
+ }
225
+ return this.setConfiguration(0x00, /* keep current tone */ value);
204
226
  }
205
- else {
206
- result = await this.stopPlaying();
227
+ else if (property === "volume") {
228
+ if (typeof value !== "number") {
229
+ throwWrongValueType(this.ccId, property, "number", typeof value);
230
+ }
231
+ // Allow playing a tone by first setting the volume, then the tone ID
232
+ this.tryGetValueDB()?.setValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index), value, { source: "driver", updateTimestamp: false });
207
233
  }
208
- if (this.isSinglecast()
209
- && !supervisedCommandSucceeded(result)) {
210
- // Verify the current value after a (short) delay, unless the command was supervised and successful
211
- this.schedulePoll({ property }, value, {
212
- transition: "fast",
213
- });
234
+ else if (property === "toneId") {
235
+ if (typeof value !== "number") {
236
+ throwWrongValueType(this.ccId, property, "number", typeof value);
237
+ }
238
+ let result;
239
+ if (value > 0) {
240
+ // Use provided volume or try to use the current volume if it exists
241
+ const volume = options?.volume !== undefined
242
+ ? options.volume
243
+ : this.tryGetValueDB()?.getValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index));
244
+ result = await this.play(value, volume);
245
+ }
246
+ else {
247
+ result = await this.stopPlaying();
248
+ }
249
+ if (this.isSinglecast()
250
+ && !supervisedCommandSucceeded(result)) {
251
+ // Verify the current value after a (short) delay, unless the command was supervised and successful
252
+ this.schedulePoll({ property }, value, {
253
+ transition: "fast",
254
+ });
255
+ }
256
+ return result;
214
257
  }
215
- return result;
216
- }
217
- else {
218
- throwUnsupportedProperty(this.ccId, property);
219
- }
220
- };
221
- }
222
- get [POLL_VALUE]() {
223
- return async function ({ property }) {
224
- switch (property) {
225
- case "defaultToneId":
226
- case "defaultVolume":
227
- return (await this.getConfiguration())?.[property];
228
- case "toneId":
229
- case "volume":
230
- return (await this.getPlaying())?.[property];
231
- default:
258
+ else {
232
259
  throwUnsupportedProperty(this.ccId, property);
233
- }
234
- };
235
- }
236
- };
237
- SoundSwitchCCAPI = __decorate([
238
- API(CommandClasses["Sound Switch"])
239
- ], SoundSwitchCCAPI);
260
+ }
261
+ };
262
+ }
263
+ get [POLL_VALUE]() {
264
+ return async function ({ property }) {
265
+ switch (property) {
266
+ case "defaultToneId":
267
+ case "defaultVolume":
268
+ return (await this.getConfiguration())?.[property];
269
+ case "toneId":
270
+ case "volume":
271
+ return (await this.getPlaying())?.[property];
272
+ default:
273
+ throwUnsupportedProperty(this.ccId, property);
274
+ }
275
+ };
276
+ }
277
+ };
278
+ return SoundSwitchCCAPI = _classThis;
279
+ })();
240
280
  export { SoundSwitchCCAPI };
241
- let SoundSwitchCC = class SoundSwitchCC extends CommandClass {
242
- async interview(ctx) {
243
- const node = this.getNode(ctx);
244
- const endpoint = this.getEndpoint(ctx);
245
- const api = CCAPI.create(CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
246
- priority: MessagePriority.NodeQuery,
247
- });
248
- ctx.logNode(node.id, {
249
- endpoint: this.endpointIndex,
250
- message: `Interviewing ${this.ccName}...`,
251
- direction: "none",
252
- });
253
- ctx.logNode(node.id, {
254
- message: "requesting tone count...",
255
- direction: "outbound",
256
- });
257
- const toneCount = await api.getToneCount();
258
- if (toneCount != undefined) {
259
- const logMessage = `supports ${toneCount} tones`;
260
- ctx.logNode(node.id, {
261
- message: logMessage,
262
- direction: "inbound",
263
- });
281
+ let SoundSwitchCC = (() => {
282
+ let _classDecorators = [commandClass(CommandClasses["Sound Switch"]), implementedVersion(2), ccValues(SoundSwitchCCValues)];
283
+ let _classDescriptor;
284
+ let _classExtraInitializers = [];
285
+ let _classThis;
286
+ let _classSuper = CommandClass;
287
+ var SoundSwitchCC = class extends _classSuper {
288
+ static { _classThis = this; }
289
+ static {
290
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
291
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
292
+ SoundSwitchCC = _classThis = _classDescriptor.value;
293
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
294
+ __runInitializers(_classThis, _classExtraInitializers);
264
295
  }
265
- else {
296
+ async interview(ctx) {
297
+ const node = this.getNode(ctx);
298
+ const endpoint = this.getEndpoint(ctx);
299
+ const api = CCAPI.create(CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
300
+ priority: MessagePriority.NodeQuery,
301
+ });
266
302
  ctx.logNode(node.id, {
267
303
  endpoint: this.endpointIndex,
268
- message: "Querying tone count timed out, skipping interview...",
269
- level: "warn",
304
+ message: `Interviewing ${this.ccName}...`,
305
+ direction: "none",
270
306
  });
271
- return;
272
- }
273
- ctx.logNode(node.id, {
274
- message: "requesting current sound configuration...",
275
- direction: "outbound",
276
- });
277
- const config = await api.getConfiguration();
278
- if (config) {
279
- const logMessage = `received current sound configuration:
280
- default tone ID: ${config.defaultToneId}
281
- default volume: ${config.defaultVolume}`;
282
307
  ctx.logNode(node.id, {
283
- message: logMessage,
284
- direction: "inbound",
308
+ message: "requesting tone count...",
309
+ direction: "outbound",
285
310
  });
286
- }
287
- const metadataStates = {};
288
- for (let toneId = 1; toneId <= toneCount; toneId++) {
311
+ const toneCount = await api.getToneCount();
312
+ if (toneCount != undefined) {
313
+ const logMessage = `supports ${toneCount} tones`;
314
+ ctx.logNode(node.id, {
315
+ message: logMessage,
316
+ direction: "inbound",
317
+ });
318
+ }
319
+ else {
320
+ ctx.logNode(node.id, {
321
+ endpoint: this.endpointIndex,
322
+ message: "Querying tone count timed out, skipping interview...",
323
+ level: "warn",
324
+ });
325
+ return;
326
+ }
289
327
  ctx.logNode(node.id, {
290
- message: `requesting info for tone #${toneId}`,
328
+ message: "requesting current sound configuration...",
291
329
  direction: "outbound",
292
330
  });
293
- const info = await api.getToneInfo(toneId);
294
- if (!info)
295
- continue;
296
- const logMessage = `received info for tone #${toneId}:
331
+ const config = await api.getConfiguration();
332
+ if (config) {
333
+ const logMessage = `received current sound configuration:
334
+ default tone ID: ${config.defaultToneId}
335
+ default volume: ${config.defaultVolume}`;
336
+ ctx.logNode(node.id, {
337
+ message: logMessage,
338
+ direction: "inbound",
339
+ });
340
+ }
341
+ const metadataStates = {};
342
+ for (let toneId = 1; toneId <= toneCount; toneId++) {
343
+ ctx.logNode(node.id, {
344
+ message: `requesting info for tone #${toneId}`,
345
+ direction: "outbound",
346
+ });
347
+ const info = await api.getToneInfo(toneId);
348
+ if (!info)
349
+ continue;
350
+ const logMessage = `received info for tone #${toneId}:
297
351
  name: ${info.name}
298
352
  duration: ${info.duration} seconds`;
299
- ctx.logNode(node.id, {
300
- message: logMessage,
301
- direction: "inbound",
353
+ ctx.logNode(node.id, {
354
+ message: logMessage,
355
+ direction: "inbound",
356
+ });
357
+ metadataStates[toneId] = `${info.name} (${info.duration} sec)`;
358
+ }
359
+ // Remember tone count and info on the default tone ID metadata
360
+ this.setMetadata(ctx, SoundSwitchCCValues.defaultToneId, {
361
+ ...SoundSwitchCCValues.defaultToneId.meta,
362
+ min: 1,
363
+ max: toneCount,
364
+ states: metadataStates,
365
+ });
366
+ // Remember tone count and info on the tone ID metadata
367
+ this.setMetadata(ctx, SoundSwitchCCValues.toneId, {
368
+ ...SoundSwitchCCValues.toneId.meta,
369
+ min: 0,
370
+ max: toneCount,
371
+ states: {
372
+ 0: "off",
373
+ ...metadataStates,
374
+ [0xff]: "default",
375
+ },
302
376
  });
303
- metadataStates[toneId] = `${info.name} (${info.duration} sec)`;
377
+ // Remember that the interview is complete
378
+ this.setInterviewComplete(ctx, true);
304
379
  }
305
- // Remember tone count and info on the default tone ID metadata
306
- this.setMetadata(ctx, SoundSwitchCCValues.defaultToneId, {
307
- ...SoundSwitchCCValues.defaultToneId.meta,
308
- min: 1,
309
- max: toneCount,
310
- states: metadataStates,
311
- });
312
- // Remember tone count and info on the tone ID metadata
313
- this.setMetadata(ctx, SoundSwitchCCValues.toneId, {
314
- ...SoundSwitchCCValues.toneId.meta,
315
- min: 0,
316
- max: toneCount,
317
- states: {
318
- 0: "off",
319
- ...metadataStates,
320
- [0xff]: "default",
321
- },
322
- });
323
- // Remember that the interview is complete
324
- this.setInterviewComplete(ctx, true);
325
- }
326
- };
327
- SoundSwitchCC = __decorate([
328
- commandClass(CommandClasses["Sound Switch"]),
329
- implementedVersion(2),
330
- ccValues(SoundSwitchCCValues)
331
- ], SoundSwitchCC);
380
+ };
381
+ return SoundSwitchCC = _classThis;
382
+ })();
332
383
  export { SoundSwitchCC };
333
- let SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport_1 = class SoundSwitchCCTonesNumberReport extends SoundSwitchCC {
334
- constructor(options) {
335
- super(options);
336
- this.toneCount = options.toneCount;
337
- }
338
- static from(raw, ctx) {
339
- validatePayload(raw.payload.length >= 1);
340
- const toneCount = raw.payload[0];
341
- return new SoundSwitchCCTonesNumberReport_1({
342
- nodeId: ctx.sourceNodeId,
343
- toneCount,
344
- });
345
- }
346
- toneCount;
347
- serialize(ctx) {
348
- this.payload = Bytes.from([this.toneCount]);
349
- return super.serialize(ctx);
350
- }
351
- toLogEntry(ctx) {
352
- return {
353
- ...super.toLogEntry(ctx),
354
- message: { "# of tones": this.toneCount },
355
- };
356
- }
357
- };
358
- SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport_1 = __decorate([
359
- CCCommand(SoundSwitchCommand.TonesNumberReport)
360
- ], SoundSwitchCCTonesNumberReport);
384
+ let SoundSwitchCCTonesNumberReport = (() => {
385
+ let _classDecorators = [CCCommand(SoundSwitchCommand.TonesNumberReport)];
386
+ let _classDescriptor;
387
+ let _classExtraInitializers = [];
388
+ let _classThis;
389
+ let _classSuper = SoundSwitchCC;
390
+ var SoundSwitchCCTonesNumberReport = class extends _classSuper {
391
+ static { _classThis = this; }
392
+ static {
393
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
394
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
395
+ SoundSwitchCCTonesNumberReport = _classThis = _classDescriptor.value;
396
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
397
+ __runInitializers(_classThis, _classExtraInitializers);
398
+ }
399
+ constructor(options) {
400
+ super(options);
401
+ this.toneCount = options.toneCount;
402
+ }
403
+ static from(raw, ctx) {
404
+ validatePayload(raw.payload.length >= 1);
405
+ const toneCount = raw.payload[0];
406
+ return new this({
407
+ nodeId: ctx.sourceNodeId,
408
+ toneCount,
409
+ });
410
+ }
411
+ toneCount;
412
+ serialize(ctx) {
413
+ this.payload = Bytes.from([this.toneCount]);
414
+ return super.serialize(ctx);
415
+ }
416
+ toLogEntry(ctx) {
417
+ return {
418
+ ...super.toLogEntry(ctx),
419
+ message: { "# of tones": this.toneCount },
420
+ };
421
+ }
422
+ };
423
+ return SoundSwitchCCTonesNumberReport = _classThis;
424
+ })();
361
425
  export { SoundSwitchCCTonesNumberReport };
362
- let SoundSwitchCCTonesNumberGet = class SoundSwitchCCTonesNumberGet extends SoundSwitchCC {
363
- };
364
- SoundSwitchCCTonesNumberGet = __decorate([
365
- CCCommand(SoundSwitchCommand.TonesNumberGet),
366
- expectedCCResponse(SoundSwitchCCTonesNumberReport)
367
- ], SoundSwitchCCTonesNumberGet);
426
+ let SoundSwitchCCTonesNumberGet = (() => {
427
+ let _classDecorators = [CCCommand(SoundSwitchCommand.TonesNumberGet), expectedCCResponse(SoundSwitchCCTonesNumberReport)];
428
+ let _classDescriptor;
429
+ let _classExtraInitializers = [];
430
+ let _classThis;
431
+ let _classSuper = SoundSwitchCC;
432
+ var SoundSwitchCCTonesNumberGet = class extends _classSuper {
433
+ static { _classThis = this; }
434
+ static {
435
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
436
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
437
+ SoundSwitchCCTonesNumberGet = _classThis = _classDescriptor.value;
438
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
439
+ __runInitializers(_classThis, _classExtraInitializers);
440
+ }
441
+ };
442
+ return SoundSwitchCCTonesNumberGet = _classThis;
443
+ })();
368
444
  export { SoundSwitchCCTonesNumberGet };
369
- let SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport_1 = class SoundSwitchCCToneInfoReport extends SoundSwitchCC {
370
- constructor(options) {
371
- super(options);
372
- this.toneId = options.toneId;
373
- this.duration = options.duration;
374
- this.name = options.name;
375
- }
376
- static from(raw, ctx) {
377
- validatePayload(raw.payload.length >= 4);
378
- const toneId = raw.payload[0];
379
- const duration = raw.payload.readUInt16BE(1);
380
- const nameLength = raw.payload[3];
381
- validatePayload(raw.payload.length >= 4 + nameLength);
382
- const name = raw.payload.subarray(4, 4 + nameLength).toString("utf8");
383
- return new SoundSwitchCCToneInfoReport_1({
384
- nodeId: ctx.sourceNodeId,
385
- toneId,
386
- duration,
387
- name,
388
- });
389
- }
390
- toneId;
391
- duration;
392
- name;
393
- serialize(ctx) {
394
- this.payload = Bytes.concat([
395
- Bytes.from([this.toneId, 0, 0, this.name.length]),
396
- Bytes.from(this.name, "utf8"),
397
- ]);
398
- this.payload.writeUInt16BE(this.duration, 1);
399
- return super.serialize(ctx);
400
- }
401
- toLogEntry(ctx) {
402
- return {
403
- ...super.toLogEntry(ctx),
404
- message: {
405
- "tone id": this.toneId,
406
- duration: `${this.duration} seconds`,
407
- name: this.name,
408
- },
409
- };
410
- }
411
- };
412
- SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport_1 = __decorate([
413
- CCCommand(SoundSwitchCommand.ToneInfoReport)
414
- ], SoundSwitchCCToneInfoReport);
445
+ let SoundSwitchCCToneInfoReport = (() => {
446
+ let _classDecorators = [CCCommand(SoundSwitchCommand.ToneInfoReport)];
447
+ let _classDescriptor;
448
+ let _classExtraInitializers = [];
449
+ let _classThis;
450
+ let _classSuper = SoundSwitchCC;
451
+ var SoundSwitchCCToneInfoReport = class extends _classSuper {
452
+ static { _classThis = this; }
453
+ static {
454
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
455
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
456
+ SoundSwitchCCToneInfoReport = _classThis = _classDescriptor.value;
457
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
458
+ __runInitializers(_classThis, _classExtraInitializers);
459
+ }
460
+ constructor(options) {
461
+ super(options);
462
+ this.toneId = options.toneId;
463
+ this.duration = options.duration;
464
+ this.name = options.name;
465
+ }
466
+ static from(raw, ctx) {
467
+ validatePayload(raw.payload.length >= 4);
468
+ const toneId = raw.payload[0];
469
+ const duration = raw.payload.readUInt16BE(1);
470
+ const nameLength = raw.payload[3];
471
+ validatePayload(raw.payload.length >= 4 + nameLength);
472
+ const name = raw.payload.subarray(4, 4 + nameLength).toString("utf8");
473
+ return new this({
474
+ nodeId: ctx.sourceNodeId,
475
+ toneId,
476
+ duration,
477
+ name,
478
+ });
479
+ }
480
+ toneId;
481
+ duration;
482
+ name;
483
+ serialize(ctx) {
484
+ this.payload = Bytes.concat([
485
+ Bytes.from([this.toneId, 0, 0, this.name.length]),
486
+ Bytes.from(this.name, "utf8"),
487
+ ]);
488
+ this.payload.writeUInt16BE(this.duration, 1);
489
+ return super.serialize(ctx);
490
+ }
491
+ toLogEntry(ctx) {
492
+ return {
493
+ ...super.toLogEntry(ctx),
494
+ message: {
495
+ "tone id": this.toneId,
496
+ duration: `${this.duration} seconds`,
497
+ name: this.name,
498
+ },
499
+ };
500
+ }
501
+ };
502
+ return SoundSwitchCCToneInfoReport = _classThis;
503
+ })();
415
504
  export { SoundSwitchCCToneInfoReport };
416
505
  const testResponseForSoundSwitchToneInfoGet = (sent, received) => {
417
506
  return received.toneId === sent.toneId;
418
507
  };
419
- let SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet_1 = class SoundSwitchCCToneInfoGet extends SoundSwitchCC {
420
- constructor(options) {
421
- super(options);
422
- this.toneId = options.toneId;
423
- }
424
- static from(raw, ctx) {
425
- validatePayload(raw.payload.length >= 1);
426
- const toneId = raw.payload[0];
427
- return new SoundSwitchCCToneInfoGet_1({
428
- nodeId: ctx.sourceNodeId,
429
- toneId,
430
- });
431
- }
432
- toneId;
433
- serialize(ctx) {
434
- this.payload = Bytes.from([this.toneId]);
435
- return super.serialize(ctx);
436
- }
437
- toLogEntry(ctx) {
438
- return {
439
- ...super.toLogEntry(ctx),
440
- message: { "tone id": this.toneId },
441
- };
442
- }
443
- };
444
- SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet_1 = __decorate([
445
- CCCommand(SoundSwitchCommand.ToneInfoGet),
446
- expectedCCResponse(SoundSwitchCCToneInfoReport, testResponseForSoundSwitchToneInfoGet)
447
- ], SoundSwitchCCToneInfoGet);
508
+ let SoundSwitchCCToneInfoGet = (() => {
509
+ let _classDecorators = [CCCommand(SoundSwitchCommand.ToneInfoGet), expectedCCResponse(SoundSwitchCCToneInfoReport, testResponseForSoundSwitchToneInfoGet)];
510
+ let _classDescriptor;
511
+ let _classExtraInitializers = [];
512
+ let _classThis;
513
+ let _classSuper = SoundSwitchCC;
514
+ var SoundSwitchCCToneInfoGet = class extends _classSuper {
515
+ static { _classThis = this; }
516
+ static {
517
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
518
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
519
+ SoundSwitchCCToneInfoGet = _classThis = _classDescriptor.value;
520
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
521
+ __runInitializers(_classThis, _classExtraInitializers);
522
+ }
523
+ constructor(options) {
524
+ super(options);
525
+ this.toneId = options.toneId;
526
+ }
527
+ static from(raw, ctx) {
528
+ validatePayload(raw.payload.length >= 1);
529
+ const toneId = raw.payload[0];
530
+ return new this({
531
+ nodeId: ctx.sourceNodeId,
532
+ toneId,
533
+ });
534
+ }
535
+ toneId;
536
+ serialize(ctx) {
537
+ this.payload = Bytes.from([this.toneId]);
538
+ return super.serialize(ctx);
539
+ }
540
+ toLogEntry(ctx) {
541
+ return {
542
+ ...super.toLogEntry(ctx),
543
+ message: { "tone id": this.toneId },
544
+ };
545
+ }
546
+ };
547
+ return SoundSwitchCCToneInfoGet = _classThis;
548
+ })();
448
549
  export { SoundSwitchCCToneInfoGet };
449
- let SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet_1 = class SoundSwitchCCConfigurationSet extends SoundSwitchCC {
450
- constructor(options) {
451
- super(options);
452
- this.defaultVolume = options.defaultVolume;
453
- this.defaultToneId = options.defaultToneId;
454
- }
455
- static from(raw, ctx) {
456
- validatePayload(raw.payload.length >= 2);
457
- const defaultVolume = raw.payload[0];
458
- const defaultToneId = raw.payload[1];
459
- return new SoundSwitchCCConfigurationSet_1({
460
- nodeId: ctx.sourceNodeId,
461
- defaultVolume,
462
- defaultToneId,
463
- });
464
- }
465
- defaultVolume;
466
- defaultToneId;
467
- serialize(ctx) {
468
- this.payload = Bytes.from([this.defaultVolume, this.defaultToneId]);
469
- return super.serialize(ctx);
470
- }
471
- toLogEntry(ctx) {
472
- return {
473
- ...super.toLogEntry(ctx),
474
- message: {
475
- "default volume": `${this.defaultVolume} %`,
476
- "default tone id": this.defaultToneId,
477
- },
478
- };
479
- }
480
- };
481
- SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet_1 = __decorate([
482
- CCCommand(SoundSwitchCommand.ConfigurationSet),
483
- useSupervision()
484
- ], SoundSwitchCCConfigurationSet);
550
+ let SoundSwitchCCConfigurationSet = (() => {
551
+ let _classDecorators = [CCCommand(SoundSwitchCommand.ConfigurationSet), useSupervision()];
552
+ let _classDescriptor;
553
+ let _classExtraInitializers = [];
554
+ let _classThis;
555
+ let _classSuper = SoundSwitchCC;
556
+ var SoundSwitchCCConfigurationSet = class extends _classSuper {
557
+ static { _classThis = this; }
558
+ static {
559
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
560
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
561
+ SoundSwitchCCConfigurationSet = _classThis = _classDescriptor.value;
562
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
563
+ __runInitializers(_classThis, _classExtraInitializers);
564
+ }
565
+ constructor(options) {
566
+ super(options);
567
+ this.defaultVolume = options.defaultVolume;
568
+ this.defaultToneId = options.defaultToneId;
569
+ }
570
+ static from(raw, ctx) {
571
+ validatePayload(raw.payload.length >= 2);
572
+ const defaultVolume = raw.payload[0];
573
+ const defaultToneId = raw.payload[1];
574
+ return new this({
575
+ nodeId: ctx.sourceNodeId,
576
+ defaultVolume,
577
+ defaultToneId,
578
+ });
579
+ }
580
+ defaultVolume;
581
+ defaultToneId;
582
+ serialize(ctx) {
583
+ this.payload = Bytes.from([this.defaultVolume, this.defaultToneId]);
584
+ return super.serialize(ctx);
585
+ }
586
+ toLogEntry(ctx) {
587
+ return {
588
+ ...super.toLogEntry(ctx),
589
+ message: {
590
+ "default volume": `${this.defaultVolume} %`,
591
+ "default tone id": this.defaultToneId,
592
+ },
593
+ };
594
+ }
595
+ };
596
+ return SoundSwitchCCConfigurationSet = _classThis;
597
+ })();
485
598
  export { SoundSwitchCCConfigurationSet };
486
- let SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = class SoundSwitchCCConfigurationReport extends SoundSwitchCC {
487
- constructor(options) {
488
- super(options);
489
- this.defaultVolume = options.defaultVolume;
490
- this.defaultToneId = options.defaultToneId;
491
- }
492
- static from(raw, ctx) {
493
- validatePayload(raw.payload.length >= 2);
494
- const defaultVolume = clamp(raw.payload[0], 0, 100);
495
- const defaultToneId = raw.payload[1];
496
- return new SoundSwitchCCConfigurationReport_1({
497
- nodeId: ctx.sourceNodeId,
498
- defaultVolume,
499
- defaultToneId,
500
- });
501
- }
502
- defaultVolume;
503
- defaultToneId;
504
- serialize(ctx) {
505
- this.payload = Bytes.from([this.defaultVolume, this.defaultToneId]);
506
- return super.serialize(ctx);
507
- }
508
- toLogEntry(ctx) {
509
- return {
510
- ...super.toLogEntry(ctx),
511
- message: {
512
- "default volume": `${this.defaultVolume} %`,
513
- "default tone id": this.defaultToneId,
514
- },
515
- };
516
- }
517
- };
518
- __decorate([
519
- ccValue(SoundSwitchCCValues.defaultVolume)
520
- ], SoundSwitchCCConfigurationReport.prototype, "defaultVolume", void 0);
521
- __decorate([
522
- ccValue(SoundSwitchCCValues.defaultToneId)
523
- ], SoundSwitchCCConfigurationReport.prototype, "defaultToneId", void 0);
524
- SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = __decorate([
525
- CCCommand(SoundSwitchCommand.ConfigurationReport)
526
- ], SoundSwitchCCConfigurationReport);
599
+ let SoundSwitchCCConfigurationReport = (() => {
600
+ let _classDecorators = [CCCommand(SoundSwitchCommand.ConfigurationReport), ccValueProperty("defaultVolume", SoundSwitchCCValues.defaultVolume), ccValueProperty("defaultToneId", SoundSwitchCCValues.defaultToneId)];
601
+ let _classDescriptor;
602
+ let _classExtraInitializers = [];
603
+ let _classThis;
604
+ let _classSuper = SoundSwitchCC;
605
+ var SoundSwitchCCConfigurationReport = class extends _classSuper {
606
+ static { _classThis = this; }
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
+ SoundSwitchCCConfigurationReport = _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.defaultVolume = options.defaultVolume;
617
+ this.defaultToneId = options.defaultToneId;
618
+ }
619
+ static from(raw, ctx) {
620
+ validatePayload(raw.payload.length >= 2);
621
+ const defaultVolume = clamp(raw.payload[0], 0, 100);
622
+ const defaultToneId = raw.payload[1];
623
+ return new this({
624
+ nodeId: ctx.sourceNodeId,
625
+ defaultVolume,
626
+ defaultToneId,
627
+ });
628
+ }
629
+ defaultVolume;
630
+ defaultToneId;
631
+ serialize(ctx) {
632
+ this.payload = Bytes.from([this.defaultVolume, this.defaultToneId]);
633
+ return super.serialize(ctx);
634
+ }
635
+ toLogEntry(ctx) {
636
+ return {
637
+ ...super.toLogEntry(ctx),
638
+ message: {
639
+ "default volume": `${this.defaultVolume} %`,
640
+ "default tone id": this.defaultToneId,
641
+ },
642
+ };
643
+ }
644
+ };
645
+ return SoundSwitchCCConfigurationReport = _classThis;
646
+ })();
527
647
  export { SoundSwitchCCConfigurationReport };
528
- let SoundSwitchCCConfigurationGet = class SoundSwitchCCConfigurationGet extends SoundSwitchCC {
529
- };
530
- SoundSwitchCCConfigurationGet = __decorate([
531
- CCCommand(SoundSwitchCommand.ConfigurationGet),
532
- expectedCCResponse(SoundSwitchCCConfigurationReport)
533
- ], SoundSwitchCCConfigurationGet);
648
+ let SoundSwitchCCConfigurationGet = (() => {
649
+ let _classDecorators = [CCCommand(SoundSwitchCommand.ConfigurationGet), expectedCCResponse(SoundSwitchCCConfigurationReport)];
650
+ let _classDescriptor;
651
+ let _classExtraInitializers = [];
652
+ let _classThis;
653
+ let _classSuper = SoundSwitchCC;
654
+ var SoundSwitchCCConfigurationGet = class extends _classSuper {
655
+ static { _classThis = this; }
656
+ static {
657
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
658
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
659
+ SoundSwitchCCConfigurationGet = _classThis = _classDescriptor.value;
660
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
661
+ __runInitializers(_classThis, _classExtraInitializers);
662
+ }
663
+ };
664
+ return SoundSwitchCCConfigurationGet = _classThis;
665
+ })();
534
666
  export { SoundSwitchCCConfigurationGet };
535
- let SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = class SoundSwitchCCTonePlaySet extends SoundSwitchCC {
536
- constructor(options) {
537
- super(options);
538
- this.toneId = options.toneId;
539
- this.volume = options.volume;
540
- }
541
- static from(raw, ctx) {
542
- validatePayload(raw.payload.length >= 1);
543
- const toneId = raw.payload[0];
544
- let volume;
545
- if (toneId !== 0 && raw.payload.length >= 2) {
546
- volume = raw.payload[1];
547
- }
548
- return new SoundSwitchCCTonePlaySet_1({
549
- nodeId: ctx.sourceNodeId,
550
- toneId,
551
- volume,
552
- });
553
- }
554
- toneId;
555
- volume;
556
- serialize(ctx) {
557
- this.payload = Bytes.from([this.toneId, this.volume ?? 0]);
558
- return super.serialize(ctx);
559
- }
560
- toLogEntry(ctx) {
561
- const message = {
562
- "tone id": this.toneId,
563
- };
564
- if (this.volume != undefined) {
565
- message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
566
- }
567
- return {
568
- ...super.toLogEntry(ctx),
569
- message,
570
- };
571
- }
572
- };
573
- SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = __decorate([
574
- CCCommand(SoundSwitchCommand.TonePlaySet),
575
- useSupervision()
576
- ], SoundSwitchCCTonePlaySet);
667
+ let SoundSwitchCCTonePlaySet = (() => {
668
+ let _classDecorators = [CCCommand(SoundSwitchCommand.TonePlaySet), useSupervision()];
669
+ let _classDescriptor;
670
+ let _classExtraInitializers = [];
671
+ let _classThis;
672
+ let _classSuper = SoundSwitchCC;
673
+ var SoundSwitchCCTonePlaySet = class extends _classSuper {
674
+ static { _classThis = this; }
675
+ static {
676
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
677
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
678
+ SoundSwitchCCTonePlaySet = _classThis = _classDescriptor.value;
679
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
680
+ __runInitializers(_classThis, _classExtraInitializers);
681
+ }
682
+ constructor(options) {
683
+ super(options);
684
+ this.toneId = options.toneId;
685
+ this.volume = options.volume;
686
+ }
687
+ static from(raw, ctx) {
688
+ validatePayload(raw.payload.length >= 1);
689
+ const toneId = raw.payload[0];
690
+ let volume;
691
+ if (toneId !== 0 && raw.payload.length >= 2) {
692
+ volume = raw.payload[1];
693
+ }
694
+ return new this({
695
+ nodeId: ctx.sourceNodeId,
696
+ toneId,
697
+ volume,
698
+ });
699
+ }
700
+ toneId;
701
+ volume;
702
+ serialize(ctx) {
703
+ this.payload = Bytes.from([this.toneId, this.volume ?? 0]);
704
+ return super.serialize(ctx);
705
+ }
706
+ toLogEntry(ctx) {
707
+ const message = {
708
+ "tone id": this.toneId,
709
+ };
710
+ if (this.volume != undefined) {
711
+ message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
712
+ }
713
+ return {
714
+ ...super.toLogEntry(ctx),
715
+ message,
716
+ };
717
+ }
718
+ };
719
+ return SoundSwitchCCTonePlaySet = _classThis;
720
+ })();
577
721
  export { SoundSwitchCCTonePlaySet };
578
- let SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport_1 = class SoundSwitchCCTonePlayReport extends SoundSwitchCC {
579
- constructor(options) {
580
- super(options);
581
- this.toneId = options.toneId;
582
- this.volume = options.volume;
583
- }
584
- static from(raw, ctx) {
585
- validatePayload(raw.payload.length >= 1);
586
- const toneId = raw.payload[0];
587
- let volume;
588
- if (toneId !== 0 && raw.payload.length >= 2) {
589
- volume = raw.payload[1];
590
- }
591
- return new SoundSwitchCCTonePlayReport_1({
592
- nodeId: ctx.sourceNodeId,
593
- toneId,
594
- volume,
595
- });
596
- }
597
- toneId;
598
- volume;
599
- serialize(ctx) {
600
- this.payload = Bytes.from([this.toneId, this.volume ?? 0]);
601
- return super.serialize(ctx);
602
- }
603
- toLogEntry(ctx) {
604
- const message = {
605
- "tone id": this.toneId,
606
- };
607
- if (this.volume != undefined) {
608
- message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
609
- }
610
- return {
611
- ...super.toLogEntry(ctx),
612
- message,
613
- };
614
- }
615
- };
616
- __decorate([
617
- ccValue(SoundSwitchCCValues.toneId)
618
- ], SoundSwitchCCTonePlayReport.prototype, "toneId", void 0);
619
- __decorate([
620
- ccValue(SoundSwitchCCValues.volume)
621
- ], SoundSwitchCCTonePlayReport.prototype, "volume", void 0);
622
- SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport_1 = __decorate([
623
- CCCommand(SoundSwitchCommand.TonePlayReport)
624
- ], SoundSwitchCCTonePlayReport);
722
+ let SoundSwitchCCTonePlayReport = (() => {
723
+ let _classDecorators = [CCCommand(SoundSwitchCommand.TonePlayReport), ccValueProperty("toneId", SoundSwitchCCValues.toneId), ccValueProperty("volume", SoundSwitchCCValues.volume)];
724
+ let _classDescriptor;
725
+ let _classExtraInitializers = [];
726
+ let _classThis;
727
+ let _classSuper = SoundSwitchCC;
728
+ var SoundSwitchCCTonePlayReport = class extends _classSuper {
729
+ static { _classThis = this; }
730
+ static {
731
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
732
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
733
+ SoundSwitchCCTonePlayReport = _classThis = _classDescriptor.value;
734
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
735
+ __runInitializers(_classThis, _classExtraInitializers);
736
+ }
737
+ constructor(options) {
738
+ super(options);
739
+ this.toneId = options.toneId;
740
+ this.volume = options.volume;
741
+ }
742
+ static from(raw, ctx) {
743
+ validatePayload(raw.payload.length >= 1);
744
+ const toneId = raw.payload[0];
745
+ let volume;
746
+ if (toneId !== 0 && raw.payload.length >= 2) {
747
+ volume = raw.payload[1];
748
+ }
749
+ return new this({
750
+ nodeId: ctx.sourceNodeId,
751
+ toneId,
752
+ volume,
753
+ });
754
+ }
755
+ toneId;
756
+ volume;
757
+ serialize(ctx) {
758
+ this.payload = Bytes.from([this.toneId, this.volume ?? 0]);
759
+ return super.serialize(ctx);
760
+ }
761
+ toLogEntry(ctx) {
762
+ const message = {
763
+ "tone id": this.toneId,
764
+ };
765
+ if (this.volume != undefined) {
766
+ message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
767
+ }
768
+ return {
769
+ ...super.toLogEntry(ctx),
770
+ message,
771
+ };
772
+ }
773
+ };
774
+ return SoundSwitchCCTonePlayReport = _classThis;
775
+ })();
625
776
  export { SoundSwitchCCTonePlayReport };
626
- let SoundSwitchCCTonePlayGet = class SoundSwitchCCTonePlayGet extends SoundSwitchCC {
627
- };
628
- SoundSwitchCCTonePlayGet = __decorate([
629
- CCCommand(SoundSwitchCommand.TonePlayGet),
630
- expectedCCResponse(SoundSwitchCCTonePlayReport)
631
- ], SoundSwitchCCTonePlayGet);
777
+ let SoundSwitchCCTonePlayGet = (() => {
778
+ let _classDecorators = [CCCommand(SoundSwitchCommand.TonePlayGet), expectedCCResponse(SoundSwitchCCTonePlayReport)];
779
+ let _classDescriptor;
780
+ let _classExtraInitializers = [];
781
+ let _classThis;
782
+ let _classSuper = SoundSwitchCC;
783
+ var SoundSwitchCCTonePlayGet = class extends _classSuper {
784
+ static { _classThis = this; }
785
+ static {
786
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
787
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
788
+ SoundSwitchCCTonePlayGet = _classThis = _classDescriptor.value;
789
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
790
+ __runInitializers(_classThis, _classExtraInitializers);
791
+ }
792
+ };
793
+ return SoundSwitchCCTonePlayGet = _classThis;
794
+ })();
632
795
  export { SoundSwitchCCTonePlayGet };
633
796
  //# sourceMappingURL=SoundSwitchCC.js.map