@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
@@ -42,13 +42,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
42
42
  var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
43
43
  var import_Values = require("../lib/Values.js");
44
44
  var import_Types = require("../lib/_Types.js");
45
- var __decorate = function(decorators, target, key, desc) {
46
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
47
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
48
- 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;
49
- return c > 3 && r && Object.defineProperty(target, key, r), r;
45
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
46
+ function accept(f) {
47
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
48
+ return f;
49
+ }
50
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
51
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
52
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
53
+ var _, done = false;
54
+ for (var i = decorators.length - 1; i >= 0; i--) {
55
+ var context = {};
56
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
57
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
58
+ context.addInitializer = function(f) {
59
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
60
+ extraInitializers.push(accept(f || null));
61
+ };
62
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
63
+ if (kind === "accessor") {
64
+ if (result === void 0) continue;
65
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
66
+ if (_ = accept(result.get)) descriptor.get = _;
67
+ if (_ = accept(result.set)) descriptor.set = _;
68
+ if (_ = accept(result.init)) initializers.unshift(_);
69
+ } else if (_ = accept(result)) {
70
+ if (kind === "field") initializers.unshift(_);
71
+ else descriptor[key] = _;
72
+ }
73
+ }
74
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
75
+ done = true;
76
+ };
77
+ var __runInitializers = function(thisArg, initializers, value) {
78
+ var useValue = arguments.length > 2;
79
+ for (var i = 0; i < initializers.length; i++) {
80
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
81
+ }
82
+ return useValue ? value : void 0;
50
83
  };
51
- var SoundSwitchCCTonesNumberReport_1, SoundSwitchCCToneInfoReport_1, SoundSwitchCCToneInfoGet_1, SoundSwitchCCConfigurationSet_1, SoundSwitchCCConfigurationReport_1, SoundSwitchCCTonePlaySet_1, SoundSwitchCCTonePlayReport_1;
52
84
  function __assertType(argName, typeName, boundHasError) {
53
85
  const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
54
86
  if (boundHasError()) {
@@ -108,540 +140,700 @@ const SoundSwitchCCValues = Object.freeze({
108
140
  })
109
141
  })
110
142
  });
