@zwave-js/cc 13.10.1 → 14.0.0-beta.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 (293) hide show
  1. package/build/cc/AlarmSensorCC.d.ts +31 -20
  2. package/build/cc/AlarmSensorCC.d.ts.map +1 -1
  3. package/build/cc/AlarmSensorCC.js +106 -87
  4. package/build/cc/AlarmSensorCC.js.map +1 -1
  5. package/build/cc/AssociationCC.d.ts +38 -32
  6. package/build/cc/AssociationCC.d.ts.map +1 -1
  7. package/build/cc/AssociationCC.js +193 -176
  8. package/build/cc/AssociationCC.js.map +1 -1
  9. package/build/cc/AssociationGroupInfoCC.d.ts +42 -36
  10. package/build/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  11. package/build/cc/AssociationGroupInfoCC.js +218 -200
  12. package/build/cc/AssociationGroupInfoCC.js.map +1 -1
  13. package/build/cc/BarrierOperatorCC.d.ts +41 -24
  14. package/build/cc/BarrierOperatorCC.d.ts.map +1 -1
  15. package/build/cc/BarrierOperatorCC.js +143 -109
  16. package/build/cc/BarrierOperatorCC.js.map +1 -1
  17. package/build/cc/BasicCC.d.ts +22 -23
  18. package/build/cc/BasicCC.d.ts.map +1 -1
  19. package/build/cc/BasicCC.js +83 -77
  20. package/build/cc/BasicCC.js.map +1 -1
  21. package/build/cc/BatteryCC.d.ts +22 -14
  22. package/build/cc/BatteryCC.d.ts.map +1 -1
  23. package/build/cc/BatteryCC.js +116 -87
  24. package/build/cc/BatteryCC.js.map +1 -1
  25. package/build/cc/BinarySensorCC.d.ts +22 -19
  26. package/build/cc/BinarySensorCC.d.ts.map +1 -1
  27. package/build/cc/BinarySensorCC.js +103 -93
  28. package/build/cc/BinarySensorCC.js.map +1 -1
  29. package/build/cc/BinarySwitchCC.d.ts +20 -20
  30. package/build/cc/BinarySwitchCC.d.ts.map +1 -1
  31. package/build/cc/BinarySwitchCC.js +71 -59
  32. package/build/cc/BinarySwitchCC.js.map +1 -1
  33. package/build/cc/CRC16CC.d.ts +9 -9
  34. package/build/cc/CRC16CC.d.ts.map +1 -1
  35. package/build/cc/CRC16CC.js +36 -36
  36. package/build/cc/CRC16CC.js.map +1 -1
  37. package/build/cc/CentralSceneCC.d.ts +34 -16
  38. package/build/cc/CentralSceneCC.d.ts.map +1 -1
  39. package/build/cc/CentralSceneCC.js +116 -79
  40. package/build/cc/CentralSceneCC.js.map +1 -1
  41. package/build/cc/ClimateControlScheduleCC.d.ts +38 -21
  42. package/build/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  43. package/build/cc/ClimateControlScheduleCC.js +113 -81
  44. package/build/cc/ClimateControlScheduleCC.js.map +1 -1
  45. package/build/cc/ClockCC.d.ts +18 -11
  46. package/build/cc/ClockCC.d.ts.map +1 -1
  47. package/build/cc/ClockCC.js +57 -43
  48. package/build/cc/ClockCC.js.map +1 -1
  49. package/build/cc/ColorSwitchCC.d.ts +37 -33
  50. package/build/cc/ColorSwitchCC.d.ts.map +1 -1
  51. package/build/cc/ColorSwitchCC.js +216 -189
  52. package/build/cc/ColorSwitchCC.js.map +1 -1
  53. package/build/cc/ConfigurationCC.d.ts +89 -74
  54. package/build/cc/ConfigurationCC.d.ts.map +1 -1
  55. package/build/cc/ConfigurationCC.js +541 -485
  56. package/build/cc/ConfigurationCC.js.map +1 -1
  57. package/build/cc/DeviceResetLocallyCC.d.ts +3 -3
  58. package/build/cc/DeviceResetLocallyCC.d.ts.map +1 -1
  59. package/build/cc/DeviceResetLocallyCC.js +14 -14
  60. package/build/cc/DeviceResetLocallyCC.js.map +1 -1
  61. package/build/cc/DoorLockCC.d.ts +66 -27
  62. package/build/cc/DoorLockCC.d.ts.map +1 -1
  63. package/build/cc/DoorLockCC.js +288 -197
  64. package/build/cc/DoorLockCC.js.map +1 -1
  65. package/build/cc/DoorLockLoggingCC.d.ts +23 -13
  66. package/build/cc/DoorLockLoggingCC.d.ts.map +1 -1
  67. package/build/cc/DoorLockLoggingCC.js +81 -63
  68. package/build/cc/DoorLockLoggingCC.js.map +1 -1
  69. package/build/cc/EnergyProductionCC.d.ts +16 -14
  70. package/build/cc/EnergyProductionCC.d.ts.map +1 -1
  71. package/build/cc/EnergyProductionCC.js +58 -52
  72. package/build/cc/EnergyProductionCC.js.map +1 -1
  73. package/build/cc/EntryControlCC.d.ts +44 -18
  74. package/build/cc/EntryControlCC.d.ts.map +1 -1
  75. package/build/cc/EntryControlCC.js +163 -112
  76. package/build/cc/EntryControlCC.js.map +1 -1
  77. package/build/cc/FirmwareUpdateMetaDataCC.d.ts +69 -34
  78. package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  79. package/build/cc/FirmwareUpdateMetaDataCC.js +311 -245
  80. package/build/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  81. package/build/cc/HumidityControlModeCC.d.ts +24 -16
  82. package/build/cc/HumidityControlModeCC.d.ts.map +1 -1
  83. package/build/cc/HumidityControlModeCC.js +80 -65
  84. package/build/cc/HumidityControlModeCC.js.map +1 -1
  85. package/build/cc/HumidityControlOperatingStateCC.d.ts +11 -7
  86. package/build/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  87. package/build/cc/HumidityControlOperatingStateCC.js +31 -22
  88. package/build/cc/HumidityControlOperatingStateCC.js.map +1 -1
  89. package/build/cc/HumidityControlSetpointCC.d.ts +68 -49
  90. package/build/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  91. package/build/cc/HumidityControlSetpointCC.js +203 -181
  92. package/build/cc/HumidityControlSetpointCC.js.map +1 -1
  93. package/build/cc/InclusionControllerCC.d.ts +13 -11
  94. package/build/cc/InclusionControllerCC.d.ts.map +1 -1
  95. package/build/cc/InclusionControllerCC.js +49 -42
  96. package/build/cc/InclusionControllerCC.js.map +1 -1
  97. package/build/cc/IndicatorCC.d.ts +46 -39
  98. package/build/cc/IndicatorCC.d.ts.map +1 -1
  99. package/build/cc/IndicatorCC.js +298 -277
  100. package/build/cc/IndicatorCC.js.map +1 -1
  101. package/build/cc/IrrigationCC.d.ts +127 -57
  102. package/build/cc/IrrigationCC.d.ts.map +1 -1
  103. package/build/cc/IrrigationCC.js +496 -352
  104. package/build/cc/IrrigationCC.js.map +1 -1
  105. package/build/cc/LanguageCC.d.ts +17 -11
  106. package/build/cc/LanguageCC.d.ts.map +1 -1
  107. package/build/cc/LanguageCC.js +54 -44
  108. package/build/cc/LanguageCC.js.map +1 -1
  109. package/build/cc/LockCC.d.ts +16 -11
  110. package/build/cc/LockCC.d.ts.map +1 -1
  111. package/build/cc/LockCC.js +48 -38
  112. package/build/cc/LockCC.js.map +1 -1
  113. package/build/cc/ManufacturerProprietaryCC.d.ts +12 -11
  114. package/build/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
  115. package/build/cc/ManufacturerProprietaryCC.js +45 -50
  116. package/build/cc/ManufacturerProprietaryCC.js.map +1 -1
  117. package/build/cc/ManufacturerSpecificCC.d.ts +20 -13
  118. package/build/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  119. package/build/cc/ManufacturerSpecificCC.js +79 -63
  120. package/build/cc/ManufacturerSpecificCC.js.map +1 -1
  121. package/build/cc/MeterCC.d.ts +30 -26
  122. package/build/cc/MeterCC.d.ts.map +1 -1
  123. package/build/cc/MeterCC.js +236 -204
  124. package/build/cc/MeterCC.js.map +1 -1
  125. package/build/cc/MultiChannelAssociationCC.d.ts +31 -26
  126. package/build/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  127. package/build/cc/MultiChannelAssociationCC.js +177 -168
  128. package/build/cc/MultiChannelAssociationCC.js.map +1 -1
  129. package/build/cc/MultiChannelCC.d.ts +70 -49
  130. package/build/cc/MultiChannelCC.d.ts.map +1 -1
  131. package/build/cc/MultiChannelCC.js +377 -318
  132. package/build/cc/MultiChannelCC.js.map +1 -1
  133. package/build/cc/MultiCommandCC.d.ts +9 -9
  134. package/build/cc/MultiCommandCC.d.ts.map +1 -1
  135. package/build/cc/MultiCommandCC.js +35 -36
  136. package/build/cc/MultiCommandCC.js.map +1 -1
  137. package/build/cc/MultilevelSensorCC.d.ts +38 -33
  138. package/build/cc/MultilevelSensorCC.d.ts.map +1 -1
  139. package/build/cc/MultilevelSensorCC.js +172 -152
  140. package/build/cc/MultilevelSensorCC.js.map +1 -1
  141. package/build/cc/MultilevelSwitchCC.d.ts +29 -25
  142. package/build/cc/MultilevelSwitchCC.d.ts.map +1 -1
  143. package/build/cc/MultilevelSwitchCC.js +147 -127
  144. package/build/cc/MultilevelSwitchCC.js.map +1 -1
  145. package/build/cc/NoOperationCC.d.ts +0 -8
  146. package/build/cc/NoOperationCC.d.ts.map +1 -1
  147. package/build/cc/NoOperationCC.js +2 -11
  148. package/build/cc/NoOperationCC.js.map +1 -1
  149. package/build/cc/NodeNamingCC.d.ts +27 -17
  150. package/build/cc/NodeNamingCC.d.ts.map +1 -1
  151. package/build/cc/NodeNamingCC.js +86 -69
  152. package/build/cc/NodeNamingCC.js.map +1 -1
  153. package/build/cc/NotificationCC.d.ts +46 -43
  154. package/build/cc/NotificationCC.d.ts.map +1 -1
  155. package/build/cc/NotificationCC.js +317 -303
  156. package/build/cc/NotificationCC.js.map +1 -1
  157. package/build/cc/PowerlevelCC.d.ts +22 -18
  158. package/build/cc/PowerlevelCC.d.ts.map +1 -1
  159. package/build/cc/PowerlevelCC.js +125 -95
  160. package/build/cc/PowerlevelCC.js.map +1 -1
  161. package/build/cc/ProtectionCC.d.ts +49 -26
  162. package/build/cc/ProtectionCC.d.ts.map +1 -1
  163. package/build/cc/ProtectionCC.js +172 -126
  164. package/build/cc/ProtectionCC.js.map +1 -1
  165. package/build/cc/SceneActivationCC.d.ts +8 -7
  166. package/build/cc/SceneActivationCC.d.ts.map +1 -1
  167. package/build/cc/SceneActivationCC.js +28 -23
  168. package/build/cc/SceneActivationCC.js.map +1 -1
  169. package/build/cc/SceneActuatorConfigurationCC.d.ts +23 -15
  170. package/build/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  171. package/build/cc/SceneActuatorConfigurationCC.js +79 -62
  172. package/build/cc/SceneActuatorConfigurationCC.js.map +1 -1
  173. package/build/cc/SceneControllerConfigurationCC.d.ts +25 -17
  174. package/build/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  175. package/build/cc/SceneControllerConfigurationCC.js +92 -78
  176. package/build/cc/SceneControllerConfigurationCC.js.map +1 -1
  177. package/build/cc/ScheduleEntryLockCC.d.ts +86 -72
  178. package/build/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  179. package/build/cc/ScheduleEntryLockCC.js +607 -455
  180. package/build/cc/ScheduleEntryLockCC.js.map +1 -1
  181. package/build/cc/Security2CC.d.ts +78 -87
  182. package/build/cc/Security2CC.d.ts.map +1 -1
  183. package/build/cc/Security2CC.js +798 -765
  184. package/build/cc/Security2CC.js.map +1 -1
  185. package/build/cc/SecurityCC.d.ts +47 -42
  186. package/build/cc/SecurityCC.d.ts.map +1 -1
  187. package/build/cc/SecurityCC.js +240 -218
  188. package/build/cc/SecurityCC.js.map +1 -1
  189. package/build/cc/SoundSwitchCC.d.ts +36 -29
  190. package/build/cc/SoundSwitchCC.d.ts.map +1 -1
  191. package/build/cc/SoundSwitchCC.js +180 -157
  192. package/build/cc/SoundSwitchCC.js.map +1 -1
  193. package/build/cc/SupervisionCC.d.ts +17 -14
  194. package/build/cc/SupervisionCC.d.ts.map +1 -1
  195. package/build/cc/SupervisionCC.js +86 -66
  196. package/build/cc/SupervisionCC.js.map +1 -1
  197. package/build/cc/ThermostatFanModeCC.d.ts +25 -15
  198. package/build/cc/ThermostatFanModeCC.d.ts.map +1 -1
  199. package/build/cc/ThermostatFanModeCC.js +79 -60
  200. package/build/cc/ThermostatFanModeCC.js.map +1 -1
  201. package/build/cc/ThermostatFanStateCC.d.ts +11 -7
  202. package/build/cc/ThermostatFanStateCC.d.ts.map +1 -1
  203. package/build/cc/ThermostatFanStateCC.js +31 -22
  204. package/build/cc/ThermostatFanStateCC.js.map +1 -1
  205. package/build/cc/ThermostatModeCC.d.ts +24 -21
  206. package/build/cc/ThermostatModeCC.d.ts.map +1 -1
  207. package/build/cc/ThermostatModeCC.js +106 -90
  208. package/build/cc/ThermostatModeCC.js.map +1 -1
  209. package/build/cc/ThermostatOperatingStateCC.d.ts +11 -7
  210. package/build/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  211. package/build/cc/ThermostatOperatingStateCC.js +31 -22
  212. package/build/cc/ThermostatOperatingStateCC.js.map +1 -1
  213. package/build/cc/ThermostatSetbackCC.d.ts +14 -13
  214. package/build/cc/ThermostatSetbackCC.d.ts.map +1 -1
  215. package/build/cc/ThermostatSetbackCC.js +64 -57
  216. package/build/cc/ThermostatSetbackCC.js.map +1 -1
  217. package/build/cc/ThermostatSetpointCC.d.ts +38 -57
  218. package/build/cc/ThermostatSetpointCC.d.ts.map +1 -1
  219. package/build/cc/ThermostatSetpointCC.js +200 -264
  220. package/build/cc/ThermostatSetpointCC.js.map +1 -1
  221. package/build/cc/TimeCC.d.ts +24 -20
  222. package/build/cc/TimeCC.d.ts.map +1 -1
  223. package/build/cc/TimeCC.js +119 -108
  224. package/build/cc/TimeCC.js.map +1 -1
  225. package/build/cc/TimeParametersCC.d.ts +18 -14
  226. package/build/cc/TimeParametersCC.d.ts.map +1 -1
  227. package/build/cc/TimeParametersCC.js +77 -69
  228. package/build/cc/TimeParametersCC.js.map +1 -1
  229. package/build/cc/TransportServiceCC.d.ts +29 -32
  230. package/build/cc/TransportServiceCC.d.ts.map +1 -1
  231. package/build/cc/TransportServiceCC.js +159 -161
  232. package/build/cc/TransportServiceCC.js.map +1 -1
  233. package/build/cc/UserCodeCC.d.ts +83 -66
  234. package/build/cc/UserCodeCC.d.ts.map +1 -1
  235. package/build/cc/UserCodeCC.js +449 -402
  236. package/build/cc/UserCodeCC.js.map +1 -1
  237. package/build/cc/VersionCC.d.ts +36 -20
  238. package/build/cc/VersionCC.d.ts.map +1 -1
  239. package/build/cc/VersionCC.js +190 -149
  240. package/build/cc/VersionCC.js.map +1 -1
  241. package/build/cc/WakeUpCC.d.ts +27 -13
  242. package/build/cc/WakeUpCC.d.ts.map +1 -1
  243. package/build/cc/WakeUpCC.js +105 -77
  244. package/build/cc/WakeUpCC.js.map +1 -1
  245. package/build/cc/WindowCoveringCC.d.ts +39 -27
  246. package/build/cc/WindowCoveringCC.d.ts.map +1 -1
  247. package/build/cc/WindowCoveringCC.js +169 -137
  248. package/build/cc/WindowCoveringCC.js.map +1 -1
  249. package/build/cc/ZWavePlusCC.d.ts +8 -7
  250. package/build/cc/ZWavePlusCC.d.ts.map +1 -1
  251. package/build/cc/ZWavePlusCC.js +44 -37
  252. package/build/cc/ZWavePlusCC.js.map +1 -1
  253. package/build/cc/ZWaveProtocolCC.d.ts +111 -84
  254. package/build/cc/ZWaveProtocolCC.d.ts.map +1 -1
  255. package/build/cc/ZWaveProtocolCC.js +583 -508
  256. package/build/cc/ZWaveProtocolCC.js.map +1 -1
  257. package/build/cc/index.d.ts +37 -34
  258. package/build/cc/index.d.ts.map +1 -1
  259. package/build/cc/index.js +6 -7
  260. package/build/cc/index.js.map +1 -1
  261. package/build/cc/manufacturerProprietary/FibaroCC.d.ts +29 -24
  262. package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
  263. package/build/cc/manufacturerProprietary/FibaroCC.js +109 -112
  264. package/build/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  265. package/build/index.d.ts +0 -1
  266. package/build/index.d.ts.map +1 -1
  267. package/build/index.js +0 -1
  268. package/build/index.js.map +1 -1
  269. package/build/lib/API.d.ts +21 -18
  270. package/build/lib/API.d.ts.map +1 -1
  271. package/build/lib/API.js +25 -49
  272. package/build/lib/API.js.map +1 -1
  273. package/build/lib/CommandClass.d.ts +51 -89
  274. package/build/lib/CommandClass.d.ts.map +1 -1
  275. package/build/lib/CommandClass.js +177 -249
  276. package/build/lib/CommandClass.js.map +1 -1
  277. package/build/lib/EncapsulatingCommandClass.d.ts +1 -15
  278. package/build/lib/EncapsulatingCommandClass.d.ts.map +1 -1
  279. package/build/lib/EncapsulatingCommandClass.js.map +1 -1
  280. package/build/lib/ICommandClassContainer.d.ts +1 -8
  281. package/build/lib/ICommandClassContainer.d.ts.map +1 -1
  282. package/build/lib/ICommandClassContainer.js +0 -8
  283. package/build/lib/ICommandClassContainer.js.map +1 -1
  284. package/build/lib/Values.d.ts +3 -3
  285. package/build/lib/Values.d.ts.map +1 -1
  286. package/build/lib/_Types.d.ts.map +1 -1
  287. package/build/lib/_Types.js +1 -0
  288. package/build/lib/_Types.js.map +1 -1
  289. package/build/lib/utils.d.ts +14 -13
  290. package/build/lib/utils.d.ts.map +1 -1
  291. package/build/lib/utils.js +94 -92
  292. package/build/lib/utils.js.map +1 -1
  293. package/package.json +4 -5
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  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;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var SoundSwitchCCTonesNumberReport_1, SoundSwitchCCToneInfoReport_1, SoundSwitchCCToneInfoGet_1, SoundSwitchCCConfigurationSet_1, SoundSwitchCCConfigurationReport_1, SoundSwitchCCTonePlaySet_1, SoundSwitchCCTonePlayReport_1;
8
9
  Object.defineProperty(exports, "__esModule", { value: true });
