@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
@@ -28,7 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  __setModuleDefault(result, mod);
29
29
  return result;
30
30
  };
31
- var AssociationCC_1;
31
+ var AssociationCC_1, AssociationCCSet_1, AssociationCCRemove_1, AssociationCCReport_1, AssociationCCGet_1, AssociationCCSupportedGroupingsReport_1, AssociationCCSpecificGroupReport_1;
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
33
  exports.AssociationCCSpecificGroupGet = exports.AssociationCCSpecificGroupReport = exports.AssociationCCSupportedGroupingsGet = exports.AssociationCCSupportedGroupingsReport = exports.AssociationCCGet = exports.AssociationCCReport = exports.AssociationCCRemove = exports.AssociationCCSet = exports.AssociationCC = exports.AssociationCCAPI = exports.AssociationCCValues = void 0;
34
34
  function __assertType(argName, typeName, boundHasError) {
@@ -43,7 +43,7 @@ const __assertType__number = $o => {
43
43
  }
44
44
  return _number($o);
45
45
  };
46
- const __assertType__AssociationCCReportSpecificOptions = $o => {
46
+ const __assertType__AssociationCCReportOptions = $o => {
47
47
  function _number($o) {
48
48
  return typeof $o !== "number" ? {} : null;
49
49
  }
@@ -184,23 +184,23 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
184
184
  */
185
185
  async getGroupCount() {
186
186
  this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SupportedGroupingsGet);
187
- const cc = new AssociationCCSupportedGroupingsGet(this.applHost, {
187
+ const cc = new AssociationCCSupportedGroupingsGet({
188
188
  nodeId: this.endpoint.nodeId,
189
- endpoint: this.endpoint.index,
189
+ endpointIndex: this.endpoint.index,
190
190
  });
191
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
191
+ const response = await this.host.sendCommand(cc, this.commandOptions);
192
192
  if (response)
193
193
  return response.groupCount;
194
194
  }
195
195
  async reportGroupCount(groupCount) {
196
196
  __assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount));
197
197
  this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SupportedGroupingsReport);
198
- const cc = new AssociationCCSupportedGroupingsReport(this.applHost, {
198
+ const cc = new AssociationCCSupportedGroupingsReport({
199
199
  nodeId: this.endpoint.nodeId,
200
- endpoint: this.endpoint.index,
200
+ endpointIndex: this.endpoint.index,
201
201
  groupCount,
202
202
  });
203
- await this.applHost.sendCommand(cc, this.commandOptions);
203
+ await this.host.sendCommand(cc, this.commandOptions);
204
204
  }
205
205
  /**
206
206
  * Returns information about an association group.
@@ -208,12 +208,12 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
208
208
  async getGroup(groupId) {
209
209
  __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
210
210
  this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Get);
211
- const cc = new AssociationCCGet(this.applHost, {
211
+ const cc = new AssociationCCGet({
212
212
  nodeId: this.endpoint.nodeId,
213
- endpoint: this.endpoint.index,
213
+ endpointIndex: this.endpoint.index,
214
214
  groupId,
215
215
  });
216
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
216
+ const response = await this.host.sendCommand(cc, this.commandOptions);
217
217
  if (response) {
218
218
  return {
219
219
  maxNodes: response.maxNodes,
@@ -222,14 +222,14 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
222
222
  }
223
223
  }
224
224
  async sendReport(options) {
225
- __assertType("options", "AssociationCCReportSpecificOptions", __assertType__AssociationCCReportSpecificOptions.bind(void 0, options));
225
+ __assertType("options", "AssociationCCReportOptions", __assertType__AssociationCCReportOptions.bind(void 0, options));
226
226
  this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Report);
227
- const cc = new AssociationCCReport(this.applHost, {
227
+ const cc = new AssociationCCReport({
228
228
  nodeId: this.endpoint.nodeId,
229
- endpoint: this.endpoint.index,
229
+ endpointIndex: this.endpoint.index,
230
230
  ...options,
231
231
  });
232
- await this.applHost.sendCommand(cc, this.commandOptions);
232
+ await this.host.sendCommand(cc, this.commandOptions);
233
233
  }
234
234
  /**
235
235
  * Adds new nodes to an association group
@@ -238,13 +238,13 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
238
238
  __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
239
239
  __assertType("nodeIds", undefined, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
240
240
  this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Set);
241
- const cc = new AssociationCCSet(this.applHost, {
241
+ const cc = new AssociationCCSet({
242
242
  nodeId: this.endpoint.nodeId,
243
- endpoint: this.endpoint.index,
243
+ endpointIndex: this.endpoint.index,
244
244
  groupId,
245
245
  nodeIds,
246
246
  });
247
- return this.applHost.sendCommand(cc, this.commandOptions);
247
+ return this.host.sendCommand(cc, this.commandOptions);
248
248
  }
249
249
  /**
250
250
  * Removes nodes from an association group
@@ -252,12 +252,21 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
252
252
  async removeNodeIds(options) {
253
253
  __assertType("options", "AssociationCCRemoveOptions", __assertType__AssociationCCRemoveOptions.bind(void 0, options));
254
254
  this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Remove);
255
- const cc = new AssociationCCRemove(this.applHost, {
255
+ // Validate options
256
+ if (!options.groupId) {
257
+ if (this.version === 1) {
258
+ throw new safe_1.ZWaveError(`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
259
+ }
260
+ }
261
+ else if (options.groupId < 0) {
262
+ throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
263
+ }
264
+ const cc = new AssociationCCRemove({
256
265
  nodeId: this.endpoint.nodeId,
257
- endpoint: this.endpoint.index,
266
+ endpointIndex: this.endpoint.index,
258
267
  ...options,
259
268
  });
260
- return this.applHost.sendCommand(cc, this.commandOptions);
269
+ return this.host.sendCommand(cc, this.commandOptions);
261
270
  }
262
271
  /**
263
272
  * Removes nodes from all association groups
@@ -283,11 +292,11 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
283
292
  */
284
293
  async getSpecificGroup() {
285
294
  this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SpecificGroupGet);
286
- const cc = new AssociationCCSpecificGroupGet(this.applHost, {
295
+ const cc = new AssociationCCSpecificGroupGet({
287
296
  nodeId: this.endpoint.nodeId,
288
- endpoint: this.endpoint.index,
297
+ endpointIndex: this.endpoint.index,
289
298
  });
290
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
299
+ const response = await this.host.sendCommand(cc, this.commandOptions);
291
300
  return response?.group;
292
301
  }
293
302
  /**
@@ -296,12 +305,12 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
296
305
  async reportSpecificGroup(group) {
297
306
  __assertType("group", "number", __assertType__number.bind(void 0, group));
298
307
  this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SpecificGroupReport);
299
- const cc = new AssociationCCSpecificGroupReport(this.applHost, {
308
+ const cc = new AssociationCCSpecificGroupReport({
300
309
  nodeId: this.endpoint.nodeId,
301
- endpoint: this.endpoint.index,
310
+ endpointIndex: this.endpoint.index,
302
311
  group,
303
312
  });
304
- await this.applHost.sendCommand(cc, this.commandOptions);
313
+ await this.host.sendCommand(cc, this.commandOptions);
305
314
  }
306
315
  };
307
316
  exports.AssociationCCAPI = AssociationCCAPI;
@@ -322,22 +331,22 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
322
331
  * Returns the number of association groups reported by the node/endpoint.
323
332
  * This only works AFTER the interview process
324
333
  */
325
- static getGroupCountCached(applHost, endpoint) {
326
- return (applHost
334
+ static getGroupCountCached(ctx, endpoint) {
335
+ return ctx
327
336
  .getValueDB(endpoint.nodeId)
328
- .getValue(exports.AssociationCCValues.groupCount.endpoint(endpoint.index)) || 0);
337
+ .getValue(exports.AssociationCCValues.groupCount.endpoint(endpoint.index)) || 0;
329
338
  }
330
339
  /**
331
340
  * Returns the number of nodes an association group supports.
332
341
  * This only works AFTER the interview process
333
342
  */
334
- static getMaxNodesCached(applHost, endpoint, groupId) {
335
- return (applHost
343
+ static getMaxNodesCached(ctx, endpoint, groupId) {
344
+ return (ctx
336
345
  .getValueDB(endpoint.nodeId)
337
346
  .getValue(exports.AssociationCCValues.maxNodes(groupId).endpoint(endpoint.index))
338
347
  // If the information is not available, fall back to the configuration file if possible
339
348
  // This can happen on some legacy devices which have "hidden" association groups
340
- ?? applHost
349
+ ?? ctx
341
350
  .getDeviceConfig?.(endpoint.nodeId)
342
351
  ?.getAssociationConfigForEndpoint(endpoint.index, groupId)
343
352
  ?.maxNodes
@@ -347,10 +356,10 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
347
356
  * Returns all the destinations of all association groups reported by the node/endpoint.
348
357
  * This only works AFTER the interview process
349
358
  */
350
- static getAllDestinationsCached(applHost, endpoint) {
359
+ static getAllDestinationsCached(ctx, endpoint) {
351
360
  const ret = new Map();
352
- const groupCount = this.getGroupCountCached(applHost, endpoint);
353
- const valueDB = applHost.getValueDB(endpoint.nodeId);
361
+ const groupCount = this.getGroupCountCached(ctx, endpoint);
362
+ const valueDB = ctx.getValueDB(endpoint.nodeId);
354
363
  for (let i = 1; i <= groupCount; i++) {
355
364
  // Add all root destinations
356
365
  const nodes = valueDB.getValue(exports.AssociationCCValues.nodeIds(i).endpoint(endpoint.index)) ?? [];
@@ -360,13 +369,13 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
360
369
  }
361
370
  return ret;
362
371
  }
363
- async interview(applHost) {
364
- const node = this.getNode(applHost);
365
- const endpoint = this.getEndpoint(applHost);
366
- const api = API_1.CCAPI.create(safe_1.CommandClasses.Association, applHost, endpoint).withOptions({
372
+ async interview(ctx) {
373
+ const node = this.getNode(ctx);
374
+ const endpoint = this.getEndpoint(ctx);
375
+ const api = API_1.CCAPI.create(safe_1.CommandClasses.Association, ctx, endpoint).withOptions({
367
376
  priority: safe_1.MessagePriority.NodeQuery,
368
377
  });
369
- applHost.controllerLog.logNode(node.id, {
378
+ ctx.logNode(node.id, {
370
379
  endpoint: this.endpointIndex,
371
380
  message: `Interviewing ${this.ccName}...`,
372
381
  direction: "none",
@@ -375,21 +384,21 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
375
384
  // normal association groups since some devices report more association groups than
376
385
  // multi channel association groups
377
386
  // Find out how many groups are supported
378
- applHost.controllerLog.logNode(node.id, {
387
+ ctx.logNode(node.id, {
379
388
  endpoint: this.endpointIndex,
380
389
  message: "querying number of association groups...",
381
390
  direction: "outbound",
382
391
  });
383
392
  const groupCount = await api.getGroupCount();
384
393
  if (groupCount != undefined) {
385
- applHost.controllerLog.logNode(node.id, {
394
+ ctx.logNode(node.id, {
386
395
  endpoint: this.endpointIndex,
387
396
  message: `supports ${groupCount} association groups`,
388
397
  direction: "inbound",
389
398
  });
390
399
  }
391
400
  else {
392
- applHost.controllerLog.logNode(node.id, {
401
+ ctx.logNode(node.id, {
393
402
  endpoint: this.endpointIndex,
394
403
  message: "Querying association groups timed out, skipping interview...",
395
404
  level: "warn",
@@ -397,32 +406,32 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
397
406
  return;
398
407
  }
399
408
  // Query each association group for its members
400
- await this.refreshValues(applHost);
409
+ await this.refreshValues(ctx);
401
410
  // Skip the remaining Association CC interview in favor of Multi Channel Association if possible
402
411
  if (endpoint.supportsCC(safe_1.CommandClasses["Multi Channel Association"])) {
403
- applHost.controllerLog.logNode(node.id, {
412
+ ctx.logNode(node.id, {
404
413
  endpoint: this.endpointIndex,
405
414
  message: `${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,
406
415
  direction: "none",
407
416
  });
408
- this.setInterviewComplete(applHost, true);
417
+ this.setInterviewComplete(ctx, true);
409
418
  return;
410
419
  }
411
420
  // And set up lifeline associations
412
- await ccUtils.configureLifelineAssociations(applHost, endpoint);
421
+ await ccUtils.configureLifelineAssociations(ctx, endpoint);
413
422
  // Remember that the interview is complete
414
- this.setInterviewComplete(applHost, true);
423
+ this.setInterviewComplete(ctx, true);
415
424
  }
416
- async refreshValues(applHost) {
417
- const node = this.getNode(applHost);
418
- const endpoint = this.getEndpoint(applHost);
419
- const api = API_1.CCAPI.create(safe_1.CommandClasses.Association, applHost, endpoint).withOptions({
425
+ async refreshValues(ctx) {
426
+ const node = this.getNode(ctx);
427
+ const endpoint = this.getEndpoint(ctx);
428
+ const api = API_1.CCAPI.create(safe_1.CommandClasses.Association, ctx, endpoint).withOptions({
420
429
  priority: safe_1.MessagePriority.NodeQuery,
421
430
  });
422
- const groupCount = AssociationCC_1.getGroupCountCached(applHost, endpoint);
431
+ const groupCount = AssociationCC_1.getGroupCountCached(ctx, endpoint);
423
432
  // Query each association group
424
433
  for (let groupId = 1; groupId <= groupCount; groupId++) {
425
- applHost.controllerLog.logNode(node.id, {
434
+ ctx.logNode(node.id, {
426
435
  endpoint: this.endpointIndex,
427
436
  message: `querying association group #${groupId}...`,
428
437
  direction: "outbound",
@@ -432,7 +441,7 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
432
441
  const logMessage = `received information for association group #${groupId}:
433
442
  maximum # of nodes: ${group.maxNodes}
434
443
  currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
435
- applHost.controllerLog.logNode(node.id, {
444
+ ctx.logNode(node.id, {
436
445
  endpoint: this.endpointIndex,
437
446
  message: logMessage,
438
447
  direction: "inbound",
@@ -447,32 +456,35 @@ exports.AssociationCC = AssociationCC = AssociationCC_1 = __decorate([
447
456
  (0, CommandClassDecorators_1.implementedVersion)(4),
448
457
  (0, CommandClassDecorators_1.ccValues)(exports.AssociationCCValues)
449
458
  ], AssociationCC);
450
- let AssociationCCSet = class AssociationCCSet extends AssociationCC {
451
- constructor(host, options) {
452
- super(host, options);
453
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
454
- (0, safe_1.validatePayload)(this.payload.length >= 2);
455
- this.groupId = this.payload[0];
456
- this.nodeIds = [...this.payload.subarray(1)];
459
+ let AssociationCCSet = AssociationCCSet_1 = class AssociationCCSet extends AssociationCC {
460
+ constructor(options) {
461
+ super(options);
462
+ if (options.groupId < 1) {
463
+ throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
457
464
  }
458
- else {
459
- if (options.groupId < 1) {
460
- throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
461
- }
462
- if (options.nodeIds.some((n) => n < 1 || n > safe_1.MAX_NODES)) {
463
- throw new safe_1.ZWaveError(`All node IDs must be between 1 and ${safe_1.MAX_NODES}!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
464
- }
465
- this.groupId = options.groupId;
466
- this.nodeIds = options.nodeIds;
465
+ if (options.nodeIds.some((n) => n < 1 || n > safe_1.MAX_NODES)) {
466
+ throw new safe_1.ZWaveError(`All node IDs must be between 1 and ${safe_1.MAX_NODES}!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
467
467
  }
468
+ this.groupId = options.groupId;
469
+ this.nodeIds = options.nodeIds;
470
+ }
471
+ static from(raw, ctx) {
472
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
473
+ const groupId = raw.payload[0];
474
+ const nodeIds = [...raw.payload.subarray(1)];
475
+ return new AssociationCCSet_1({
476
+ nodeId: ctx.sourceNodeId,
477
+ groupId,
478
+ nodeIds,
479
+ });
468
480
  }
469
481
  groupId;
470
482
  nodeIds;
471
- serialize() {
483
+ serialize(ctx) {
472
484
  this.payload = Buffer.from([this.groupId, ...this.nodeIds]);
473
- return super.serialize();
485
+ return super.serialize(ctx);
474
486
  }
475
- toLogEntry(host) {
487
+ toLogEntry(ctx) {
476
488
  const message = {
477
489
  "group id": this.groupId || "all groups",
478
490
  "node ids": this.nodeIds.length
@@ -480,53 +492,47 @@ let AssociationCCSet = class AssociationCCSet extends AssociationCC {
480
492
  : "all nodes",
481
493
  };
482
494
  return {
483
- ...super.toLogEntry(host),
495
+ ...super.toLogEntry(ctx),
484
496
  message,
485
497
  };
486
498
  }
487
499
  };
488
500
  exports.AssociationCCSet = AssociationCCSet;
489
- exports.AssociationCCSet = AssociationCCSet = __decorate([
501
+ exports.AssociationCCSet = AssociationCCSet = AssociationCCSet_1 = __decorate([
490
502
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.Set),
491
503
  (0, CommandClassDecorators_1.useSupervision)()
492
504
  ], AssociationCCSet);
493
- let AssociationCCRemove = class AssociationCCRemove extends AssociationCC {
494
- constructor(host, options) {
495
- super(host, options);
496
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
497
- (0, safe_1.validatePayload)(this.payload.length >= 1);
498
- if (this.payload[0] !== 0) {
499
- this.groupId = this.payload[0];
500
- }
501
- this.nodeIds = [...this.payload.subarray(1)];
502
- }
503
- else {
504
- // Validate options
505
- if (!options.groupId) {
506
- if (this.version === 1) {
507
- throw new safe_1.ZWaveError(`Node ${this
508
- .nodeId} only supports AssociationCC V1 which requires the group Id to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
509
- }
510
- }
511
- else if (options.groupId < 0) {
512
- throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
513
- }
514
- // When removing associations, we allow invalid node IDs.
515
- // See GH#3606 - it is possible that those exist.
516
- this.groupId = options.groupId;
517
- this.nodeIds = options.nodeIds;
505
+ let AssociationCCRemove = AssociationCCRemove_1 = class AssociationCCRemove extends AssociationCC {
506
+ constructor(options) {
507
+ super(options);
508
+ // When removing associations, we allow invalid node IDs.
509
+ // See GH#3606 - it is possible that those exist.
510
+ this.groupId = options.groupId;
511
+ this.nodeIds = options.nodeIds;
512
+ }
513
+ static from(raw, ctx) {
514
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
515
+ let groupId;
516
+ if (raw.payload[0] !== 0) {
517
+ groupId = raw.payload[0];
518
518
  }
519
+ const nodeIds = [...raw.payload.subarray(1)];
520
+ return new AssociationCCRemove_1({
521
+ nodeId: ctx.sourceNodeId,
522
+ groupId,
523
+ nodeIds,
524
+ });
519
525
  }
520
526
  groupId;
521
527
  nodeIds;
522
- serialize() {
528
+ serialize(ctx) {
523
529
  this.payload = Buffer.from([
524
530
  this.groupId || 0,
525
531
  ...(this.nodeIds || []),
526
532
  ]);
527
- return super.serialize();
533
+ return super.serialize(ctx);
528
534
  }
529
- toLogEntry(host) {
535
+ toLogEntry(ctx) {
530
536
  const message = {
531
537
  "group id": this.groupId || "all groups",
532
538
  "node ids": this.nodeIds && this.nodeIds.length
@@ -534,32 +540,37 @@ let AssociationCCRemove = class AssociationCCRemove extends AssociationCC {
534
540
  : "all nodes",
535
541
  };
536
542
  return {
537
- ...super.toLogEntry(host),
543
+ ...super.toLogEntry(ctx),
538
544
  message,
539
545
  };
540
546
  }
541
547
  };
542
548
  exports.AssociationCCRemove = AssociationCCRemove;
543
- exports.AssociationCCRemove = AssociationCCRemove = __decorate([
549
+ exports.AssociationCCRemove = AssociationCCRemove = AssociationCCRemove_1 = __decorate([
544
550
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.Remove),
545
551
  (0, CommandClassDecorators_1.useSupervision)()
546
552
  ], AssociationCCRemove);
547
- let AssociationCCReport = class AssociationCCReport extends AssociationCC {
548
- constructor(host, options) {
549
- super(host, options);
550
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
551
- (0, safe_1.validatePayload)(this.payload.length >= 3);
552
- this.groupId = this.payload[0];
553
- this.maxNodes = this.payload[1];
554
- this.reportsToFollow = this.payload[2];
555
- this.nodeIds = [...this.payload.subarray(3)];
556
- }
557
- else {
558
- this.groupId = options.groupId;
559
- this.maxNodes = options.maxNodes;
560
- this.nodeIds = options.nodeIds;
561
- this.reportsToFollow = options.reportsToFollow;
562
- }
553
+ let AssociationCCReport = AssociationCCReport_1 = class AssociationCCReport extends AssociationCC {
554
+ constructor(options) {
555
+ super(options);
556
+ this.groupId = options.groupId;
557
+ this.maxNodes = options.maxNodes;
558
+ this.nodeIds = options.nodeIds;
559
+ this.reportsToFollow = options.reportsToFollow;
560
+ }
561
+ static from(raw, ctx) {
562
+ (0, safe_1.validatePayload)(raw.payload.length >= 3);
563
+ const groupId = raw.payload[0];
564
+ const maxNodes = raw.payload[1];
565
+ const reportsToFollow = raw.payload[2];
566
+ const nodeIds = [...raw.payload.subarray(3)];
567
+ return new AssociationCCReport_1({
568
+ nodeId: ctx.sourceNodeId,
569
+ groupId,
570
+ maxNodes,
571
+ reportsToFollow,
572
+ nodeIds,
573
+ });
563
574
  }
564
575
  groupId;
565
576
  maxNodes;
@@ -572,24 +583,24 @@ let AssociationCCReport = class AssociationCCReport extends AssociationCC {
572
583
  expectMoreMessages() {
573
584
  return this.reportsToFollow > 0;
574
585
  }
575
- mergePartialCCs(applHost, partials) {
586
+ mergePartialCCs(partials, _ctx) {
576
587
  // Concat the list of nodes
577
588
  this.nodeIds = [...partials, this]
578
589
  .map((report) => report.nodeIds)
579
590
  .reduce((prev, cur) => prev.concat(...cur), []);
580
591
  }
581
- serialize() {
592
+ serialize(ctx) {
582
593
  this.payload = Buffer.from([
583
594
  this.groupId,
584
595
  this.maxNodes,
585
596
  this.reportsToFollow,
586
597
  ...this.nodeIds,
587
598
  ]);
588
- return super.serialize();
599
+ return super.serialize(ctx);
589
600
  }
590
- toLogEntry(host) {
601
+ toLogEntry(ctx) {
591
602
  return {
592
- ...super.toLogEntry(host),
603
+ ...super.toLogEntry(ctx),
593
604
  message: {
594
605
  "group id": this.groupId,
595
606
  "max # of nodes": this.maxNodes,
@@ -606,59 +617,63 @@ __decorate([
606
617
  __decorate([
607
618
  (0, CommandClassDecorators_1.ccValue)(exports.AssociationCCValues.nodeIds, (self) => [self.groupId])
608
619
  ], AssociationCCReport.prototype, "nodeIds", void 0);
609
- exports.AssociationCCReport = AssociationCCReport = __decorate([
620
+ exports.AssociationCCReport = AssociationCCReport = AssociationCCReport_1 = __decorate([
610
621
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.Report)
611
622
  ], AssociationCCReport);
612
- let AssociationCCGet = class AssociationCCGet extends AssociationCC {
613
- constructor(host, options) {
614
- super(host, options);
615
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
616
- (0, safe_1.validatePayload)(this.payload.length >= 1);
617
- this.groupId = this.payload[0];
618
- }
619
- else {
620
- if (options.groupId < 1) {
621
- throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
622
- }
623
- this.groupId = options.groupId;
623
+ let AssociationCCGet = AssociationCCGet_1 = class AssociationCCGet extends AssociationCC {
624
+ constructor(options) {
625
+ super(options);
626
+ if (options.groupId < 1) {
627
+ throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
624
628
  }
629
+ this.groupId = options.groupId;
630
+ }
631
+ static from(raw, ctx) {
632
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
633
+ const groupId = raw.payload[0];
634
+ return new AssociationCCGet_1({
635
+ nodeId: ctx.sourceNodeId,
636
+ groupId,
637
+ });
625
638
  }
626
639
  groupId;
627
- serialize() {
640
+ serialize(ctx) {
628
641
  this.payload = Buffer.from([this.groupId]);
629
- return super.serialize();
642
+ return super.serialize(ctx);
630
643
  }
631
- toLogEntry(host) {
644
+ toLogEntry(ctx) {
632
645
  return {
633
- ...super.toLogEntry(host),
646
+ ...super.toLogEntry(ctx),
634
647
  message: { "group id": this.groupId },
635
648
  };
636
649
  }
637
650
  };
638
651
  exports.AssociationCCGet = AssociationCCGet;
639
- exports.AssociationCCGet = AssociationCCGet = __decorate([
652
+ exports.AssociationCCGet = AssociationCCGet = AssociationCCGet_1 = __decorate([
640
653
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.Get),
641
654
  (0, CommandClassDecorators_1.expectedCCResponse)(AssociationCCReport)
642
655
  ], AssociationCCGet);
643
- let AssociationCCSupportedGroupingsReport = class AssociationCCSupportedGroupingsReport extends AssociationCC {
644
- constructor(host, options) {
645
- super(host, options);
646
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
647
- (0, safe_1.validatePayload)(this.payload.length >= 1);
648
- this.groupCount = this.payload[0];
649
- }
650
- else {
651
- this.groupCount = options.groupCount;
652
- }
656
+ let AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport_1 = class AssociationCCSupportedGroupingsReport extends AssociationCC {
657
+ constructor(options) {
658
+ super(options);
659
+ this.groupCount = options.groupCount;
660
+ }
661
+ static from(raw, ctx) {
662
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
663
+ const groupCount = raw.payload[0];
664
+ return new AssociationCCSupportedGroupingsReport_1({
665
+ nodeId: ctx.sourceNodeId,
666
+ groupCount,
667
+ });
653
668
  }
654
669
  groupCount;
655
- serialize() {
670
+ serialize(ctx) {
656
671
  this.payload = Buffer.from([this.groupCount]);
657
- return super.serialize();
672
+ return super.serialize(ctx);
658
673
  }
659
- toLogEntry(host) {
674
+ toLogEntry(ctx) {
660
675
  return {
661
- ...super.toLogEntry(host),
676
+ ...super.toLogEntry(ctx),
662
677
  message: { "group count": this.groupCount },
663
678
  };
664
679
  }
@@ -667,7 +682,7 @@ exports.AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsR
667
682
  __decorate([
668
683
  (0, CommandClassDecorators_1.ccValue)(exports.AssociationCCValues.groupCount)
669
684
  ], AssociationCCSupportedGroupingsReport.prototype, "groupCount", void 0);
670
- exports.AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport = __decorate([
685
+ exports.AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport_1 = __decorate([
671
686
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.SupportedGroupingsReport)
672
687
  ], AssociationCCSupportedGroupingsReport);
673
688
  let AssociationCCSupportedGroupingsGet = class AssociationCCSupportedGroupingsGet extends AssociationCC {
@@ -677,31 +692,33 @@ exports.AssociationCCSupportedGroupingsGet = AssociationCCSupportedGroupingsGet
677
692
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.SupportedGroupingsGet),
678
693
  (0, CommandClassDecorators_1.expectedCCResponse)(AssociationCCSupportedGroupingsReport)
679
694
  ], AssociationCCSupportedGroupingsGet);
680
- let AssociationCCSpecificGroupReport = class AssociationCCSpecificGroupReport extends AssociationCC {
681
- constructor(host, options) {
682
- super(host, options);
683
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
684
- (0, safe_1.validatePayload)(this.payload.length >= 1);
685
- this.group = this.payload[0];
686
- }
687
- else {
688
- this.group = options.group;
689
- }
695
+ let AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport_1 = class AssociationCCSpecificGroupReport extends AssociationCC {
696
+ constructor(options) {
697
+ super(options);
698
+ this.group = options.group;
699
+ }
700
+ static from(raw, ctx) {
701
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
702
+ const group = raw.payload[0];
703
+ return new AssociationCCSpecificGroupReport_1({
704
+ nodeId: ctx.sourceNodeId,
705
+ group,
706
+ });
690
707
  }
691
708
  group;
692
- serialize() {
709
+ serialize(ctx) {
693
710
  this.payload = Buffer.from([this.group]);
694
- return super.serialize();
711
+ return super.serialize(ctx);
695
712
  }
696
- toLogEntry(host) {
713
+ toLogEntry(ctx) {
697
714
  return {
698
- ...super.toLogEntry(host),
715
+ ...super.toLogEntry(ctx),
699
716
  message: { group: this.group },
700
717
  };
701
718
  }
702
719
  };
703
720
  exports.AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport;
704
- exports.AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport = __decorate([
721
+ exports.AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport_1 = __decorate([
705
722
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.SpecificGroupReport)
706
723
  ], AssociationCCSpecificGroupReport);
707
724
  let AssociationCCSpecificGroupGet = class AssociationCCSpecificGroupGet extends AssociationCC {