111
- let SoundSwitchCCAPI = class SoundSwitchCCAPI2 extends import_API.CCAPI {
112
- supportsCommand(cmd) {
113
- switch (cmd) {
114
- case import_Types.SoundSwitchCommand.TonesNumberGet:
115
- case import_Types.SoundSwitchCommand.ToneInfoGet:
116
- case import_Types.SoundSwitchCommand.ConfigurationGet:
117
- case import_Types.SoundSwitchCommand.TonePlayGet:
118
- return this.isSinglecast();
119
- case import_Types.SoundSwitchCommand.ConfigurationSet:
120
- case import_Types.SoundSwitchCommand.TonePlaySet:
121
- return true;
122
- }
123
- return super.supportsCommand(cmd);
124
- }
125
- async getToneCount() {
126
- this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonesNumberGet);
127
- const cc = new SoundSwitchCCTonesNumberGet({
128
- nodeId: this.endpoint.nodeId,
129
- endpointIndex: this.endpoint.index
130
- });
131
- const response = await this.host.sendCommand(cc, this.commandOptions);
132
- return response?.toneCount;
133
- }
134
- async getToneInfo(toneId) {
135
- __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
136
- this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ToneInfoGet);
137
- const cc = new SoundSwitchCCToneInfoGet({
138
- nodeId: this.endpoint.nodeId,
139
- endpointIndex: this.endpoint.index,
140
- toneId
141
- });
142
- const response = await this.host.sendCommand(cc, this.commandOptions);
143
- if (response)
144
- return (0, import_safe3.pick)(response, ["duration", "name"]);
145
- }
146
- async setConfiguration(defaultToneId, defaultVolume) {
147
- __assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
148
- __assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
149
- this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ConfigurationSet);
150
- const cc = new SoundSwitchCCConfigurationSet({
151
- nodeId: this.endpoint.nodeId,
152
- endpointIndex: this.endpoint.index,
153
- defaultToneId,
154
- defaultVolume
155
- });
156
- return this.host.sendCommand(cc, this.commandOptions);
157
- }
158
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
159
- async getConfiguration() {
160
- this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ConfigurationGet);
161
- const cc = new SoundSwitchCCConfigurationGet({
162
- nodeId: this.endpoint.nodeId,
163
- endpointIndex: this.endpoint.index
164
- });
165
- const response = await this.host.sendCommand(cc, this.commandOptions);
166
- if (response) {
167
- return (0, import_safe3.pick)(response, ["defaultToneId", "defaultVolume"]);
143
+ let SoundSwitchCCAPI = (() => {
144
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Sound Switch"])];
145
+ let _classDescriptor;
146
+ let _classExtraInitializers = [];
147
+ let _classThis;
148
+ let _classSuper = import_API.CCAPI;
149
+ var SoundSwitchCCAPI2 = class extends _classSuper {
150
+ static {
151
+ _classThis = this;
168
152
  }
169
- }
170
- async play(toneId, volume) {
171
- __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
172
- __assertType("volume", "(optional) number", __assertType__optional_number.bind(void 0, volume));
173
- this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlaySet);
174
- if (toneId === 0) {
175
- throw new import_safe.ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
176
- }
177
- const cc = new SoundSwitchCCTonePlaySet({
178
- nodeId: this.endpoint.nodeId,
179
- endpointIndex: this.endpoint.index,
180
- toneId,
181
- volume
182
- });
183
- return this.host.sendCommand(cc, this.commandOptions);
184
- }
185
- async stopPlaying() {
186
- this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlaySet);
187
- const cc = new SoundSwitchCCTonePlaySet({
188
- nodeId: this.endpoint.nodeId,
189
- endpointIndex: this.endpoint.index,
190
- toneId: 0,
191
- volume: 0
192
- });
193
- return this.host.sendCommand(cc, this.commandOptions);
194
- }
195
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
196
- async getPlaying() {
197
- this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlayGet);
198
- const cc = new SoundSwitchCCTonePlayGet({
199
- nodeId: this.endpoint.nodeId,
200
- endpointIndex: this.endpoint.index
201
- });
202
- const response = await this.host.sendCommand(cc, this.commandOptions);
203
- if (response) {
204
- return (0, import_safe3.pick)(response, ["toneId", "volume"]);
153
+ static {
154
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
155
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
156
+ SoundSwitchCCAPI2 = _classThis = _classDescriptor.value;
157
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
158
+ __runInitializers(_classThis, _classExtraInitializers);
205
159
  }
206
- }
207
- get [import_API.SET_VALUE]() {
208
- return async function({ property }, value, options) {
209
- if (property === "defaultToneId") {
210
- if (typeof value !== "number") {
211
- (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
212
- }
213
- return this.setConfiguration(value, 255);
214
- } else if (property === "defaultVolume") {
215
- if (typeof value !== "number") {
216
- (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
217
- }
218
- return this.setConfiguration(
219
- 0,
220
- /* keep current tone */
221
- value
222
- );
223
- } else if (property === "volume") {
224
- if (typeof value !== "number") {
225
- (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
226
- }
227
- this.tryGetValueDB()?.setValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index), value, { source: "driver", updateTimestamp: false });
228
- } else if (property === "toneId") {
229
- if (typeof value !== "number") {
230
- (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
231
- }
232
- let result;
233
- if (value > 0) {
234
- const volume = options?.volume !== void 0 ? options.volume : this.tryGetValueDB()?.getValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index));
235
- result = await this.play(value, volume);
160
+ supportsCommand(cmd) {
161
+ switch (cmd) {
162
+ case import_Types.SoundSwitchCommand.TonesNumberGet:
163
+ case import_Types.SoundSwitchCommand.ToneInfoGet:
164
+ case import_Types.SoundSwitchCommand.ConfigurationGet:
165
+ case import_Types.SoundSwitchCommand.TonePlayGet:
166
+ return this.isSinglecast();
167
+ case import_Types.SoundSwitchCommand.ConfigurationSet:
168
+ case import_Types.SoundSwitchCommand.TonePlaySet:
169
+ return true;
170
+ }
171
+ return super.supportsCommand(cmd);
172
+ }
173
+ async getToneCount() {
174
+ this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonesNumberGet);
175
+ const cc = new SoundSwitchCCTonesNumberGet({
176
+ nodeId: this.endpoint.nodeId,
177
+ endpointIndex: this.endpoint.index
178
+ });
179
+ const response = await this.host.sendCommand(cc, this.commandOptions);
180
+ return response?.toneCount;
181
+ }
182
+ async getToneInfo(toneId) {
183
+ __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
184
+ this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ToneInfoGet);
185
+ const cc = new SoundSwitchCCToneInfoGet({
186
+ nodeId: this.endpoint.nodeId,
187
+ endpointIndex: this.endpoint.index,
188
+ toneId
189
+ });
190
+ const response = await this.host.sendCommand(cc, this.commandOptions);
191
+ if (response)
192
+ return (0, import_safe3.pick)(response, ["duration", "name"]);
193
+ }
194
+ async setConfiguration(defaultToneId, defaultVolume) {
195
+ __assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
196
+ __assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
197
+ this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ConfigurationSet);
198
+ const cc = new SoundSwitchCCConfigurationSet({
199
+ nodeId: this.endpoint.nodeId,
200
+ endpointIndex: this.endpoint.index,
201
+ defaultToneId,
202
+ defaultVolume
203
+ });
204
+ return this.host.sendCommand(cc, this.commandOptions);
205
+ }
206
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
207
+ async getConfiguration() {
208
+ this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ConfigurationGet);
209
+ const cc = new SoundSwitchCCConfigurationGet({
210
+ nodeId: this.endpoint.nodeId,
211
+ endpointIndex: this.endpoint.index
212
+ });
213
+ const response = await this.host.sendCommand(cc, this.commandOptions);
214
+ if (response) {
215
+ return (0, import_safe3.pick)(response, ["defaultToneId", "defaultVolume"]);
216
+ }
217
+ }
218
+ async play(toneId, volume) {
219
+ __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
220
+ __assertType("volume", "(optional) number", __assertType__optional_number.bind(void 0, volume));
221
+ this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlaySet);
222
+ if (toneId === 0) {
223
+ throw new import_safe.ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
224
+ }
225
+ const cc = new SoundSwitchCCTonePlaySet({
226
+ nodeId: this.endpoint.nodeId,
227
+ endpointIndex: this.endpoint.index,
228
+ toneId,
229
+ volume
230
+ });
231
+ return this.host.sendCommand(cc, this.commandOptions);
232
+ }
233
+ async stopPlaying() {
234
+ this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlaySet);
235
+ const cc = new SoundSwitchCCTonePlaySet({
236
+ nodeId: this.endpoint.nodeId,
237
+ endpointIndex: this.endpoint.index,
238
+ toneId: 0,
239
+ volume: 0
240
+ });
241
+ return this.host.sendCommand(cc, this.commandOptions);
242
+ }
243
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
244
+ async getPlaying() {
245
+ this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlayGet);
246
+ const cc = new SoundSwitchCCTonePlayGet({
247
+ nodeId: this.endpoint.nodeId,
248
+ endpointIndex: this.endpoint.index
249
+ });
250
+ const response = await this.host.sendCommand(cc, this.commandOptions);
251
+ if (response) {
252
+ return (0, import_safe3.pick)(response, ["toneId", "volume"]);
253
+ }
254
+ }
255
+ get [import_API.SET_VALUE]() {
256
+ return async function({ property }, value, options) {
257
+ if (property === "defaultToneId") {
258
+ if (typeof value !== "number") {
259
+ (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
260
+ }
261
+ return this.setConfiguration(value, 255);
262
+ } else if (property === "defaultVolume") {
263
+ if (typeof value !== "number") {
264
+ (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
265
+ }
266
+ return this.setConfiguration(
267
+ 0,
268
+ /* keep current tone */
269
+ value
270
+ );
271
+ } else if (property === "volume") {
272
+ if (typeof value !== "number") {
273
+ (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
274
+ }
275
+ this.tryGetValueDB()?.setValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index), value, { source: "driver", updateTimestamp: false });
276
+ } else if (property === "toneId") {
277
+ if (typeof value !== "number") {
278
+ (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
279
+ }
280
+ let result;
281
+ if (value > 0) {
282
+ const volume = options?.volume !== void 0 ? options.volume : this.tryGetValueDB()?.getValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index));
283
+ result = await this.play(value, volume);
284
+ } else {
285
+ result = await this.stopPlaying();
286
+ }
287
+ if (this.isSinglecast() && !(0, import_safe.supervisedCommandSucceeded)(result)) {
288
+ this.schedulePoll({ property }, value, {
289
+ transition: "fast"
290
+ });
291
+ }
292
+ return result;
236
293
  } else {
237
- result = await this.stopPlaying();
294
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
238
295
  }
239
- if (this.isSinglecast() && !(0, import_safe.supervisedCommandSucceeded)(result)) {
240
- this.schedulePoll({ property }, value, {
241
- transition: "fast"
242
- });
296
+ };
297
+ }
298
+ get [import_API.POLL_VALUE]() {
299
+ return async function({ property }) {
300
+ switch (property) {
301
+ case "defaultToneId":
302
+ case "defaultVolume":
303
+ return (await this.getConfiguration())?.[property];
304
+ case "toneId":
305
+ case "volume":
306
+ return (await this.getPlaying())?.[property];
307
+ default:
308
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
243
309
  }
244
- return result;
245
- } else {
246
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
247
- }
248
- };
249
- }
250
- get [import_API.POLL_VALUE]() {
251
- return async function({ property }) {
252
- switch (property) {
253
- case "defaultToneId":
254
- case "defaultVolume":
255
- return (await this.getConfiguration())?.[property];
256
- case "toneId":
257
- case "volume":
258
- return (await this.getPlaying())?.[property];
259
- default:
260
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
261
- }
262
- };
263
- }
264
- };
265
- SoundSwitchCCAPI = __decorate([
266
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Sound Switch"])
267
- ], SoundSwitchCCAPI);
268
- let SoundSwitchCC = class SoundSwitchCC2 extends import_CommandClass.CommandClass {
269
- async interview(ctx) {
270
- const node = this.getNode(ctx);
271
- const endpoint = this.getEndpoint(ctx);
272
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
273
- priority: import_safe.MessagePriority.NodeQuery
274
- });
275
- ctx.logNode(node.id, {
276
- endpoint: this.endpointIndex,
277
- message: `Interviewing ${this.ccName}...`,
278
- direction: "none"
279
- });
280
- ctx.logNode(node.id, {
281
- message: "requesting tone count...",
282
- direction: "outbound"
283
- });
284
- const toneCount = await api.getToneCount();
285
- if (toneCount != void 0) {
286
- const logMessage = `supports ${toneCount} tones`;
287
- ctx.logNode(node.id, {
288
- message: logMessage,
289
- direction: "inbound"
310
+ };
311
+ }
312
+ };
313
+ return SoundSwitchCCAPI2 = _classThis;
314
+ })();
315
+ let SoundSwitchCC = (() => {
316
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Sound Switch"]), (0, import_CommandClassDecorators.implementedVersion)(2), (0, import_CommandClassDecorators.ccValues)(SoundSwitchCCValues)];
317
+ let _classDescriptor;
318
+ let _classExtraInitializers = [];
319
+ let _classThis;
320
+ let _classSuper = import_CommandClass.CommandClass;
321
+ var SoundSwitchCC2 = class extends _classSuper {
322
+ static {
323
+ _classThis = this;
324
+ }
325
+ static {
326
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
327
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
328
+ SoundSwitchCC2 = _classThis = _classDescriptor.value;
329
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
330
+ __runInitializers(_classThis, _classExtraInitializers);
331
+ }
332
+ async interview(ctx) {
333
+ const node = this.getNode(ctx);
334
+ const endpoint = this.getEndpoint(ctx);
335
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
336
+ priority: import_safe.MessagePriority.NodeQuery
290
337
  });
291
- } else {
292
338
  ctx.logNode(node.id, {
293
339
  endpoint: this.endpointIndex,
294
- message: "Querying tone count timed out, skipping interview...",
295
- level: "warn"
340
+ message: `Interviewing ${this.ccName}...`,
341
+ direction: "none"
296
342
  });
297
- return;
298
- }
299
- ctx.logNode(node.id, {
300
- message: "requesting current sound configuration...",
301
- direction: "outbound"
302
- });
303
- const config = await api.getConfiguration();
304
- if (config) {
305
- const logMessage = `received current sound configuration:
306
- default tone ID: ${config.defaultToneId}
307
- default volume: ${config.defaultVolume}`;
308
343
  ctx.logNode(node.id, {
309
- message: logMessage,
310
- direction: "inbound"
344
+ message: "requesting tone count...",
345
+ direction: "outbound"
311
346
  });
312
- }
313
- const metadataStates = {};
314
- for (let toneId = 1; toneId <= toneCount; toneId++) {
347
+ const toneCount = await api.getToneCount();
348
+ if (toneCount != void 0) {
349
+ const logMessage = `supports ${toneCount} tones`;
350
+ ctx.logNode(node.id, {
351
+ message: logMessage,
352
+ direction: "inbound"
353
+ });
354
+ } else {
355
+ ctx.logNode(node.id, {
356
+ endpoint: this.endpointIndex,
357
+ message: "Querying tone count timed out, skipping interview...",
358
+ level: "warn"
359
+ });
360
+ return;
361
+ }
315
362
  ctx.logNode(node.id, {
316
- message: `requesting info for tone #${toneId}`,
363
+ message: "requesting current sound configuration...",
317
364
  direction: "outbound"
318
365
  });
319
- const info = await api.getToneInfo(toneId);
320
- if (!info)
321
- continue;
322
- const logMessage = `received info for tone #${toneId}:
366
+ const config = await api.getConfiguration();
367
+ if (config) {
368
+ const logMessage = `received current sound configuration:
369
+ default tone ID: ${config.defaultToneId}
370
+ default volume: ${config.defaultVolume}`;
371
+ ctx.logNode(node.id, {
372
+ message: logMessage,
373
+ direction: "inbound"
374
+ });
375
+ }
376
+ const metadataStates = {};
377
+ for (let toneId = 1; toneId <= toneCount; toneId++) {
378
+ ctx.logNode(node.id, {
379
+ message: `requesting info for tone #${toneId}`,
380
+ direction: "outbound"
381
+ });
382
+ const info = await api.getToneInfo(toneId);
383
+ if (!info)
384
+ continue;
385
+ const logMessage = `received info for tone #${toneId}:
323
386
  name: ${info.name}
324
387
  duration: ${info.duration} seconds`;