9
10
  exports.SoundSwitchCCTonePlayGet = exports.SoundSwitchCCTonePlayReport = exports.SoundSwitchCCTonePlaySet = exports.SoundSwitchCCConfigurationGet = exports.SoundSwitchCCConfigurationReport = exports.SoundSwitchCCConfigurationSet = exports.SoundSwitchCCToneInfoGet = exports.SoundSwitchCCToneInfoReport = exports.SoundSwitchCCTonesNumberGet = exports.SoundSwitchCCTonesNumberReport = exports.SoundSwitchCC = exports.SoundSwitchCCAPI = exports.SoundSwitchCCValues = void 0;
10
11
  function __assertType(argName, typeName, boundHasError) {
@@ -90,22 +91,22 @@ let SoundSwitchCCAPI = class SoundSwitchCCAPI extends API_1.CCAPI {
90
91
  }
91
92
  async getToneCount() {
92
93
  this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.TonesNumberGet);
93
- const cc = new SoundSwitchCCTonesNumberGet(this.applHost, {
94
+ const cc = new SoundSwitchCCTonesNumberGet({
94
95
  nodeId: this.endpoint.nodeId,
95
- endpoint: this.endpoint.index,
96
+ endpointIndex: this.endpoint.index,
96
97
  });
97
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
98
+ const response = await this.host.sendCommand(cc, this.commandOptions);
98
99
  return response?.toneCount;
99
100
  }
100
101
  async getToneInfo(toneId) {
101
102
  __assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
102
103
  this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.ToneInfoGet);
103
- const cc = new SoundSwitchCCToneInfoGet(this.applHost, {
104
+ const cc = new SoundSwitchCCToneInfoGet({
104
105
  nodeId: this.endpoint.nodeId,
105
- endpoint: this.endpoint.index,
106
+ endpointIndex: this.endpoint.index,
106
107
  toneId,
107
108
  });
108
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
109
+ const response = await this.host.sendCommand(cc, this.commandOptions);
109
110
  if (response)
110
111
  return (0, safe_2.pick)(response, ["duration", "name"]);
111
112
  }
@@ -113,22 +114,22 @@ let SoundSwitchCCAPI = class SoundSwitchCCAPI extends API_1.CCAPI {
113
114
  __assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
114
115
  __assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
115
116
  this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.ConfigurationSet);
116
- const cc = new SoundSwitchCCConfigurationSet(this.applHost, {
117
+ const cc = new SoundSwitchCCConfigurationSet({
117
118
  nodeId: this.endpoint.nodeId,
118
- endpoint: this.endpoint.index,
119
+ endpointIndex: this.endpoint.index,
119
120
  defaultToneId,
120
121
  defaultVolume,
121
122
  });
122
- return this.applHost.sendCommand(cc, this.commandOptions);
123
+ return this.host.sendCommand(cc, this.commandOptions);
123
124
  }
124
125
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
125
126
  async getConfiguration() {
126
127
  this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.ConfigurationGet);
127
- const cc = new SoundSwitchCCConfigurationGet(this.applHost, {
128
+ const cc = new SoundSwitchCCConfigurationGet({
128
129
  nodeId: this.endpoint.nodeId,
129
- endpoint: this.endpoint.index,
130
+ endpointIndex: this.endpoint.index,
130
131
  });
131
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
132
+ const response = await this.host.sendCommand(cc, this.commandOptions);
132
133
  if (response) {
133
134
  return (0, safe_2.pick)(response, ["defaultToneId", "defaultVolume"]);
134
135
  }
@@ -140,32 +141,32 @@ let SoundSwitchCCAPI = class SoundSwitchCCAPI extends API_1.CCAPI {
140
141
  if (toneId === 0) {
141
142
  throw new safe_1.ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, safe_1.ZWaveErrorCodes.Argument_Invalid);
142
143
  }
143
- const cc = new SoundSwitchCCTonePlaySet(this.applHost, {
144
+ const cc = new SoundSwitchCCTonePlaySet({
144
145
  nodeId: this.endpoint.nodeId,
145
- endpoint: this.endpoint.index,
146
+ endpointIndex: this.endpoint.index,
146
147
  toneId,
147
148
  volume,
148
149
  });
149
- return this.applHost.sendCommand(cc, this.commandOptions);
150
+ return this.host.sendCommand(cc, this.commandOptions);
150
151
  }
151
152
  async stopPlaying() {
152
153
  this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.TonePlaySet);
153
- const cc = new SoundSwitchCCTonePlaySet(this.applHost, {
154
+ const cc = new SoundSwitchCCTonePlaySet({
154
155
  nodeId: this.endpoint.nodeId,
155
- endpoint: this.endpoint.index,
156
+ endpointIndex: this.endpoint.index,
156
157
  toneId: 0x00,
157
158
  volume: 0x00,
158
159
  });
159
- return this.applHost.sendCommand(cc, this.commandOptions);
160
+ return this.host.sendCommand(cc, this.commandOptions);
160
161
  }
161
162
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
162
163
  async getPlaying() {
163
164
  this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.TonePlayGet);
164
- const cc = new SoundSwitchCCTonePlayGet(this.applHost, {
165
+ const cc = new SoundSwitchCCTonePlayGet({
165
166
  nodeId: this.endpoint.nodeId,
166
- endpoint: this.endpoint.index,
167
+ endpointIndex: this.endpoint.index,
167
168
  });
168
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
169
+ const response = await this.host.sendCommand(cc, this.commandOptions);
169
170
  if (response) {
170
171
  return (0, safe_2.pick)(response, ["toneId", "volume"]);
171
172
  }
@@ -240,38 +241,38 @@ exports.SoundSwitchCCAPI = SoundSwitchCCAPI = __decorate([
240
241
  (0, CommandClassDecorators_1.API)(safe_1.CommandClasses["Sound Switch"])
241
242
  ], SoundSwitchCCAPI);
242
243
  let SoundSwitchCC = class SoundSwitchCC extends CommandClass_1.CommandClass {
243
- async interview(applHost) {
244
- const node = this.getNode(applHost);
245
- const endpoint = this.getEndpoint(applHost);
246
- const api = API_1.CCAPI.create(safe_1.CommandClasses["Sound Switch"], applHost, endpoint).withOptions({
244
+ async interview(ctx) {
245
+ const node = this.getNode(ctx);
246
+ const endpoint = this.getEndpoint(ctx);
247
+ const api = API_1.CCAPI.create(safe_1.CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
247
248
  priority: safe_1.MessagePriority.NodeQuery,
248
249
  });
249
- applHost.controllerLog.logNode(node.id, {
250
+ ctx.logNode(node.id, {
250
251
  endpoint: this.endpointIndex,
251
252
  message: `Interviewing ${this.ccName}...`,
252
253
  direction: "none",
253
254
  });
254
- applHost.controllerLog.logNode(node.id, {
255
+ ctx.logNode(node.id, {
255
256
  message: "requesting tone count...",
256
257
  direction: "outbound",
257
258
  });
258
259
  const toneCount = await api.getToneCount();
259
260
  if (toneCount != undefined) {
260
261
  const logMessage = `supports ${toneCount} tones`;
261
- applHost.controllerLog.logNode(node.id, {
262
+ ctx.logNode(node.id, {
262
263
  message: logMessage,
263
264
  direction: "inbound",
264
265
  });
265
266
  }
266
267
  else {
267
- applHost.controllerLog.logNode(node.id, {
268
+ ctx.logNode(node.id, {
268
269
  endpoint: this.endpointIndex,
269
270
  message: "Querying tone count timed out, skipping interview...",
270
271
  level: "warn",
271
272
  });
272
273
  return;
273
274
  }
274
- applHost.controllerLog.logNode(node.id, {
275
+ ctx.logNode(node.id, {
275
276
  message: "requesting current sound configuration...",
276
277
  direction: "outbound",
277
278
  });
@@ -280,14 +281,14 @@ let SoundSwitchCC = class SoundSwitchCC extends CommandClass_1.CommandClass {
280
281
  const logMessage = `received current sound configuration:
281
282
  default tone ID: ${config.defaultToneId}
282
283
  default volume: ${config.defaultVolume}`;
283
- applHost.controllerLog.logNode(node.id, {
284
+ ctx.logNode(node.id, {
284
285
  message: logMessage,
285
286
  direction: "inbound",
286
287
  });
287
288
  }
288
289
  const metadataStates = {};
289
290
  for (let toneId = 1; toneId <= toneCount; toneId++) {
290
- applHost.controllerLog.logNode(node.id, {
291
+ ctx.logNode(node.id, {
291
292
  message: `requesting info for tone #${toneId}`,
292
293
  direction: "outbound",
293
294
  });
@@ -297,21 +298,21 @@ default volume: ${config.defaultVolume}`;
297
298
  const logMessage = `received info for tone #${toneId}:
298
299
  name: ${info.name}
299
300
  duration: ${info.duration} seconds`;
300
- applHost.controllerLog.logNode(node.id, {
301
+ ctx.logNode(node.id, {
301
302
  message: logMessage,
302
303
  direction: "inbound",
303
304
  });
304
305
  metadataStates[toneId] = `${info.name} (${info.duration} sec)`;
305
306
  }
306
307
  // Remember tone count and info on the default tone ID metadata
307
- this.setMetadata(applHost, exports.SoundSwitchCCValues.defaultToneId, {
308
+ this.setMetadata(ctx, exports.SoundSwitchCCValues.defaultToneId, {
308
309
  ...exports.SoundSwitchCCValues.defaultToneId.meta,
309
310
  min: 1,
310
311
  max: toneCount,
311
312
  states: metadataStates,
312
313
  });
313
314
  // Remember tone count and info on the tone ID metadata
314
- this.setMetadata(applHost, exports.SoundSwitchCCValues.toneId, {
315
+ this.setMetadata(ctx, exports.SoundSwitchCCValues.toneId, {
315
316
  ...exports.SoundSwitchCCValues.toneId.meta,
316
317
  min: 0,
317
318
  max: toneCount,
@@ -322,7 +323,7 @@ duration: ${info.duration} seconds`;
322
323
  },
323
324
  });
324
325
  // Remember that the interview is complete
325
- this.setInterviewComplete(applHost, true);
326
+ this.setInterviewComplete(ctx, true);
326
327
  }
327
328
  };
328
329
  exports.SoundSwitchCC = SoundSwitchCC;
@@ -331,31 +332,33 @@ exports.SoundSwitchCC = SoundSwitchCC = __decorate([
331
332
  (0, CommandClassDecorators_1.implementedVersion)(2),
332
333
  (0, CommandClassDecorators_1.ccValues)(exports.SoundSwitchCCValues)
333
334
  ], SoundSwitchCC);
334
- let SoundSwitchCCTonesNumberReport = class SoundSwitchCCTonesNumberReport extends SoundSwitchCC {
335
- constructor(host, options) {
336
- super(host, options);
337
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
338
- (0, safe_1.validatePayload)(this.payload.length >= 1);
339
- this.toneCount = this.payload[0];
340
- }
341
- else {
342
- this.toneCount = options.toneCount;
343
- }
335
+ let SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport_1 = class SoundSwitchCCTonesNumberReport extends SoundSwitchCC {
336
+ constructor(options) {
337
+ super(options);
338
+ this.toneCount = options.toneCount;
339
+ }
340
+ static from(raw, ctx) {
341
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
342
+ const toneCount = raw.payload[0];
343
+ return new SoundSwitchCCTonesNumberReport_1({
344
+ nodeId: ctx.sourceNodeId,
345
+ toneCount,
346
+ });
344
347
  }
345
348
  toneCount;
346
- serialize() {
349
+ serialize(ctx) {
347
350
  this.payload = Buffer.from([this.toneCount]);
348
- return super.serialize();
351
+ return super.serialize(ctx);
349
352
  }
350
- toLogEntry(host) {
353
+ toLogEntry(ctx) {
351
354
  return {
352
- ...super.toLogEntry(host),
355
+ ...super.toLogEntry(ctx),
353
356
  message: { "# of tones": this.toneCount },
354
357
  };
355
358
  }
356
359
  };
357
360
  exports.SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport;
358
- exports.SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport = __decorate([
361
+ exports.SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport_1 = __decorate([
359
362
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.TonesNumberReport)
360
363
  ], SoundSwitchCCTonesNumberReport);
361
364
  let SoundSwitchCCTonesNumberGet = class SoundSwitchCCTonesNumberGet extends SoundSwitchCC {
@@ -365,37 +368,41 @@ exports.SoundSwitchCCTonesNumberGet = SoundSwitchCCTonesNumberGet = __decorate([
365
368
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.TonesNumberGet),
366
369
  (0, CommandClassDecorators_1.expectedCCResponse)(SoundSwitchCCTonesNumberReport)
367
370
  ], SoundSwitchCCTonesNumberGet);
368
- let SoundSwitchCCToneInfoReport = class SoundSwitchCCToneInfoReport extends SoundSwitchCC {
369
- constructor(host, options) {
370
- super(host, options);
371
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
372
- (0, safe_1.validatePayload)(this.payload.length >= 4);
373
- this.toneId = this.payload[0];
374
- this.duration = this.payload.readUInt16BE(1);
375
- const nameLength = this.payload[3];
376
- (0, safe_1.validatePayload)(this.payload.length >= 4 + nameLength);
377
- this.name = this.payload.subarray(4, 4 + nameLength).toString("utf8");
378
- }
379
- else {
380
- this.toneId = options.toneId;
381
- this.duration = options.duration;
382
- this.name = options.name;
383
- }
371
+ let SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport_1 = class SoundSwitchCCToneInfoReport extends SoundSwitchCC {
372
+ constructor(options) {
373
+ super(options);
374
+ this.toneId = options.toneId;
375
+ this.duration = options.duration;
376
+ this.name = options.name;
377
+ }
378
+ static from(raw, ctx) {
379
+ (0, safe_1.validatePayload)(raw.payload.length >= 4);
380
+ const toneId = raw.payload[0];
381
+ const duration = raw.payload.readUInt16BE(1);
382
+ const nameLength = raw.payload[3];
383
+ (0, safe_1.validatePayload)(raw.payload.length >= 4 + nameLength);
384
+ const name = raw.payload.subarray(4, 4 + nameLength).toString("utf8");
385
+ return new SoundSwitchCCToneInfoReport_1({
386
+ nodeId: ctx.sourceNodeId,
387
+ toneId,
388
+ duration,
389
+ name,
390
+ });
384
391
  }
385
392
  toneId;
386
393
  duration;
387
394
  name;
388
- serialize() {
395
+ serialize(ctx) {
389
396
  this.payload = Buffer.concat([
390
397
  Buffer.from([this.toneId, 0, 0, this.name.length]),
391
398
  Buffer.from(this.name, "utf8"),
392
399
  ]);
393
400
  this.payload.writeUInt16BE(this.duration, 1);
394
- return super.serialize();
401
+ return super.serialize(ctx);
395
402
  }
396
- toLogEntry(host) {
403
+ toLogEntry(ctx) {
397
404
  return {
398
- ...super.toLogEntry(host),
405
+ ...super.toLogEntry(ctx),
399
406
  message: {
400
407
  "tone id": this.toneId,
401
408
  duration: `${this.duration} seconds`,
@@ -405,62 +412,67 @@ let SoundSwitchCCToneInfoReport = class SoundSwitchCCToneInfoReport extends Soun
405
412
  }
406
413
  };
407
414
  exports.SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport;
408
- exports.SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport = __decorate([
415
+ exports.SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport_1 = __decorate([
409
416
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ToneInfoReport)
410
417
  ], SoundSwitchCCToneInfoReport);
411
418
  const testResponseForSoundSwitchToneInfoGet = (sent, received) => {
412
419
  return received.toneId === sent.toneId;
413
420
  };
414
- let SoundSwitchCCToneInfoGet = class SoundSwitchCCToneInfoGet extends SoundSwitchCC {
415
- constructor(host, options) {
416
- super(host, options);
417
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
418
- (0, safe_1.validatePayload)(this.payload.length >= 1);
419
- this.toneId = this.payload[0];
420
- }
421
- else {
422
- this.toneId = options.toneId;
423
- }
421
+ let SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet_1 = class SoundSwitchCCToneInfoGet extends SoundSwitchCC {
422
+ constructor(options) {
423
+ super(options);
424
+ this.toneId = options.toneId;
425
+ }
426
+ static from(raw, ctx) {
427
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
428
+ const toneId = raw.payload[0];
429
+ return new SoundSwitchCCToneInfoGet_1({
430
+ nodeId: ctx.sourceNodeId,
431
+ toneId,
432
+ });
424
433
  }
425
434
  toneId;
426
- serialize() {
435
+ serialize(ctx) {
427
436
  this.payload = Buffer.from([this.toneId]);
428
- return super.serialize();
437
+ return super.serialize(ctx);
429
438
  }
430
- toLogEntry(host) {
439
+ toLogEntry(ctx) {
431
440
  return {
432
- ...super.toLogEntry(host),
441
+ ...super.toLogEntry(ctx),
433
442
  message: { "tone id": this.toneId },
434
443
  };
435
444
  }
436
445
  };
437
446
  exports.SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet;
438
- exports.SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet = __decorate([
447
+ exports.SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet_1 = __decorate([
439
448
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ToneInfoGet),
440
449
  (0, CommandClassDecorators_1.expectedCCResponse)(SoundSwitchCCToneInfoReport, testResponseForSoundSwitchToneInfoGet)
441
450
  ], SoundSwitchCCToneInfoGet);
442
- let SoundSwitchCCConfigurationSet = class SoundSwitchCCConfigurationSet extends SoundSwitchCC {
443
- constructor(host, options) {
444
- super(host, options);
445
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
446
- (0, safe_1.validatePayload)(this.payload.length >= 2);
447
- this.defaultVolume = this.payload[0];
448
- this.defaultToneId = this.payload[1];
449
- }
450
- else {
451
- this.defaultVolume = options.defaultVolume;
452
- this.defaultToneId = options.defaultToneId;
453
- }
451
+ let SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet_1 = class SoundSwitchCCConfigurationSet extends SoundSwitchCC {
452
+ constructor(options) {
453
+ super(options);
454
+ this.defaultVolume = options.defaultVolume;
455
+ this.defaultToneId = options.defaultToneId;
456
+ }
457
+ static from(raw, ctx) {
458
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
459
+ const defaultVolume = raw.payload[0];
460
+ const defaultToneId = raw.payload[1];
461
+ return new SoundSwitchCCConfigurationSet_1({
462
+ nodeId: ctx.sourceNodeId,
463
+ defaultVolume,
464
+ defaultToneId,
465
+ });
454
466
  }
455
467
  defaultVolume;
456
468
  defaultToneId;
457
- serialize() {
469
+ serialize(ctx) {
458
470
  this.payload = Buffer.from([this.defaultVolume, this.defaultToneId]);
459
- return super.serialize();
471
+ return super.serialize(ctx);
460
472
  }
461
- toLogEntry(host) {
473
+ toLogEntry(ctx) {
462
474
  return {
463
- ...super.toLogEntry(host),
475
+ ...super.toLogEntry(ctx),
464
476
  message: {
465
477
  "default volume": `${this.defaultVolume} %`,
466
478
  "default tone id": this.defaultToneId,
@@ -469,32 +481,35 @@ let SoundSwitchCCConfigurationSet = class SoundSwitchCCConfigurationSet extends
469
481
  }
470
482
  };
471
483
  exports.SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet;
472
- exports.SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet = __decorate([
484
+ exports.SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet_1 = __decorate([
473
485
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ConfigurationSet),
474
486
  (0, CommandClassDecorators_1.useSupervision)()
475
487
  ], SoundSwitchCCConfigurationSet);
476
- let SoundSwitchCCConfigurationReport = class SoundSwitchCCConfigurationReport extends SoundSwitchCC {
477
- constructor(host, options) {
478
- super(host, options);
479
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
480
- (0, safe_1.validatePayload)(this.payload.length >= 2);
481
- this.defaultVolume = (0, math_1.clamp)(this.payload[0], 0, 100);
482
- this.defaultToneId = this.payload[1];
483
- }
484
- else {
485
- this.defaultVolume = options.defaultVolume;
486
- this.defaultToneId = options.defaultToneId;
487
- }
488
+ let SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = class SoundSwitchCCConfigurationReport extends SoundSwitchCC {
489
+ constructor(options) {
490
+ super(options);
491
+ this.defaultVolume = options.defaultVolume;
492
+ this.defaultToneId = options.defaultToneId;
493
+ }
494
+ static from(raw, ctx) {
495
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
496
+ const defaultVolume = (0, math_1.clamp)(raw.payload[0], 0, 100);
497
+ const defaultToneId = raw.payload[1];
498
+ return new SoundSwitchCCConfigurationReport_1({
499
+ nodeId: ctx.sourceNodeId,
500
+ defaultVolume,
501
+ defaultToneId,
502
+ });
488
503
  }
489
504
  defaultVolume;
490
505
  defaultToneId;
491
- serialize() {
506
+ serialize(ctx) {
492
507
  this.payload = Buffer.from([this.defaultVolume, this.defaultToneId]);
493
- return super.serialize();
508
+ return super.serialize(ctx);
494
509
  }
495
- toLogEntry(host) {
510
+ toLogEntry(ctx) {
496
511
  return {
497
- ...super.toLogEntry(host),
512
+ ...super.toLogEntry(ctx),
498
513
  message: {
499
514
  "default volume": `${this.defaultVolume} %`,
500
515
  "default tone id": this.defaultToneId,
@@ -509,7 +524,7 @@ __decorate([
509
524
  __decorate([
510
525
  (0, CommandClassDecorators_1.ccValue)(exports.SoundSwitchCCValues.defaultToneId)
511
526
  ], SoundSwitchCCConfigurationReport.prototype, "defaultToneId", void 0);
512
- exports.SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport = __decorate([
527
+ exports.SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = __decorate([
513
528
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ConfigurationReport)
514
529
  ], SoundSwitchCCConfigurationReport);
515
530
  let SoundSwitchCCConfigurationGet = class SoundSwitchCCConfigurationGet extends SoundSwitchCC {
@@ -519,28 +534,32 @@ exports.SoundSwitchCCConfigurationGet = SoundSwitchCCConfigurationGet = __decora
519
534
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ConfigurationGet),
520
535
  (0, CommandClassDecorators_1.expectedCCResponse)(SoundSwitchCCConfigurationReport)
521
536
  ], SoundSwitchCCConfigurationGet);
522
- let SoundSwitchCCTonePlaySet = class SoundSwitchCCTonePlaySet extends SoundSwitchCC {
523
- constructor(host, options) {
524
- super(host, options);
525
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
526
- (0, safe_1.validatePayload)(this.payload.length >= 1);
527
- this.toneId = this.payload[0];
528
- if (this.toneId !== 0 && this.payload.length >= 2) {
529
- this.volume = this.payload[1];
530
- }
531
- }
532
- else {
533
- this.toneId = options.toneId;
534
- this.volume = options.volume;
537
+ let SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = class SoundSwitchCCTonePlaySet extends SoundSwitchCC {
538
+ constructor(options) {
539
+ super(options);
540
+ this.toneId = options.toneId;
541
+ this.volume = options.volume;
542
+ }
543
+ static from(raw, ctx) {
544
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
545
+ const toneId = raw.payload[0];
546
+ let volume;
547
+ if (toneId !== 0 && raw.payload.length >= 2) {
548
+ volume = raw.payload[1];
535
549
  }
550
+ return new SoundSwitchCCTonePlaySet_1({
551
+ nodeId: ctx.sourceNodeId,
552
+ toneId,
553
+ volume,
554
+ });
536
555
  }
537
556
  toneId;
538
557
  volume;
539
- serialize() {
558
+ serialize(ctx) {
540
559
  this.payload = Buffer.from([this.toneId, this.volume ?? 0]);
541
- return super.serialize();
560
+ return super.serialize(ctx);
542
561
  }
543
- toLogEntry(host) {
562
+ toLogEntry(ctx) {
544
563
  const message = {
545
564
  "tone id": this.toneId,
546
565
  };
@@ -548,38 +567,42 @@ let SoundSwitchCCTonePlaySet = class SoundSwitchCCTonePlaySet extends SoundSwitc
548
567
  message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
549
568
  }
550
569
  return {
551
- ...super.toLogEntry(host),
570
+ ...super.toLogEntry(ctx),
552
571
  message,
553
572
  };
554
573
  }
555
574
  };
556
575
  exports.SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet;
557
- exports.SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet = __decorate([
576
+ exports.SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = __decorate([
558
577
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.TonePlaySet),
559
578
  (0, CommandClassDecorators_1.useSupervision)()
560
579
  ], SoundSwitchCCTonePlaySet);
561
- let SoundSwitchCCTonePlayReport = class SoundSwitchCCTonePlayReport extends SoundSwitchCC {
562
- constructor(host, options) {
563
- super(host, options);
564
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
565
- (0, safe_1.validatePayload)(this.payload.length >= 1);
566
- this.toneId = this.payload[0];
567
- if (this.toneId !== 0 && this.payload.length >= 2) {
568
- this.volume = this.payload[1];
569
- }
570
- }
571
- else {
572
- this.toneId = options.toneId;
573
- this.volume = options.volume;
580
+ let SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport_1 = class SoundSwitchCCTonePlayReport extends SoundSwitchCC {
581
+ constructor(options) {
582
+ super(options);
583
+ this.toneId = options.toneId;
584
+ this.volume = options.volume;
585
+ }
586
+ static from(raw, ctx) {
587
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
588
+ const toneId = raw.payload[0];
589
+ let volume;
590
+ if (toneId !== 0 && raw.payload.length >= 2) {
591
+ volume = raw.payload[1];
574
592
  }
593
+ return new SoundSwitchCCTonePlayReport_1({
594
+ nodeId: ctx.sourceNodeId,
595
+ toneId,
596
+ volume,
597
+ });
575
598
  }
576
599
  toneId;
577
600
  volume;
578
- serialize() {
601
+ serialize(ctx) {
579
602
  this.payload = Buffer.from([this.toneId, this.volume ?? 0]);
580
- return super.serialize();
603
+ return super.serialize(ctx);
581
604
  }
582
- toLogEntry(host) {
605
+ toLogEntry(ctx) {
583
606
  const message = {
584
607
  "tone id": this.toneId,
585
608
  };
@@ -587,7 +610,7 @@ let SoundSwitchCCTonePlayReport = class SoundSwitchCCTonePlayReport extends Soun
587
610
  message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
588
611
  }
589
612
  return {
590
- ...super.toLogEntry(host),
613
+ ...super.toLogEntry(ctx),
591
614
  message,
592
615
  };
593
616
  }
@@ -599,7 +622,7 @@ __decorate([
599
622
  __decorate([
600
623
  (0, CommandClassDecorators_1.ccValue)(exports.SoundSwitchCCValues.volume)
601
624
  ], SoundSwitchCCTonePlayReport.prototype, "volume", void 0);
602
- exports.SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport = __decorate([
625
+ exports.SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport_1 = __decorate([
603
626
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.TonePlayReport)
604
627
  ], SoundSwitchCCTonePlayReport);
605
628
  let SoundSwitchCCTonePlayGet = class SoundSwitchCCTonePlayGet extends SoundSwitchCC {