@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 VersionCCReport_1, VersionCCCommandClassReport_1, VersionCCCommandClassGet_1, VersionCCCapabilitiesReport_1, VersionCCZWaveSoftwareReport_1;
8
9
  Object.defineProperty(exports, "__esModule", { value: true });
9
10
  exports.VersionCCZWaveSoftwareGet = exports.VersionCCZWaveSoftwareReport = exports.VersionCCCapabilitiesGet = exports.VersionCCCapabilitiesReport = exports.VersionCCCommandClassGet = exports.VersionCCCommandClassReport = exports.VersionCCGet = exports.VersionCCReport = exports.VersionCC = exports.VersionCCAPI = exports.VersionCCValues = void 0;
10
11
  function __assertType(argName, typeName, boundHasError) {
@@ -188,9 +189,7 @@ let VersionCCAPI = class VersionCCAPI extends API_1.PhysicalCCAPI {
188
189
  case _Types_1.VersionCommand.CapabilitiesGet:
189
190
  case _Types_1.VersionCommand.CapabilitiesReport:
190
191
  case _Types_1.VersionCommand.ZWaveSoftwareReport:
191
- // The API might have been created before the versions were determined,
192
- // so `this.version` may contains a wrong value
193
- return (this.applHost.getSafeCCVersion(this.ccId, this.endpoint.nodeId, this.endpoint.index) >= 3);
192
+ return this.version >= 3;
194
193
  case _Types_1.VersionCommand.ZWaveSoftwareGet: {
195
194
  return this.getValueDB().getValue(exports.VersionCCValues.supportsZWaveSoftwareGet.endpoint(this.endpoint.index));
196
195
  }
@@ -200,11 +199,11 @@ let VersionCCAPI = class VersionCCAPI extends API_1.PhysicalCCAPI {
200
199
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
201
200
  async get() {
202
201
  this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.Get);
203
- const cc = new VersionCCGet(this.applHost, {
202
+ const cc = new VersionCCGet({
204
203
  nodeId: this.endpoint.nodeId,
205
- endpoint: this.endpoint.index,
204
+ endpointIndex: this.endpoint.index,
206
205
  });
207
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
206
+ const response = await this.host.sendCommand(cc, this.commandOptions);
208
207
  if (response) {
209
208
  return (0, safe_2.pick)(response, [
210
209
  "libraryType",
@@ -217,22 +216,22 @@ let VersionCCAPI = class VersionCCAPI extends API_1.PhysicalCCAPI {
217
216
  async sendReport(options) {
218
217
  __assertType("options", "VersionCCReportOptions", __assertType__VersionCCReportOptions.bind(void 0, options));
219
218
  this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.Report);
220
- const cc = new VersionCCReport(this.applHost, {
219
+ const cc = new VersionCCReport({
221
220
  nodeId: this.endpoint.nodeId,
222
- endpoint: this.endpoint.index,
221
+ endpointIndex: this.endpoint.index,
223
222
  ...options,
224
223
  });
225
- await this.applHost.sendCommand(cc, this.commandOptions);
224
+ await this.host.sendCommand(cc, this.commandOptions);
226
225
  }
227
226
  async getCCVersion(requestedCC) {
228
227
  __assertType("requestedCC", "CommandClasses", __assertType__number.bind(void 0, requestedCC));
229
228
  this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.CommandClassGet);
230
- const cc = new VersionCCCommandClassGet(this.applHost, {
229
+ const cc = new VersionCCCommandClassGet({
231
230
  nodeId: this.endpoint.nodeId,
232
- endpoint: this.endpoint.index,
231
+ endpointIndex: this.endpoint.index,
233
232
  requestedCC,
234
233
  });
235
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
234
+ const response = await this.host.sendCommand(cc, this.commandOptions);
236
235
  return response?.ccVersion;
237
236
  }
238
237
  async reportCCVersion(requestedCC) {
@@ -256,44 +255,44 @@ let VersionCCAPI = class VersionCCAPI extends API_1.PhysicalCCAPI {
256
255
  ccVersion = (0, CommandClassDecorators_1.getImplementedVersion)(requestedCC);
257
256
  break;
258
257
  }
259
- const cc = new VersionCCCommandClassReport(this.applHost, {
258
+ const cc = new VersionCCCommandClassReport({
260
259
  nodeId: this.endpoint.nodeId,
261
- endpoint: this.endpoint.index,
260
+ endpointIndex: this.endpoint.index,
262
261
  requestedCC,
263
262
  ccVersion,
264
263
  });
265
- await this.applHost.sendCommand(cc, this.commandOptions);
264
+ await this.host.sendCommand(cc, this.commandOptions);
266
265
  }
267
266
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
268
267
  async getCapabilities() {
269
268
  this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.CapabilitiesGet);
270
- const cc = new VersionCCCapabilitiesGet(this.applHost, {
269
+ const cc = new VersionCCCapabilitiesGet({
271
270
  nodeId: this.endpoint.nodeId,
272
- endpoint: this.endpoint.index,
271
+ endpointIndex: this.endpoint.index,
273
272
  });
274
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
273
+ const response = await this.host.sendCommand(cc, this.commandOptions);
275
274
  if (response) {
276
275
  return (0, safe_2.pick)(response, ["supportsZWaveSoftwareGet"]);
277
276
  }
278
277
  }
279
278
  async reportCapabilities() {
280
279
  this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.CapabilitiesReport);
281
- const cc = new VersionCCCapabilitiesReport(this.applHost, {
280
+ const cc = new VersionCCCapabilitiesReport({
282
281
  nodeId: this.endpoint.nodeId,
283
- endpoint: this.endpoint.index,
282
+ endpointIndex: this.endpoint.index,
284
283
  // At this time, we do not support responding to Z-Wave Software Get
285
284
  supportsZWaveSoftwareGet: false,
286
285
  });
287
- await this.applHost.sendCommand(cc, this.commandOptions);
286
+ await this.host.sendCommand(cc, this.commandOptions);
288
287
  }
289
288
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
290
289
  async getZWaveSoftware() {
291
290
  this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.ZWaveSoftwareGet);
292
- const cc = new VersionCCZWaveSoftwareGet(this.applHost, {
291
+ const cc = new VersionCCZWaveSoftwareGet({
293
292
  nodeId: this.endpoint.nodeId,
294
- endpoint: this.endpoint.index,
293
+ endpointIndex: this.endpoint.index,
295
294
  });
296
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
295
+ const response = await this.host.sendCommand(cc, this.commandOptions);
297
296
  if (response) {
298
297
  return (0, safe_2.pick)(response, [
299
298
  "sdkVersion",
@@ -318,8 +317,8 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
318
317
  // VersionCC must be the 2nd CC after ManufacturerSpecificCC
319
318
  return [safe_1.CommandClasses["Manufacturer Specific"]];
320
319
  }
321
- async interview(applHost) {
322
- const node = this.getNode(applHost);
320
+ async interview(ctx) {
321
+ const node = this.getNode(ctx);
323
322
  // SDS13782: In a Multi Channel device, the Version Command Class MUST be supported by the Root Device, while
324
323
  // the Version Command Class SHOULD NOT be supported by individual End Points.
325
324
  //
@@ -327,12 +326,12 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
327
326
  // Channel device. However, the Root Device MUST respond to Version requests for any Command Class
328
327
  // implemented by the Multi Channel device; also in cases where the actual Command Class is only
329
328
  // provided by an End Point.
330
- const endpoint = this.getEndpoint(applHost);
329
+ const endpoint = this.getEndpoint(ctx);
331
330
  // Use the CC API of the root device for all queries
332
- const api = API_1.CCAPI.create(safe_1.CommandClasses.Version, applHost, node).withOptions({
331
+ const api = API_1.CCAPI.create(safe_1.CommandClasses.Version, ctx, node).withOptions({
333
332
  priority: safe_1.MessagePriority.NodeQuery,
334
333
  });
335
- applHost.controllerLog.logNode(node.id, {
334
+ ctx.logNode(node.id, {
336
335
  endpoint: this.endpointIndex,
337
336
  message: `Interviewing ${this.ccName}...`,
338
337
  direction: "none",
@@ -342,10 +341,10 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
342
341
  // but there are Z-Wave certification tests that require us to query all CCs
343
342
  const maxImplemented = (0, CommandClassDecorators_1.getImplementedVersion)(cc);
344
343
  if (maxImplemented === 0) {
345
- applHost.controllerLog.logNode(node.id, ` skipping query for ${safe_1.CommandClasses[cc]} (${(0, safe_2.num2hex)(cc)}) because max implemented version is ${maxImplemented}`);
344
+ ctx.logNode(node.id, ` skipping query for ${safe_1.CommandClasses[cc]} (${(0, safe_2.num2hex)(cc)}) because max implemented version is ${maxImplemented}`);
346
345
  return;
347
346
  }
348
- applHost.controllerLog.logNode(node.id, {
347
+ ctx.logNode(node.id, {
349
348
  endpoint: this.endpointIndex,
350
349
  message: ` querying the CC version for ${(0, safe_1.getCCName)(cc)}...`,
351
350
  direction: "outbound",
@@ -391,13 +390,13 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
391
390
  endpoint.removeCC(cc);
392
391
  }
393
392
  }
394
- applHost.controllerLog.logNode(node.id, {
393
+ ctx.logNode(node.id, {
395
394
  endpoint: this.endpointIndex,
396
395
  message: logMessage,
397
396
  });
398
397
  }
399
398
  else {
400
- applHost.controllerLog.logNode(node.id, {
399
+ ctx.logNode(node.id, {
401
400
  endpoint: this.endpointIndex,
402
401
  message: `CC version query for ${(0, safe_1.getCCName)(cc)} timed out - assuming the ${this.endpointIndex === 0 ? "node" : "endpoint"} supports version 1...`,
403
402
  level: "warn",
@@ -410,10 +409,8 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
410
409
  if (this.endpointIndex === 0) {
411
410
  // Step 1: Query Version CC version
412
411
  await queryCCVersion(safe_1.CommandClasses.Version);
413
- // The CC instance was created before the versions were determined, so `this.version` contains a wrong value
414
- this.version = applHost.getSafeCCVersion(safe_1.CommandClasses.Version, node.id, this.endpointIndex);
415
412
  // Step 2: Query node versions
416
- applHost.controllerLog.logNode(node.id, {
413
+ ctx.logNode(node.id, {
417
414
  endpoint: this.endpointIndex,
418
415
  message: "querying node versions...",
419
416
  direction: "outbound",
@@ -428,7 +425,7 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
428
425
  logMessage +=
429
426
  `\n hardware version: ${versionGetResponse.hardwareVersion}`;
430
427
  }
431
- applHost.controllerLog.logNode(node.id, {
428
+ ctx.logNode(node.id, {
432
429
  endpoint: this.endpointIndex,
433
430
  message: logMessage,
434
431
  direction: "inbound",
@@ -436,7 +433,7 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
436
433
  }
437
434
  }
438
435
  // Step 3: Query all other CC versions
439
- applHost.controllerLog.logNode(node.id, {
436
+ ctx.logNode(node.id, {
440
437
  endpoint: this.endpointIndex,
441
438
  message: "querying CC versions...",
442
439
  direction: "outbound",
@@ -462,9 +459,9 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
462
459
  await queryCCVersion(cc);
463
460
  }
464
461
  // Step 4: Query VersionCC capabilities (root device only)
465
- if (this.endpointIndex === 0 && this.version >= 3) {
462
+ if (this.endpointIndex === 0 && api.version >= 3) {
466
463
  // Step 4a: Support for SoftwareGet
467
- applHost.controllerLog.logNode(node.id, {
464
+ ctx.logNode(node.id, {
468
465
  endpoint: this.endpointIndex,
469
466
  message: "querying if Z-Wave Software Get is supported...",
470
467
  direction: "outbound",
@@ -472,20 +469,20 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
472
469
  const capsResponse = await api.getCapabilities();
473
470
  if (capsResponse) {
474
471
  const { supportsZWaveSoftwareGet } = capsResponse;
475
- applHost.controllerLog.logNode(node.id, {
472
+ ctx.logNode(node.id, {
476
473
  endpoint: this.endpointIndex,
477
474
  message: `Z-Wave Software Get is${supportsZWaveSoftwareGet ? "" : " not"} supported`,
478
475
  direction: "inbound",
479
476
  });
480
477
  if (supportsZWaveSoftwareGet) {
481
478
  // Step 4b: Query Z-Wave Software versions
482
- applHost.controllerLog.logNode(node.id, {
479
+ ctx.logNode(node.id, {
483
480
  endpoint: this.endpointIndex,
484
481
  message: "querying Z-Wave software versions...",
485
482
  direction: "outbound",
486
483
  });
487
484
  await api.getZWaveSoftware();
488
- applHost.controllerLog.logNode(node.id, {
485
+ ctx.logNode(node.id, {
489
486
  endpoint: this.endpointIndex,
490
487
  message: "received Z-Wave software versions",
491
488
  direction: "inbound",
@@ -494,7 +491,7 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
494
491
  }
495
492
  }
496
493
  // Remember that the interview is complete
497
- this.setInterviewComplete(applHost, true);
494
+ this.setInterviewComplete(ctx, true);
498
495
  }
499
496
  };
500
497
  exports.VersionCC = VersionCC;
@@ -503,41 +500,48 @@ exports.VersionCC = VersionCC = __decorate([
503
500
  (0, CommandClassDecorators_1.implementedVersion)(3),
504
501
  (0, CommandClassDecorators_1.ccValues)(exports.VersionCCValues)
505
502
  ], VersionCC);
506
- let VersionCCReport = class VersionCCReport extends VersionCC {
507
- constructor(host, options) {
508
- super(host, options);
509
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
510
- (0, safe_1.validatePayload)(this.payload.length >= 5);
511
- this.libraryType = this.payload[0];
512
- this.protocolVersion = `${this.payload[1]}.${this.payload[2]}`;
513
- this.firmwareVersions = [`${this.payload[3]}.${this.payload[4]}`];
514
- if (this.version >= 2 && this.payload.length >= 7) {
515
- this.hardwareVersion = this.payload[5];
516
- const additionalFirmwares = this.payload[6];
517
- (0, safe_1.validatePayload)(this.payload.length >= 7 + 2 * additionalFirmwares);
518
- for (let i = 0; i < additionalFirmwares; i++) {
519
- this.firmwareVersions.push(`${this.payload[7 + 2 * i]}.${this.payload[7 + 2 * i + 1]}`);
520
- }
521
- }
522
- }
523
- else {
524
- if (!/^\d+\.\d+(\.\d+)?$/.test(options.protocolVersion)) {
525
- throw new safe_1.ZWaveError(`protocolVersion must be a string in the format "major.minor" or "major.minor.patch", received "${options.protocolVersion}"`, safe_1.ZWaveErrorCodes.Argument_Invalid);
526
- }
527
- else if (!options.firmwareVersions.every((fw) => /^\d+\.\d+(\.\d+)?$/.test(fw))) {
528
- throw new safe_1.ZWaveError(`firmwareVersions must be an array of strings in the format "major.minor" or "major.minor.patch", received "${JSON.stringify(options.firmwareVersions)}"`, safe_1.ZWaveErrorCodes.Argument_Invalid);
503
+ let VersionCCReport = VersionCCReport_1 = class VersionCCReport extends VersionCC {
504
+ constructor(options) {
505
+ super(options);
506
+ if (!/^\d+\.\d+(\.\d+)?$/.test(options.protocolVersion)) {
507
+ throw new safe_1.ZWaveError(`protocolVersion must be a string in the format "major.minor" or "major.minor.patch", received "${options.protocolVersion}"`, safe_1.ZWaveErrorCodes.Argument_Invalid);
508
+ }
509
+ else if (!options.firmwareVersions.every((fw) => /^\d+\.\d+(\.\d+)?$/.test(fw))) {
510
+ throw new safe_1.ZWaveError(`firmwareVersions must be an array of strings in the format "major.minor" or "major.minor.patch", received "${JSON.stringify(options.firmwareVersions)}"`, safe_1.ZWaveErrorCodes.Argument_Invalid);
511
+ }
512
+ this.libraryType = options.libraryType;
513
+ this.protocolVersion = options.protocolVersion;
514
+ this.firmwareVersions = options.firmwareVersions;
515
+ this.hardwareVersion = options.hardwareVersion;
516
+ }
517
+ static from(raw, ctx) {
518
+ (0, safe_1.validatePayload)(raw.payload.length >= 5);
519
+ const libraryType = raw.payload[0];
520
+ const protocolVersion = `${raw.payload[1]}.${raw.payload[2]}`;
521
+ const firmwareVersions = [`${raw.payload[3]}.${raw.payload[4]}`];
522
+ let hardwareVersion;
523
+ if (raw.payload.length >= 7) {
524
+ // V2+
525
+ hardwareVersion = raw.payload[5];
526
+ const additionalFirmwares = raw.payload[6];
527
+ (0, safe_1.validatePayload)(raw.payload.length >= 7 + 2 * additionalFirmwares);
528
+ for (let i = 0; i < additionalFirmwares; i++) {
529
+ firmwareVersions.push(`${raw.payload[7 + 2 * i]}.${raw.payload[7 + 2 * i + 1]}`);
529
530
  }
530
- this.libraryType = options.libraryType;
531
- this.protocolVersion = options.protocolVersion;
532
- this.firmwareVersions = options.firmwareVersions;
533
- this.hardwareVersion = options.hardwareVersion;
534
531
  }
532
+ return new VersionCCReport_1({
533
+ nodeId: ctx.sourceNodeId,
534
+ libraryType,
535
+ protocolVersion,
536
+ firmwareVersions,
537
+ hardwareVersion,
538
+ });
535
539
  }
536
540
  libraryType;
537
541
  protocolVersion;
538
542
  firmwareVersions;
539
543
  hardwareVersion;
540
- serialize() {
544
+ serialize(ctx) {
541
545
  this.payload = Buffer.from([
542
546
  this.libraryType,
543
547
  ...this.protocolVersion
@@ -562,9 +566,9 @@ let VersionCCReport = class VersionCCReport extends VersionCC {
562
566
  }
563
567
  this.payload = Buffer.concat([this.payload, firmwaresBuffer]);
564
568
  }
565
- return super.serialize();
569
+ return super.serialize(ctx);
566
570
  }
567
- toLogEntry(host) {
571
+ toLogEntry(ctx) {
568
572
  const message = {
569
573
  "library type": (0, safe_2.getEnumMemberName)(safe_1.ZWaveLibraryTypes, this.libraryType),
570
574
  "protocol version": this.protocolVersion,
@@ -574,7 +578,7 @@ let VersionCCReport = class VersionCCReport extends VersionCC {
574
578
  message["hardware version"] = this.hardwareVersion;
575
579
  }
576
580
  return {
577
- ...super.toLogEntry(host),
581
+ ...super.toLogEntry(ctx),
578
582
  message,
579
583
  };
580
584
  }
@@ -592,7 +596,7 @@ __decorate([
592
596
  __decorate([
593
597
  (0, CommandClassDecorators_1.ccValue)(exports.VersionCCValues.hardwareVersion)
594
598
  ], VersionCCReport.prototype, "hardwareVersion", void 0);
595
- exports.VersionCCReport = VersionCCReport = __decorate([
599
+ exports.VersionCCReport = VersionCCReport = VersionCCReport_1 = __decorate([
596
600
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.Report)
597
601
  ], VersionCCReport);
598
602
  let VersionCCGet = class VersionCCGet extends VersionCC {
@@ -602,28 +606,31 @@ exports.VersionCCGet = VersionCCGet = __decorate([
602
606
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.Get),
603
607
  (0, CommandClassDecorators_1.expectedCCResponse)(VersionCCReport)
604
608
  ], VersionCCGet);
605
- let VersionCCCommandClassReport = class VersionCCCommandClassReport extends VersionCC {
606
- constructor(host, options) {
607
- super(host, options);
608
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
609
- (0, safe_1.validatePayload)(this.payload.length >= 2);
610
- this.requestedCC = this.payload[0];
611
- this.ccVersion = this.payload[1];
612
- }
613
- else {
614
- this.requestedCC = options.requestedCC;
615
- this.ccVersion = options.ccVersion;
616
- }
609
+ let VersionCCCommandClassReport = VersionCCCommandClassReport_1 = class VersionCCCommandClassReport extends VersionCC {
610
+ constructor(options) {
611
+ super(options);
612
+ this.requestedCC = options.requestedCC;
613
+ this.ccVersion = options.ccVersion;
614
+ }
615
+ static from(raw, ctx) {
616
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
617
+ const requestedCC = raw.payload[0];
618
+ const ccVersion = raw.payload[1];
619
+ return new VersionCCCommandClassReport_1({
620
+ nodeId: ctx.sourceNodeId,
621
+ requestedCC,
622
+ ccVersion,
623
+ });
617
624
  }
618
625
  ccVersion;
619
626
  requestedCC;
620
- serialize() {
627
+ serialize(ctx) {
621
628
  this.payload = Buffer.from([this.requestedCC, this.ccVersion]);
622
- return super.serialize();
629
+ return super.serialize(ctx);
623
630
  }
624
- toLogEntry(host) {
631
+ toLogEntry(ctx) {
625
632
  return {
626
- ...super.toLogEntry(host),
633
+ ...super.toLogEntry(ctx),
627
634
  message: {
628
635
  CC: (0, safe_1.getCCName)(this.requestedCC),
629
636
  version: this.ccVersion,
@@ -632,63 +639,67 @@ let VersionCCCommandClassReport = class VersionCCCommandClassReport extends Vers
632
639
  }
633
640
  };
634
641
  exports.VersionCCCommandClassReport = VersionCCCommandClassReport;
635
- exports.VersionCCCommandClassReport = VersionCCCommandClassReport = __decorate([
642
+ exports.VersionCCCommandClassReport = VersionCCCommandClassReport = VersionCCCommandClassReport_1 = __decorate([
636
643
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.CommandClassReport)
637
644
  ], VersionCCCommandClassReport);
638
645
  function testResponseForVersionCommandClassGet(sent, received) {
639
646
  // We expect a Version CommandClass Report that matches the requested CC
640
647
  return sent.requestedCC === received.requestedCC;
641
648
  }
642
- let VersionCCCommandClassGet = class VersionCCCommandClassGet extends VersionCC {
643
- constructor(host, options) {
644
- super(host, options);
645
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
646
- (0, safe_1.validatePayload)(this.payload.length >= 1);
647
- this.requestedCC = this.payload[0];
648
- }
649
- else {
650
- this.requestedCC = options.requestedCC;
651
- }
649
+ let VersionCCCommandClassGet = VersionCCCommandClassGet_1 = class VersionCCCommandClassGet extends VersionCC {
650
+ constructor(options) {
651
+ super(options);
652
+ this.requestedCC = options.requestedCC;
653
+ }
654
+ static from(raw, ctx) {
655
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
656
+ const requestedCC = raw.payload[0];
657
+ return new VersionCCCommandClassGet_1({
658
+ nodeId: ctx.sourceNodeId,
659
+ requestedCC,
660
+ });
652
661
  }
653
662
  requestedCC;
654
- serialize() {
663
+ serialize(ctx) {
655
664
  this.payload = Buffer.from([this.requestedCC]);
656
- return super.serialize();
665
+ return super.serialize(ctx);
657
666
  }
658
- toLogEntry(host) {
667
+ toLogEntry(ctx) {
659
668
  return {
660
- ...super.toLogEntry(host),
669
+ ...super.toLogEntry(ctx),
661
670
  message: { CC: (0, safe_1.getCCName)(this.requestedCC) },
662
671
  };
663
672
  }
664
673
  };
665
674
  exports.VersionCCCommandClassGet = VersionCCCommandClassGet;
666
- exports.VersionCCCommandClassGet = VersionCCCommandClassGet = __decorate([
675
+ exports.VersionCCCommandClassGet = VersionCCCommandClassGet = VersionCCCommandClassGet_1 = __decorate([
667
676
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.CommandClassGet),
668
677
  (0, CommandClassDecorators_1.expectedCCResponse)(VersionCCCommandClassReport, testResponseForVersionCommandClassGet)
669
678
  ], VersionCCCommandClassGet);
670
- let VersionCCCapabilitiesReport = class VersionCCCapabilitiesReport extends VersionCC {
671
- constructor(host, options) {
672
- super(host, options);
673
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
674
- (0, safe_1.validatePayload)(this.payload.length >= 1);
675
- const capabilities = this.payload[0];
676
- this.supportsZWaveSoftwareGet = !!(capabilities & 0b100);
677
- }
678
- else {
679
- this.supportsZWaveSoftwareGet = options.supportsZWaveSoftwareGet;
680
- }
679
+ let VersionCCCapabilitiesReport = VersionCCCapabilitiesReport_1 = class VersionCCCapabilitiesReport extends VersionCC {
680
+ constructor(options) {
681
+ super(options);
682
+ this.supportsZWaveSoftwareGet = options.supportsZWaveSoftwareGet;
683
+ }
684
+ static from(raw, ctx) {
685
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
686
+ const capabilities = raw.payload[0];
687
+ const supportsZWaveSoftwareGet = !!(capabilities & 0b100);
688
+ return new VersionCCCapabilitiesReport_1({
689
+ nodeId: ctx.sourceNodeId,
690
+ supportsZWaveSoftwareGet,
691
+ });
681
692
  }
682
693
  supportsZWaveSoftwareGet;
683
- serialize() {
694
+ serialize(ctx) {
684
695
  this.payload = Buffer.from([
685
696
  (this.supportsZWaveSoftwareGet ? 0b100 : 0) | 0b11,
686
697
  ]);
687
- return super.serialize();
698
+ return super.serialize(ctx);
688
699
  }
689
- toLogEntry(host) {
700
+ toLogEntry(ctx) {
690
701
  return {
691
- ...super.toLogEntry(host),
702
+ ...super.toLogEntry(ctx),
692
703
  message: {
693
704
  "supports Z-Wave Software Get command": this.supportsZWaveSoftwareGet,
694
705
  },
@@ -699,7 +710,7 @@ exports.VersionCCCapabilitiesReport = VersionCCCapabilitiesReport;
699
710
  __decorate([
700
711
  (0, CommandClassDecorators_1.ccValue)(exports.VersionCCValues.supportsZWaveSoftwareGet)
701
712
  ], VersionCCCapabilitiesReport.prototype, "supportsZWaveSoftwareGet", void 0);
702
- exports.VersionCCCapabilitiesReport = VersionCCCapabilitiesReport = __decorate([
713
+ exports.VersionCCCapabilitiesReport = VersionCCCapabilitiesReport = VersionCCCapabilitiesReport_1 = __decorate([
703
714
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.CapabilitiesReport)
704
715
  ], VersionCCCapabilitiesReport);
705
716
  let VersionCCCapabilitiesGet = class VersionCCCapabilitiesGet extends VersionCC {
@@ -709,39 +720,69 @@ exports.VersionCCCapabilitiesGet = VersionCCCapabilitiesGet = __decorate([
709
720
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.CapabilitiesGet),
710
721
  (0, CommandClassDecorators_1.expectedCCResponse)(VersionCCCapabilitiesReport)
711
722
  ], VersionCCCapabilitiesGet);
712
- let VersionCCZWaveSoftwareReport = class VersionCCZWaveSoftwareReport extends VersionCC {
713
- constructor(host, options) {
714
- super(host, options);
715
- (0, safe_1.validatePayload)(this.payload.length >= 23);
716
- this.sdkVersion = parseVersion(this.payload);
717
- this.applicationFrameworkAPIVersion = parseVersion(this.payload.subarray(3));
718
- if (this.applicationFrameworkAPIVersion !== "unused") {
719
- this.applicationFrameworkBuildNumber = this.payload.readUInt16BE(6);
723
+ let VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport_1 = class VersionCCZWaveSoftwareReport extends VersionCC {
724
+ constructor(options) {
725
+ super(options);
726
+ // TODO: Check implementation:
727
+ this.sdkVersion = options.sdkVersion;
728
+ this.applicationFrameworkAPIVersion =
729
+ options.applicationFrameworkAPIVersion;
730
+ this.applicationFrameworkBuildNumber =
731
+ options.applicationFrameworkBuildNumber;
732
+ this.hostInterfaceVersion = options.hostInterfaceVersion;
733
+ this.hostInterfaceBuildNumber = options.hostInterfaceBuildNumber;
734
+ this.zWaveProtocolVersion = options.zWaveProtocolVersion;
735
+ this.zWaveProtocolBuildNumber = options.zWaveProtocolBuildNumber;
736
+ this.applicationVersion = options.applicationVersion;
737
+ this.applicationBuildNumber = options.applicationBuildNumber;
738
+ }
739
+ static from(raw, ctx) {
740
+ (0, safe_1.validatePayload)(raw.payload.length >= 23);
741
+ const sdkVersion = parseVersion(raw.payload);
742
+ const applicationFrameworkAPIVersion = parseVersion(raw.payload.subarray(3));
743
+ let applicationFrameworkBuildNumber;
744
+ if (applicationFrameworkAPIVersion !== "unused") {
745
+ applicationFrameworkBuildNumber = raw.payload.readUInt16BE(6);
720
746
  }
721
747
  else {
722
- this.applicationFrameworkBuildNumber = 0;
748
+ applicationFrameworkBuildNumber = 0;
723
749
  }
724
- this.hostInterfaceVersion = parseVersion(this.payload.subarray(8));
725
- if (this.hostInterfaceVersion !== "unused") {
726
- this.hostInterfaceBuildNumber = this.payload.readUInt16BE(11);
750
+ const hostInterfaceVersion = parseVersion(raw.payload.subarray(8));
751
+ let hostInterfaceBuildNumber;
752
+ if (hostInterfaceVersion !== "unused") {
753
+ hostInterfaceBuildNumber = raw.payload.readUInt16BE(11);
727
754
  }
728
755
  else {
729
- this.hostInterfaceBuildNumber = 0;
756
+ hostInterfaceBuildNumber = 0;
730
757
  }
731
- this.zWaveProtocolVersion = parseVersion(this.payload.subarray(13));
732
- if (this.zWaveProtocolVersion !== "unused") {
733
- this.zWaveProtocolBuildNumber = this.payload.readUInt16BE(16);
758
+ const zWaveProtocolVersion = parseVersion(raw.payload.subarray(13));
759
+ let zWaveProtocolBuildNumber;
760
+ if (zWaveProtocolVersion !== "unused") {
761
+ zWaveProtocolBuildNumber = raw.payload.readUInt16BE(16);
734
762
  }
735
763
  else {
736
- this.zWaveProtocolBuildNumber = 0;
764
+ zWaveProtocolBuildNumber = 0;
737
765
  }
738
- this.applicationVersion = parseVersion(this.payload.subarray(18));
739
- if (this.applicationVersion !== "unused") {
740
- this.applicationBuildNumber = this.payload.readUInt16BE(21);
766
+ const applicationVersion = parseVersion(raw.payload.subarray(18));
767
+ let applicationBuildNumber;
768
+ if (applicationVersion !== "unused") {
769
+ applicationBuildNumber = raw.payload.readUInt16BE(21);
741
770
  }
742
771
  else {
743
- this.applicationBuildNumber = 0;
744
- }
772
+ applicationBuildNumber = 0;
773
+ }
774
+ return new VersionCCZWaveSoftwareReport_1({
775
+ nodeId: ctx.sourceNodeId,
776
+ sdkVersion,
777
+ applicationFrameworkAPIVersion,
778
+ applicationFrameworkBuildNumber,
779
+ hostInterfaceVersion,
780
+ hostInterfaceBuildNumber,
781
+ zWaveProtocolVersion,
782
+ zWaveProtocolBuildNumber,
783
+ applicationVersion,
784
+ applicationBuildNumber,
785
+ });
745
786
  }
746
787
  sdkVersion;
747
788
  applicationFrameworkAPIVersion;
@@ -752,7 +793,7 @@ let VersionCCZWaveSoftwareReport = class VersionCCZWaveSoftwareReport extends Ve
752
793
  zWaveProtocolBuildNumber;
753
794
  applicationVersion;
754
795
  applicationBuildNumber;
755
- toLogEntry(host) {
796
+ toLogEntry(ctx) {
756
797
  const message = {
757
798
  "SDK version": this.sdkVersion,
758
799
  };
@@ -777,7 +818,7 @@ let VersionCCZWaveSoftwareReport = class VersionCCZWaveSoftwareReport extends Ve
777
818
  message["application build number"] = this.applicationBuildNumber;
778
819
  }
779
820
  return {
780
- ...super.toLogEntry(host),
821
+ ...super.toLogEntry(ctx),
781
822
  message,
782
823
  };
783
824
  }
@@ -810,7 +851,7 @@ __decorate([
810
851
  __decorate([
811
852
  (0, CommandClassDecorators_1.ccValue)(exports.VersionCCValues.applicationBuildNumber)
812
853
  ], VersionCCZWaveSoftwareReport.prototype, "applicationBuildNumber", void 0);
813
- exports.VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport = __decorate([
854
+ exports.VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport_1 = __decorate([
814
855
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.ZWaveSoftwareReport)
815
856
  ], VersionCCZWaveSoftwareReport);
816
857
  let VersionCCZWaveSoftwareGet = class VersionCCZWaveSoftwareGet extends VersionCC {