325
- ctx.logNode(node.id, {
326
- message: logMessage,
327
- direction: "inbound"
388
+ ctx.logNode(node.id, {
389
+ message: logMessage,
390
+ direction: "inbound"
391
+ });
392
+ metadataStates[toneId] = `${info.name} (${info.duration} sec)`;
393
+ }
394
+ this.setMetadata(ctx, SoundSwitchCCValues.defaultToneId, {
395
+ ...SoundSwitchCCValues.defaultToneId.meta,
396
+ min: 1,
397
+ max: toneCount,
398
+ states: metadataStates
399
+ });
400
+ this.setMetadata(ctx, SoundSwitchCCValues.toneId, {
401
+ ...SoundSwitchCCValues.toneId.meta,
402
+ min: 0,
403
+ max: toneCount,
404
+ states: {
405
+ 0: "off",
406
+ ...metadataStates,
407
+ [255]: "default"
408
+ }
328
409
  });
329
- metadataStates[toneId] = `${info.name} (${info.duration} sec)`;
410
+ this.setInterviewComplete(ctx, true);
330
411
  }
331
- this.setMetadata(ctx, SoundSwitchCCValues.defaultToneId, {
332
- ...SoundSwitchCCValues.defaultToneId.meta,
333
- min: 1,
334
- max: toneCount,
335
- states: metadataStates
336
- });
337
- this.setMetadata(ctx, SoundSwitchCCValues.toneId, {
338
- ...SoundSwitchCCValues.toneId.meta,
339
- min: 0,
340
- max: toneCount,
341
- states: {
342
- 0: "off",
343
- ...metadataStates,
344
- [255]: "default"
345
- }
346
- });
347
- this.setInterviewComplete(ctx, true);
348
- }
349
- };
350
- SoundSwitchCC = __decorate([
351
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Sound Switch"]),
352
- (0, import_CommandClassDecorators.implementedVersion)(2),
353
- (0, import_CommandClassDecorators.ccValues)(SoundSwitchCCValues)
354
- ], SoundSwitchCC);
355
- let SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport_1 = class SoundSwitchCCTonesNumberReport2 extends SoundSwitchCC {
356
- constructor(options) {
357
- super(options);
358
- this.toneCount = options.toneCount;
359
- }
360
- static from(raw, ctx) {
361
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
362
- const toneCount = raw.payload[0];
363
- return new SoundSwitchCCTonesNumberReport_1({
364
- nodeId: ctx.sourceNodeId,
365
- toneCount
366
- });
367
- }
368
- toneCount;
369
- serialize(ctx) {
370
- this.payload = import_safe2.Bytes.from([this.toneCount]);
371
- return super.serialize(ctx);
372
- }
373
- toLogEntry(ctx) {
374
- return {
375
- ...super.toLogEntry(ctx),
376
- message: { "# of tones": this.toneCount }
377
- };
378
- }
379
- };
380
- SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport_1 = __decorate([
381
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonesNumberReport)
382
- ], SoundSwitchCCTonesNumberReport);
383
- let SoundSwitchCCTonesNumberGet = class SoundSwitchCCTonesNumberGet2 extends SoundSwitchCC {
384
- };
385
- SoundSwitchCCTonesNumberGet = __decorate([
386
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonesNumberGet),
387
- (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCTonesNumberReport)
388
- ], SoundSwitchCCTonesNumberGet);
389
- let SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport_1 = class SoundSwitchCCToneInfoReport2 extends SoundSwitchCC {
390
- constructor(options) {
391
- super(options);
392
- this.toneId = options.toneId;
393
- this.duration = options.duration;
394
- this.name = options.name;
395
- }
396
- static from(raw, ctx) {
397
- (0, import_safe.validatePayload)(raw.payload.length >= 4);
398
- const toneId = raw.payload[0];
399
- const duration = raw.payload.readUInt16BE(1);
400
- const nameLength = raw.payload[3];
401
- (0, import_safe.validatePayload)(raw.payload.length >= 4 + nameLength);
402
- const name = raw.payload.subarray(4, 4 + nameLength).toString("utf8");
403
- return new SoundSwitchCCToneInfoReport_1({
404
- nodeId: ctx.sourceNodeId,
405
- toneId,
406
- duration,
407
- name
408
- });
409
- }
410
- toneId;
411
- duration;
412
- name;
413
- serialize(ctx) {
414
- this.payload = import_safe2.Bytes.concat([
415
- import_safe2.Bytes.from([this.toneId, 0, 0, this.name.length]),
416
- import_safe2.Bytes.from(this.name, "utf8")
417
- ]);
418
- this.payload.writeUInt16BE(this.duration, 1);
419
- return super.serialize(ctx);
420
- }
421
- toLogEntry(ctx) {
422
- return {
423
- ...super.toLogEntry(ctx),
424
- message: {
425
- "tone id": this.toneId,
426
- duration: `${this.duration} seconds`,
427
- name: this.name
428
- }
429
- };
430
- }
431
- };
432
- SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport_1 = __decorate([
433
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ToneInfoReport)
434
- ], SoundSwitchCCToneInfoReport);
412
+ };
413
+ return SoundSwitchCC2 = _classThis;
414
+ })();
415
+ let SoundSwitchCCTonesNumberReport = (() => {
416
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonesNumberReport)];
417
+ let _classDescriptor;
418
+ let _classExtraInitializers = [];
419
+ let _classThis;
420
+ let _classSuper = SoundSwitchCC;
421
+ var SoundSwitchCCTonesNumberReport2 = class extends _classSuper {
422
+ static {
423
+ _classThis = this;
424
+ }
425
+ static {
426
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
427
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
428
+ SoundSwitchCCTonesNumberReport2 = _classThis = _classDescriptor.value;
429
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
430
+ __runInitializers(_classThis, _classExtraInitializers);
431
+ }
432
+ constructor(options) {
433
+ super(options);
434
+ this.toneCount = options.toneCount;
435
+ }
436
+ static from(raw, ctx) {
437
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
438
+ const toneCount = raw.payload[0];
439
+ return new this({
440
+ nodeId: ctx.sourceNodeId,
441
+ toneCount
442
+ });
443
+ }
444
+ toneCount;
445
+ serialize(ctx) {
446
+ this.payload = import_safe2.Bytes.from([this.toneCount]);
447
+ return super.serialize(ctx);
448
+ }
449
+ toLogEntry(ctx) {
450
+ return {
451
+ ...super.toLogEntry(ctx),
452
+ message: { "# of tones": this.toneCount }
453
+ };
454
+ }
455
+ };
456
+ return SoundSwitchCCTonesNumberReport2 = _classThis;
457
+ })();
458
+ let SoundSwitchCCTonesNumberGet = (() => {
459
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonesNumberGet), (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCTonesNumberReport)];
460
+ let _classDescriptor;
461
+ let _classExtraInitializers = [];
462
+ let _classThis;
463
+ let _classSuper = SoundSwitchCC;
464
+ var SoundSwitchCCTonesNumberGet2 = class extends _classSuper {
465
+ static {
466
+ _classThis = this;
467
+ }
468
+ static {
469
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
470
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
471
+ SoundSwitchCCTonesNumberGet2 = _classThis = _classDescriptor.value;
472
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
473
+ __runInitializers(_classThis, _classExtraInitializers);
474
+ }
475
+ };
476
+ return SoundSwitchCCTonesNumberGet2 = _classThis;
477
+ })();
478
+ let SoundSwitchCCToneInfoReport = (() => {
479
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ToneInfoReport)];
480
+ let _classDescriptor;
481
+ let _classExtraInitializers = [];
482
+ let _classThis;
483
+ let _classSuper = SoundSwitchCC;
484
+ var SoundSwitchCCToneInfoReport2 = class extends _classSuper {
485
+ static {
486
+ _classThis = this;
487
+ }
488
+ static {
489
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
490
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
491
+ SoundSwitchCCToneInfoReport2 = _classThis = _classDescriptor.value;
492
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
493
+ __runInitializers(_classThis, _classExtraInitializers);
494
+ }
495
+ constructor(options) {
496
+ super(options);
497
+ this.toneId = options.toneId;
498
+ this.duration = options.duration;
499
+ this.name = options.name;
500
+ }
501
+ static from(raw, ctx) {
502
+ (0, import_safe.validatePayload)(raw.payload.length >= 4);
503
+ const toneId = raw.payload[0];
504
+ const duration = raw.payload.readUInt16BE(1);
505
+ const nameLength = raw.payload[3];
506
+ (0, import_safe.validatePayload)(raw.payload.length >= 4 + nameLength);
507
+ const name = raw.payload.subarray(4, 4 + nameLength).toString("utf8");
508
+ return new this({
509
+ nodeId: ctx.sourceNodeId,
510
+ toneId,
511
+ duration,
512
+ name
513
+ });
514
+ }
515
+ toneId;
516
+ duration;
517
+ name;
518
+ serialize(ctx) {
519
+ this.payload = import_safe2.Bytes.concat([
520
+ import_safe2.Bytes.from([this.toneId, 0, 0, this.name.length]),
521
+ import_safe2.Bytes.from(this.name, "utf8")
522
+ ]);
523
+ this.payload.writeUInt16BE(this.duration, 1);
524
+ return super.serialize(ctx);
525
+ }
526
+ toLogEntry(ctx) {
527
+ return {
528
+ ...super.toLogEntry(ctx),
529
+ message: {
530
+ "tone id": this.toneId,
531
+ duration: `${this.duration} seconds`,
532
+ name: this.name
533
+ }
534
+ };
535
+ }
536
+ };
537
+ return SoundSwitchCCToneInfoReport2 = _classThis;
538
+ })();
435
539
  const testResponseForSoundSwitchToneInfoGet = (sent, received) => {
436
540
  return received.toneId === sent.toneId;
437
541
  };
438
- let SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet_1 = class SoundSwitchCCToneInfoGet2 extends SoundSwitchCC {
439
- constructor(options) {
440
- super(options);
441
- this.toneId = options.toneId;
442
- }
443
- static from(raw, ctx) {
444
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
445
- const toneId = raw.payload[0];
446
- return new SoundSwitchCCToneInfoGet_1({
447
- nodeId: ctx.sourceNodeId,
448
- toneId
449
- });
450
- }
451
- toneId;
452
- serialize(ctx) {
453
- this.payload = import_safe2.Bytes.from([this.toneId]);
454
- return super.serialize(ctx);
455
- }
456
- toLogEntry(ctx) {
457
- return {
458
- ...super.toLogEntry(ctx),
459
- message: { "tone id": this.toneId }
460
- };
461
- }
462
- };
463
- SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet_1 = __decorate([
464
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ToneInfoGet),
465
- (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCToneInfoReport, testResponseForSoundSwitchToneInfoGet)
466
- ], SoundSwitchCCToneInfoGet);
467
- let SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet_1 = class SoundSwitchCCConfigurationSet2 extends SoundSwitchCC {
468
- constructor(options) {
469
- super(options);
470
- this.defaultVolume = options.defaultVolume;
471
- this.defaultToneId = options.defaultToneId;
472
- }
473
- static from(raw, ctx) {
474
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
475
- const defaultVolume = raw.payload[0];
476
- const defaultToneId = raw.payload[1];
477
- return new SoundSwitchCCConfigurationSet_1({
478
- nodeId: ctx.sourceNodeId,
479
- defaultVolume,
480
- defaultToneId
481
- });
482
- }
483
- defaultVolume;
484
- defaultToneId;
485
- serialize(ctx) {
486
- this.payload = import_safe2.Bytes.from([this.defaultVolume, this.defaultToneId]);
487
- return super.serialize(ctx);
488
- }
489
- toLogEntry(ctx) {
490
- return {
491
- ...super.toLogEntry(ctx),
492
- message: {
493
- "default volume": `${this.defaultVolume} %`,
494
- "default tone id": this.defaultToneId
542
+ let SoundSwitchCCToneInfoGet = (() => {
543
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ToneInfoGet), (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCToneInfoReport, testResponseForSoundSwitchToneInfoGet)];
544
+ let _classDescriptor;
545
+ let _classExtraInitializers = [];
546
+ let _classThis;
547
+ let _classSuper = SoundSwitchCC;
548
+ var SoundSwitchCCToneInfoGet2 = class extends _classSuper {
549
+ static {
550
+ _classThis = this;
551
+ }
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
+ SoundSwitchCCToneInfoGet2 = _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.toneId = options.toneId;
562
+ }
563
+ static from(raw, ctx) {
564
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
565
+ const toneId = raw.payload[0];
566
+ return new this({
567
+ nodeId: ctx.sourceNodeId,
568
+ toneId
569
+ });
570
+ }
571
+ toneId;
572
+ serialize(ctx) {
573
+ this.payload = import_safe2.Bytes.from([this.toneId]);
574
+ return super.serialize(ctx);
575
+ }
576
+ toLogEntry(ctx) {
577
+ return {
578
+ ...super.toLogEntry(ctx),
579
+ message: { "tone id": this.toneId }
580
+ };
581
+ }
582
+ };
583
+ return SoundSwitchCCToneInfoGet2 = _classThis;
584
+ })();
585
+ let SoundSwitchCCConfigurationSet = (() => {
586
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationSet), (0, import_CommandClassDecorators.useSupervision)()];
587
+ let _classDescriptor;
588
+ let _classExtraInitializers = [];
589
+ let _classThis;
590
+ let _classSuper = SoundSwitchCC;
591
+ var SoundSwitchCCConfigurationSet2 = class extends _classSuper {
592
+ static {
593
+ _classThis = this;
594
+ }
595
+ static {
596
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
597
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
598
+ SoundSwitchCCConfigurationSet2 = _classThis = _classDescriptor.value;
599
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
600
+ __runInitializers(_classThis, _classExtraInitializers);
601
+ }
602
+ constructor(options) {
603
+ super(options);
604
+ this.defaultVolume = options.defaultVolume;
605
+ this.defaultToneId = options.defaultToneId;
606
+ }
607
+ static from(raw, ctx) {
608
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
609
+ const defaultVolume = raw.payload[0];
610
+ const defaultToneId = raw.payload[1];
611
+ return new this({
612
+ nodeId: ctx.sourceNodeId,
613
+ defaultVolume,
614
+ defaultToneId
615
+ });
616
+ }
617
+ defaultVolume;
618
+ defaultToneId;
619
+ serialize(ctx) {
620
+ this.payload = import_safe2.Bytes.from([this.defaultVolume, this.defaultToneId]);
621
+ return super.serialize(ctx);
622
+ }
623
+ toLogEntry(ctx) {
624
+ return {
625
+ ...super.toLogEntry(ctx),
626
+ message: {
627
+ "default volume": `${this.defaultVolume} %`,
628
+ "default tone id": this.defaultToneId
629
+ }
630
+ };
631
+ }
632
+ };
633
+ return SoundSwitchCCConfigurationSet2 = _classThis;
634
+ })();
635
+ let SoundSwitchCCConfigurationReport = (() => {
636
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationReport), (0, import_CommandClassDecorators.ccValueProperty)("defaultVolume", SoundSwitchCCValues.defaultVolume), (0, import_CommandClassDecorators.ccValueProperty)("defaultToneId", SoundSwitchCCValues.defaultToneId)];
637
+ let _classDescriptor;
638
+ let _classExtraInitializers = [];
639
+ let _classThis;
640
+ let _classSuper = SoundSwitchCC;
641
+ var SoundSwitchCCConfigurationReport2 = class extends _classSuper {
642
+ static {
643
+ _classThis = this;
644
+ }
645
+ static {
646
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
647
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
648
+ SoundSwitchCCConfigurationReport2 = _classThis = _classDescriptor.value;
649
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
650
+ __runInitializers(_classThis, _classExtraInitializers);
651
+ }
652
+ constructor(options) {
653
+ super(options);
654
+ this.defaultVolume = options.defaultVolume;
655
+ this.defaultToneId = options.defaultToneId;
656
+ }
657
+ static from(raw, ctx) {
658
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
659
+ const defaultVolume = (0, import_math.clamp)(raw.payload[0], 0, 100);
660
+ const defaultToneId = raw.payload[1];
661
+ return new this({
662
+ nodeId: ctx.sourceNodeId,
663
+ defaultVolume,
664
+ defaultToneId
665
+ });
666
+ }
667
+ defaultVolume;
668
+ defaultToneId;
669
+ serialize(ctx) {
670
+ this.payload = import_safe2.Bytes.from([this.defaultVolume, this.defaultToneId]);
671
+ return super.serialize(ctx);
672
+ }
673
+ toLogEntry(ctx) {
674
+ return {
675
+ ...super.toLogEntry(ctx),
676
+ message: {
677
+ "default volume": `${this.defaultVolume} %`,
678
+ "default tone id": this.defaultToneId
679
+ }
680
+ };
681
+ }
682
+ };
683
+ return SoundSwitchCCConfigurationReport2 = _classThis;
684
+ })();
685
+ let SoundSwitchCCConfigurationGet = (() => {
686
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationGet), (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCConfigurationReport)];
687
+ let _classDescriptor;
688
+ let _classExtraInitializers = [];
689
+ let _classThis;
690
+ let _classSuper = SoundSwitchCC;
691
+ var SoundSwitchCCConfigurationGet2 = class extends _classSuper {
692
+ static {
693
+ _classThis = this;
694
+ }
695
+ static {
696
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
697
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
698
+ SoundSwitchCCConfigurationGet2 = _classThis = _classDescriptor.value;
699
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
700
+ __runInitializers(_classThis, _classExtraInitializers);
701
+ }
702
+ };
703
+ return SoundSwitchCCConfigurationGet2 = _classThis;
704
+ })();
705
+ let SoundSwitchCCTonePlaySet = (() => {
706
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlaySet), (0, import_CommandClassDecorators.useSupervision)()];
707
+ let _classDescriptor;
708
+ let _classExtraInitializers = [];
709
+ let _classThis;
710
+ let _classSuper = SoundSwitchCC;
711
+ var SoundSwitchCCTonePlaySet2 = class extends _classSuper {
712
+ static {
713
+ _classThis = this;
714
+ }
715
+ static {
716
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
717
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
718
+ SoundSwitchCCTonePlaySet2 = _classThis = _classDescriptor.value;
719
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
720
+ __runInitializers(_classThis, _classExtraInitializers);
721
+ }
722
+ constructor(options) {
723
+ super(options);
724
+ this.toneId = options.toneId;
725
+ this.volume = options.volume;
726
+ }
727
+ static from(raw, ctx) {
728
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
729
+ const toneId = raw.payload[0];
730
+ let volume;
731
+ if (toneId !== 0 && raw.payload.length >= 2) {
732
+ volume = raw.payload[1];
495
733
  }
496
- };
497
- }
498
- };
499
- SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet_1 = __decorate([
500
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationSet),
501
- (0, import_CommandClassDecorators.useSupervision)()
502
- ], SoundSwitchCCConfigurationSet);
503
- let SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = class SoundSwitchCCConfigurationReport2 extends SoundSwitchCC {
504
- constructor(options) {
505
- super(options);
506
- this.defaultVolume = options.defaultVolume;
507
- this.defaultToneId = options.defaultToneId;
508
- }
509
- static from(raw, ctx) {
510
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
511
- const defaultVolume = (0, import_math.clamp)(raw.payload[0], 0, 100);
512
- const defaultToneId = raw.payload[1];
513
- return new SoundSwitchCCConfigurationReport_1({
514
- nodeId: ctx.sourceNodeId,
515
- defaultVolume,
516
- defaultToneId
517
- });
518
- }
519
- defaultVolume;
520
- defaultToneId;
521
- serialize(ctx) {
522
- this.payload = import_safe2.Bytes.from([this.defaultVolume, this.defaultToneId]);
523
- return super.serialize(ctx);
524
- }
525
- toLogEntry(ctx) {
526
- return {
527
- ...super.toLogEntry(ctx),
528
- message: {
529
- "default volume": `${this.defaultVolume} %`,
530
- "default tone id": this.defaultToneId
734
+ return new this({
735
+ nodeId: ctx.sourceNodeId,
736
+ toneId,
737
+ volume
738
+ });
739
+ }
740
+ toneId;
741
+ volume;
742
+ serialize(ctx) {
743
+ this.payload = import_safe2.Bytes.from([this.toneId, this.volume ?? 0]);
744
+ return super.serialize(ctx);
745
+ }
746
+ toLogEntry(ctx) {
747
+ const message = {
748
+ "tone id": this.toneId
749
+ };
750
+ if (this.volume != void 0) {
751
+ message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
531
752
  }
532
- };
533
- }
534
- };
535
- __decorate([
536
- (0, import_CommandClassDecorators.ccValue)(SoundSwitchCCValues.defaultVolume)
537
- ], SoundSwitchCCConfigurationReport.prototype, "defaultVolume", void 0);
538
- __decorate([
539
- (0, import_CommandClassDecorators.ccValue)(SoundSwitchCCValues.defaultToneId)
540
- ], SoundSwitchCCConfigurationReport.prototype, "defaultToneId", void 0);
541
- SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = __decorate([
542
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationReport)
543
- ], SoundSwitchCCConfigurationReport);
544
- let SoundSwitchCCConfigurationGet = class SoundSwitchCCConfigurationGet2 extends SoundSwitchCC {
545
- };
546
- SoundSwitchCCConfigurationGet = __decorate([
547
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationGet),
548
- (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCConfigurationReport)
549
- ], SoundSwitchCCConfigurationGet);
550
- let SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = class SoundSwitchCCTonePlaySet2 extends SoundSwitchCC {
551
- constructor(options) {
552
- super(options);
553
- this.toneId = options.toneId;
554
- this.volume = options.volume;
555
- }
556
- static from(raw, ctx) {
557
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
558
- const toneId = raw.payload[0];
559
- let volume;
560
- if (toneId !== 0 && raw.payload.length >= 2) {
561
- volume = raw.payload[1];
562
- }
563
- return new SoundSwitchCCTonePlaySet_1({
564
- nodeId: ctx.sourceNodeId,
565
- toneId,
566
- volume
567
- });
568
- }
569
- toneId;
570
- volume;
571
- serialize(ctx) {
572
- this.payload = import_safe2.Bytes.from([this.toneId, this.volume ?? 0]);
573
- return super.serialize(ctx);
574
- }
575
- toLogEntry(ctx) {
576
- const message = {
577
- "tone id": this.toneId
578
- };
579
- if (this.volume != void 0) {
580
- message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
753
+ return {
754
+ ...super.toLogEntry(ctx),
755
+ message
756
+ };
581
757
  }
582
- return {
583
- ...super.toLogEntry(ctx),
584
- message
585
- };
586
- }
587
- };
588
- SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = __decorate([
589
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlaySet),
590
- (0, import_CommandClassDecorators.useSupervision)()
591
- ], SoundSwitchCCTonePlaySet);
592
- let SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport_1 = class SoundSwitchCCTonePlayReport2 extends SoundSwitchCC {
593
- constructor(options) {
594
- super(options);
595
- this.toneId = options.toneId;
596
- this.volume = options.volume;
597
- }
598
- static from(raw, ctx) {
599
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
600
- const toneId = raw.payload[0];
601
- let volume;
602
- if (toneId !== 0 && raw.payload.length >= 2) {
603
- volume = raw.payload[1];
604
- }
605
- return new SoundSwitchCCTonePlayReport_1({
606
- nodeId: ctx.sourceNodeId,
607
- toneId,
608
- volume
609
- });
610
- }
611
- toneId;
612
- volume;
613
- serialize(ctx) {
614
- this.payload = import_safe2.Bytes.from([this.toneId, this.volume ?? 0]);
615
- return super.serialize(ctx);
616
- }
617
- toLogEntry(ctx) {
618
- const message = {
619
- "tone id": this.toneId
620
- };
621
- if (this.volume != void 0) {
622
- message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
758
+ };
759
+ return SoundSwitchCCTonePlaySet2 = _classThis;
760
+ })();
761
+ let SoundSwitchCCTonePlayReport = (() => {
762
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlayReport), (0, import_CommandClassDecorators.ccValueProperty)("toneId", SoundSwitchCCValues.toneId), (0, import_CommandClassDecorators.ccValueProperty)("volume", SoundSwitchCCValues.volume)];
763
+ let _classDescriptor;
764
+ let _classExtraInitializers = [];
765
+ let _classThis;
766
+ let _classSuper = SoundSwitchCC;
767
+ var SoundSwitchCCTonePlayReport2 = class extends _classSuper {
768
+ static {
769
+ _classThis = this;
623
770
  }
624
- return {
625
- ...super.toLogEntry(ctx),
626
- message
627
- };
628
- }
629
- };
630
- __decorate([
631
- (0, import_CommandClassDecorators.ccValue)(SoundSwitchCCValues.toneId)
632
- ], SoundSwitchCCTonePlayReport.prototype, "toneId", void 0);
633
- __decorate([
634
- (0, import_CommandClassDecorators.ccValue)(SoundSwitchCCValues.volume)
635
- ], SoundSwitchCCTonePlayReport.prototype, "volume", void 0);
636
- SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport_1 = __decorate([
637
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlayReport)
638
- ], SoundSwitchCCTonePlayReport);
639
- let SoundSwitchCCTonePlayGet = class SoundSwitchCCTonePlayGet2 extends SoundSwitchCC {
640
- };
641
- SoundSwitchCCTonePlayGet = __decorate([
642
- (0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlayGet),
643
- (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCTonePlayReport)
644
- ], SoundSwitchCCTonePlayGet);
771
+ static {
772
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
773
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
774
+ SoundSwitchCCTonePlayReport2 = _classThis = _classDescriptor.value;
775
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
776
+ __runInitializers(_classThis, _classExtraInitializers);
777
+ }
778
+ constructor(options) {
779
+ super(options);
780
+ this.toneId = options.toneId;
781
+ this.volume = options.volume;
782
+ }
783
+ static from(raw, ctx) {
784
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
785
+ const toneId = raw.payload[0];
786
+ let volume;
787
+ if (toneId !== 0 && raw.payload.length >= 2) {
788
+ volume = raw.payload[1];
789
+ }
790
+ return new this({
791
+ nodeId: ctx.sourceNodeId,
792
+ toneId,
793
+ volume
794
+ });
795
+ }
796
+ toneId;
797
+ volume;
798
+ serialize(ctx) {
799
+ this.payload = import_safe2.Bytes.from([this.toneId, this.volume ?? 0]);
800
+ return super.serialize(ctx);
801
+ }
802
+ toLogEntry(ctx) {
803
+ const message = {
804
+ "tone id": this.toneId
805
+ };
806
+ if (this.volume != void 0) {
807
+ message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
808
+ }
809
+ return {
810
+ ...super.toLogEntry(ctx),
811
+ message
812
+ };
813
+ }
814
+ };
815
+ return SoundSwitchCCTonePlayReport2 = _classThis;
816
+ })();
817
+ let SoundSwitchCCTonePlayGet = (() => {
818
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlayGet), (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCTonePlayReport)];
819
+ let _classDescriptor;
820
+ let _classExtraInitializers = [];
821
+ let _classThis;
822
+ let _classSuper = SoundSwitchCC;
823
+ var SoundSwitchCCTonePlayGet2 = class extends _classSuper {
824
+ static {
825
+ _classThis = this;
826
+ }
827
+ static {
828
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
829
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
830
+ SoundSwitchCCTonePlayGet2 = _classThis = _classDescriptor.value;
831
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
832
+ __runInitializers(_classThis, _classExtraInitializers);
833
+ }
834
+ };
835
+ return SoundSwitchCCTonePlayGet2 = _classThis;
836
+ })();
645
837
  // Annotate the CommonJS export names for ESM import in node:
646
838
  0 && (module.exports = {
647
839
  SoundSwitchCC,