@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,7 +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 AssociationGroupInfoCC_1;
8
+ var AssociationGroupInfoCC_1, AssociationGroupInfoCCNameReport_1, AssociationGroupInfoCCNameGet_1, AssociationGroupInfoCCInfoReport_1, AssociationGroupInfoCCInfoGet_1, AssociationGroupInfoCCCommandListReport_1, AssociationGroupInfoCCCommandListGet_1;
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.AssociationGroupInfoCCCommandListGet = exports.AssociationGroupInfoCCCommandListReport = exports.AssociationGroupInfoCCInfoGet = exports.AssociationGroupInfoCCInfoReport = exports.AssociationGroupInfoCCNameGet = exports.AssociationGroupInfoCCNameReport = exports.AssociationGroupInfoCC = exports.AssociationGroupInfoCCAPI = exports.AssociationGroupInfoCCValues = void 0;
11
11
  function __assertType(argName, typeName, boundHasError) {
@@ -40,7 +40,7 @@ const __assertType__optional_boolean = $o => {
40
40
  }
41
41
  return optional__boolean($o);
42
42
  };
43
- const __assertType__AssociationGroupInfoCCInfoReportSpecificOptions = $o => {
43
+ const __assertType__AssociationGroupInfoCCInfoReportOptions = $o => {
44
44
  function _boolean($o) {
45
45
  return typeof $o !== "boolean" ? {} : null;
46
46
  }
@@ -220,12 +220,12 @@ let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends API_1.Ph
220
220
  async getGroupName(groupId) {
221
221
  __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
222
222
  this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.NameGet);
223
- const cc = new AssociationGroupInfoCCNameGet(this.applHost, {
223
+ const cc = new AssociationGroupInfoCCNameGet({
224
224
  nodeId: this.endpoint.nodeId,
225
- endpoint: this.endpoint.index,
225
+ endpointIndex: this.endpoint.index,
226
226
  groupId,
227
227
  });
228
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
228
+ const response = await this.host.sendCommand(cc, this.commandOptions);
229
229
  if (response)
230
230
  return response.name;
231
231
  }
@@ -233,25 +233,25 @@ let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends API_1.Ph
233
233
  __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
234
234
  __assertType("name", "string", __assertType__string.bind(void 0, name));
235
235
  this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.NameReport);
236
- const cc = new AssociationGroupInfoCCNameReport(this.applHost, {
236
+ const cc = new AssociationGroupInfoCCNameReport({
237
237
  nodeId: this.endpoint.nodeId,
238
- endpoint: this.endpoint.index,
238
+ endpointIndex: this.endpoint.index,
239
239
  groupId,
240
240
  name,
241
241
  });
242
- await this.applHost.sendCommand(cc, this.commandOptions);
242
+ await this.host.sendCommand(cc, this.commandOptions);
243
243
  }
244
244
  async getGroupInfo(groupId, refreshCache = false) {
245
245
  __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
246
246
  __assertType("refreshCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, refreshCache));
247
247
  this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.InfoGet);
248
- const cc = new AssociationGroupInfoCCInfoGet(this.applHost, {
248
+ const cc = new AssociationGroupInfoCCInfoGet({
249
249
  nodeId: this.endpoint.nodeId,
250
- endpoint: this.endpoint.index,
250
+ endpointIndex: this.endpoint.index,
251
251
  groupId,
252
252
  refreshCache,
253
253
  });
254
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
254
+ const response = await this.host.sendCommand(cc, this.commandOptions);
255
255
  // SDS13782 says: If List Mode is set to 0, the Group Count field MUST be set to 1.
256
256
  // But that's not always the case. Apparently some endpoints return 0 groups
257
257
  // although they support AGI CC
@@ -264,26 +264,26 @@ let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends API_1.Ph
264
264
  }
265
265
  }
266
266
  async reportGroupInfo(options) {
267
- __assertType("options", "AssociationGroupInfoCCInfoReportSpecificOptions", __assertType__AssociationGroupInfoCCInfoReportSpecificOptions.bind(void 0, options));
267
+ __assertType("options", "AssociationGroupInfoCCInfoReportOptions", __assertType__AssociationGroupInfoCCInfoReportOptions.bind(void 0, options));
268
268
  this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.InfoReport);
269
- const cc = new AssociationGroupInfoCCInfoReport(this.applHost, {
269
+ const cc = new AssociationGroupInfoCCInfoReport({
270
270
  nodeId: this.endpoint.nodeId,
271
- endpoint: this.endpoint.index,
271
+ endpointIndex: this.endpoint.index,
272
272
  ...options,
273
273
  });
274
- await this.applHost.sendCommand(cc, this.commandOptions);
274
+ await this.host.sendCommand(cc, this.commandOptions);
275
275
  }
276
276
  async getCommands(groupId, allowCache = true) {
277
277
  __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
278
278
  __assertType("allowCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, allowCache));
279
279
  this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.CommandListGet);
280
- const cc = new AssociationGroupInfoCCCommandListGet(this.applHost, {
280
+ const cc = new AssociationGroupInfoCCCommandListGet({
281
281
  nodeId: this.endpoint.nodeId,
282
- endpoint: this.endpoint.index,
282
+ endpointIndex: this.endpoint.index,
283
283
  groupId,
284
284
  allowCache,
285
285
  });
286
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
286
+ const response = await this.host.sendCommand(cc, this.commandOptions);
287
287
  if (response)
288
288
  return response.commands;
289
289
  }
@@ -291,13 +291,13 @@ let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends API_1.Ph
291
291
  __assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
292
292
  __assertType("commands", undefined, __assertType___0_1_2.bind(void 0, commands));
293
293
  this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.CommandListReport);
294
- const cc = new AssociationGroupInfoCCCommandListReport(this.applHost, {
294
+ const cc = new AssociationGroupInfoCCCommandListReport({
295
295
  nodeId: this.endpoint.nodeId,
296
- endpoint: this.endpoint.index,
296
+ endpointIndex: this.endpoint.index,
297
297
  groupId,
298
298
  commands,
299
299
  });
300
- await this.applHost.sendCommand(cc, this.commandOptions);
300
+ await this.host.sendCommand(cc, this.commandOptions);
301
301
  }
302
302
  };
303
303
  exports.AssociationGroupInfoCCAPI = AssociationGroupInfoCCAPI;
@@ -314,28 +314,28 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
314
314
  ];
315
315
  }
316
316
  /** Returns the name of an association group */
317
- static getGroupNameCached(applHost, endpoint, groupId) {
318
- return applHost
317
+ static getGroupNameCached(ctx, endpoint, groupId) {
318
+ return ctx
319
319
  .getValueDB(endpoint.nodeId)
320
320
  .getValue(exports.AssociationGroupInfoCCValues.groupName(groupId).endpoint(endpoint.index));
321
321
  }
322
322
  /** Returns the association profile for an association group */
323
- static getGroupProfileCached(applHost, endpoint, groupId) {
324
- return applHost.getValueDB(endpoint.nodeId).getValue(exports.AssociationGroupInfoCCValues.groupInfo(groupId).endpoint(endpoint.index))
323
+ static getGroupProfileCached(ctx, endpoint, groupId) {
324
+ return ctx.getValueDB(endpoint.nodeId).getValue(exports.AssociationGroupInfoCCValues.groupInfo(groupId).endpoint(endpoint.index))
325
325
  ?.profile;
326
326
  }
327
327
  /** Returns the dictionary of all commands issued by the given association group */
328
- static getIssuedCommandsCached(applHost, endpoint, groupId) {
329
- return applHost
328
+ static getIssuedCommandsCached(ctx, endpoint, groupId) {
329
+ return ctx
330
330
  .getValueDB(endpoint.nodeId)
331
331
  .getValue(exports.AssociationGroupInfoCCValues.commands(groupId).endpoint(endpoint.index));
332
332
  }
333
- static findGroupsForIssuedCommand(applHost, endpoint, ccId, command) {
333
+ static findGroupsForIssuedCommand(ctx, endpoint, ccId, command) {
334
334
  const ret = [];
335
- const associationGroupCount = this.getAssociationGroupCountCached(applHost, endpoint);
335
+ const associationGroupCount = this.getAssociationGroupCountCached(ctx, endpoint);
336
336
  for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
337
337
  // Scan the issued commands of all groups if there's a match
338
- const issuedCommands = this.getIssuedCommandsCached(applHost, endpoint, groupId);
338
+ const issuedCommands = this.getIssuedCommandsCached(ctx, endpoint, groupId);
339
339
  if (!issuedCommands)
340
340
  continue;
341
341
  if (issuedCommands.has(ccId)
@@ -346,33 +346,33 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
346
346
  }
347
347
  return ret;
348
348
  }
349
- static getAssociationGroupCountCached(applHost, endpoint) {
349
+ static getAssociationGroupCountCached(ctx, endpoint) {
350
350
  // The association group count is either determined by the
351
351
  // Association CC or the Multi Channel Association CC
352
352
  return (
353
353
  // First query the Multi Channel Association CC
354
+ // And fall back to 0
354
355
  (endpoint.supportsCC(safe_1.CommandClasses["Multi Channel Association"])
355
- && MultiChannelAssociationCC_1.MultiChannelAssociationCC.getGroupCountCached(applHost, endpoint))
356
+ && MultiChannelAssociationCC_1.MultiChannelAssociationCC.getGroupCountCached(ctx, endpoint))
356
357
  // Then the Association CC
357
358
  || (endpoint.supportsCC(safe_1.CommandClasses.Association)
358
- && AssociationCC_1.AssociationCC.getGroupCountCached(applHost, endpoint))
359
- // And fall back to 0
359
+ && AssociationCC_1.AssociationCC.getGroupCountCached(ctx, endpoint))
360
360
  || 0);
361
361
  }
362
- async interview(applHost) {
363
- const node = this.getNode(applHost);
364
- const endpoint = this.getEndpoint(applHost);
365
- const api = API_1.CCAPI.create(safe_1.CommandClasses["Association Group Information"], applHost, endpoint).withOptions({ priority: safe_1.MessagePriority.NodeQuery });
366
- applHost.controllerLog.logNode(node.id, {
362
+ async interview(ctx) {
363
+ const node = this.getNode(ctx);
364
+ const endpoint = this.getEndpoint(ctx);
365
+ const api = API_1.CCAPI.create(safe_1.CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: safe_1.MessagePriority.NodeQuery });
366
+ ctx.logNode(node.id, {
367
367
  endpoint: this.endpointIndex,
368
368
  message: `Interviewing ${this.ccName}...`,
369
369
  direction: "none",
370
370
  });
371
371
  const associationGroupCount = AssociationGroupInfoCC_1
372
- .getAssociationGroupCountCached(applHost, endpoint);
372
+ .getAssociationGroupCountCached(ctx, endpoint);
373
373
  for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
374
374
  // First get the group's name
375
- applHost.controllerLog.logNode(node.id, {
375
+ ctx.logNode(node.id, {
376
376
  endpoint: this.endpointIndex,
377
377
  message: `Association group #${groupId}: Querying name...`,
378
378
  direction: "outbound",
@@ -380,14 +380,14 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
380
380
  const name = await api.getGroupName(groupId);
381
381
  if (name) {
382
382
  const logMessage = `Association group #${groupId} has name "${name}"`;
383
- applHost.controllerLog.logNode(node.id, {
383
+ ctx.logNode(node.id, {
384
384
  endpoint: this.endpointIndex,
385
385
  message: logMessage,
386
386
  direction: "inbound",
387
387
  });
388
388
  }
389
389
  // Then the command list
390
- applHost.controllerLog.logNode(node.id, {
390
+ ctx.logNode(node.id, {
391
391
  endpoint: this.endpointIndex,
392
392
  message: `Association group #${groupId}: Querying command list...`,
393
393
  direction: "outbound",
@@ -396,21 +396,21 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
396
396
  // Not sure how to log this
397
397
  }
398
398
  // Finally query each group for its information
399
- await this.refreshValues(applHost);
399
+ await this.refreshValues(ctx);
400
400
  // Remember that the interview is complete
401
- this.setInterviewComplete(applHost, true);
401
+ this.setInterviewComplete(ctx, true);
402
402
  }
403
- async refreshValues(applHost) {
404
- const node = this.getNode(applHost);
405
- const endpoint = this.getEndpoint(applHost);
406
- const api = API_1.CCAPI.create(safe_1.CommandClasses["Association Group Information"], applHost, endpoint).withOptions({ priority: safe_1.MessagePriority.NodeQuery });
403
+ async refreshValues(ctx) {
404
+ const node = this.getNode(ctx);
405
+ const endpoint = this.getEndpoint(ctx);
406
+ const api = API_1.CCAPI.create(safe_1.CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: safe_1.MessagePriority.NodeQuery });
407
407
  // Query the information for each group (this is the only thing that could be dynamic)
408
408
  const associationGroupCount = AssociationGroupInfoCC_1
409
- .getAssociationGroupCountCached(applHost, endpoint);
410
- const hasDynamicInfo = this.getValue(applHost, exports.AssociationGroupInfoCCValues.hasDynamicInfo);
409
+ .getAssociationGroupCountCached(ctx, endpoint);
410
+ const hasDynamicInfo = this.getValue(ctx, exports.AssociationGroupInfoCCValues.hasDynamicInfo);
411
411
  for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
412
412
  // Then its information
413
- applHost.controllerLog.logNode(node.id, {
413
+ ctx.logNode(node.id, {
414
414
  endpoint: this.endpointIndex,
415
415
  message: `Association group #${groupId}: Querying info...`,
416
416
  direction: "outbound",
@@ -420,7 +420,7 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
420
420
  const logMessage = `Received info for association group #${groupId}:
421
421
  info is dynamic: ${info.hasDynamicInfo}
422
422
  profile: ${(0, safe_2.getEnumMemberName)(_Types_1.AssociationGroupInfoProfile, info.profile)}`;
423
- applHost.controllerLog.logNode(node.id, {
423
+ ctx.logNode(node.id, {
424
424
  endpoint: this.endpointIndex,
425
425
  message: logMessage,
426
426
  direction: "inbound",
@@ -435,42 +435,45 @@ exports.AssociationGroupInfoCC = AssociationGroupInfoCC = AssociationGroupInfoCC
435
435
  (0, CommandClassDecorators_1.implementedVersion)(3),
436
436
  (0, CommandClassDecorators_1.ccValues)(exports.AssociationGroupInfoCCValues)
437
437
  ], AssociationGroupInfoCC);
438
- let AssociationGroupInfoCCNameReport = class AssociationGroupInfoCCNameReport extends AssociationGroupInfoCC {
439
- constructor(host, options) {
440
- super(host, options);
441
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
442
- (0, safe_1.validatePayload)(this.payload.length >= 2);
443
- this.groupId = this.payload[0];
444
- const nameLength = this.payload[1];
445
- (0, safe_1.validatePayload)(this.payload.length >= 2 + nameLength);
446
- // The specs don't allow 0-terminated string, but some devices use them
447
- // So we need to cut them off
448
- this.name = (0, safe_2.cpp2js)(this.payload.subarray(2, 2 + nameLength).toString("utf8"));
449
- }
450
- else {
451
- this.groupId = options.groupId;
452
- this.name = options.name;
453
- }
438
+ let AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport_1 = class AssociationGroupInfoCCNameReport extends AssociationGroupInfoCC {
439
+ constructor(options) {
440
+ super(options);
441
+ this.groupId = options.groupId;
442
+ this.name = options.name;
443
+ }
444
+ static from(raw, ctx) {
445
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
446
+ const groupId = raw.payload[0];
447
+ const nameLength = raw.payload[1];
448
+ (0, safe_1.validatePayload)(raw.payload.length >= 2 + nameLength);
449
+ // The specs don't allow 0-terminated string, but some devices use them
450
+ // So we need to cut them off
451
+ const name = (0, safe_2.cpp2js)(raw.payload.subarray(2, 2 + nameLength).toString("utf8"));
452
+ return new AssociationGroupInfoCCNameReport_1({
453
+ nodeId: ctx.sourceNodeId,
454
+ groupId,
455
+ name,
456
+ });
454
457
  }
455
458
  groupId;
456
459
  name;
457
- persistValues(applHost) {
458
- if (!super.persistValues(applHost))
460
+ persistValues(ctx) {
461
+ if (!super.persistValues(ctx))
459
462
  return false;
460
- const valueDB = this.getValueDB(applHost);
463
+ const valueDB = this.getValueDB(ctx);
461
464
  valueDB.setValue(exports.AssociationGroupInfoCCValues.groupName(this.groupId).endpoint(this.endpointIndex), this.name);
462
465
  return true;
463
466
  }
464
- serialize() {
467
+ serialize(ctx) {
465
468
  this.payload = Buffer.concat([
466
469
  Buffer.from([this.groupId, this.name.length]),
467
470
  Buffer.from(this.name, "utf8"),
468
471
  ]);
469
- return super.serialize();
472
+ return super.serialize(ctx);
470
473
  }
471
- toLogEntry(host) {
474
+ toLogEntry(ctx) {
472
475
  return {
473
- ...super.toLogEntry(host),
476
+ ...super.toLogEntry(ctx),
474
477
  message: {
475
478
  "group id": this.groupId,
476
479
  name: this.name,
@@ -479,75 +482,80 @@ let AssociationGroupInfoCCNameReport = class AssociationGroupInfoCCNameReport ex
479
482
  }
480
483
  };
481
484
  exports.AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport;
482
- exports.AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport = __decorate([
485
+ exports.AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport_1 = __decorate([
483
486
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.NameReport)
484
487
  ], AssociationGroupInfoCCNameReport);
485
- let AssociationGroupInfoCCNameGet = class AssociationGroupInfoCCNameGet extends AssociationGroupInfoCC {
486
- constructor(host, options) {
487
- super(host, options);
488
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
489
- (0, safe_1.validatePayload)(this.payload.length >= 1);
490
- this.groupId = this.payload[0];
491
- }
492
- else {
493
- this.groupId = options.groupId;
494
- }
488
+ let AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet_1 = class AssociationGroupInfoCCNameGet extends AssociationGroupInfoCC {
489
+ constructor(options) {
490
+ super(options);
491
+ this.groupId = options.groupId;
492
+ }
493
+ static from(raw, ctx) {
494
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
495
+ const groupId = raw.payload[0];
496
+ return new AssociationGroupInfoCCNameGet_1({
497
+ nodeId: ctx.sourceNodeId,
498
+ groupId,
499
+ });
495
500
  }
496
501
  groupId;
497
- serialize() {
502
+ serialize(ctx) {
498
503
  this.payload = Buffer.from([this.groupId]);
499
- return super.serialize();
504
+ return super.serialize(ctx);
500
505
  }
501
- toLogEntry(host) {
506
+ toLogEntry(ctx) {
502
507
  return {
503
- ...super.toLogEntry(host),
508
+ ...super.toLogEntry(ctx),
504
509
  message: { "group id": this.groupId },
505
510
  };
506
511
  }
507
512
  };
508
513
  exports.AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet;
509
- exports.AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet = __decorate([
514
+ exports.AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet_1 = __decorate([
510
515
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.NameGet),
511
516
  (0, CommandClassDecorators_1.expectedCCResponse)(AssociationGroupInfoCCNameReport)
512
517
  ], AssociationGroupInfoCCNameGet);
513
- let AssociationGroupInfoCCInfoReport = class AssociationGroupInfoCCInfoReport extends AssociationGroupInfoCC {
514
- constructor(host, options) {
515
- super(host, options);
516
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
517
- (0, safe_1.validatePayload)(this.payload.length >= 1);
518
- this.isListMode = !!(this.payload[0] & 0b1000_0000);
519
- this.hasDynamicInfo = !!(this.payload[0] & 0b0100_0000);
520
- const groupCount = this.payload[0] & 0b0011_1111;
521
- // each group requires 7 bytes of payload
522
- (0, safe_1.validatePayload)(this.payload.length >= 1 + groupCount * 7);
523
- const _groups = [];
524
- for (let i = 0; i < groupCount; i++) {
525
- const offset = 1 + i * 7;
526
- // Parse the payload
527
- const groupBytes = this.payload.subarray(offset, offset + 7);
528
- const groupId = groupBytes[0];
529
- const mode = 0; // groupBytes[1];
530
- const profile = groupBytes.readUInt16BE(2);
531
- const eventCode = 0; // groupBytes.readUInt16BE(5);
532
- _groups.push({ groupId, mode, profile, eventCode });
533
- }
534
- this.groups = _groups;
535
- }
536
- else {
537
- this.isListMode = options.isListMode;
538
- this.hasDynamicInfo = options.hasDynamicInfo;
539
- this.groups = options.groups;
540
- }
518
+ let AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport_1 = class AssociationGroupInfoCCInfoReport extends AssociationGroupInfoCC {
519
+ constructor(options) {
520
+ super(options);
521
+ this.isListMode = options.isListMode;
522
+ this.hasDynamicInfo = options.hasDynamicInfo;
523
+ this.groups = options.groups;
524
+ }
525
+ static from(raw, ctx) {
526
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
527
+ const isListMode = !!(raw.payload[0] & 0b1000_0000);
528
+ const hasDynamicInfo = !!(raw.payload[0] & 0b0100_0000);
529
+ const groupCount = raw.payload[0] & 0b0011_1111;
530
+ // each group requires 7 bytes of payload
531
+ (0, safe_1.validatePayload)(raw.payload.length >= 1 + groupCount * 7);
532
+ const groups = [];
533
+ for (let i = 0; i < groupCount; i++) {
534
+ const offset = 1 + i * 7;
535
+ // Parse the payload
536
+ const groupBytes = raw.payload.subarray(offset, offset + 7);
537
+ const groupId = groupBytes[0];
538
+ const mode = 0; // groupBytes[1];
539
+ const profile = groupBytes.readUInt16BE(2);
540
+ const eventCode = 0; // groupBytes.readUInt16BE(5);
541
+ groups.push({ groupId, mode, profile, eventCode });
542
+ }
543
+ return new AssociationGroupInfoCCInfoReport_1({
544
+ nodeId: ctx.sourceNodeId,
545
+ isListMode,
546
+ hasDynamicInfo,
547
+ groups,
548
+ });
541
549
  }
542
550
  isListMode;
543
551
  hasDynamicInfo;
544
552
  groups;
545
- persistValues(applHost) {
546
- if (!super.persistValues(applHost))
553
+ persistValues(ctx) {
554
+ if (!super.persistValues(ctx))
547
555
  return false;
548
556
  for (const group of this.groups) {
549
557
  const { groupId, mode, profile, eventCode } = group;
550
- this.setValue(applHost, exports.AssociationGroupInfoCCValues.groupInfo(groupId), {
558
+ this.setValue(ctx, exports.AssociationGroupInfoCCValues.groupInfo(groupId), {
551
559
  mode,
552
560
  profile,
553
561
  eventCode,
@@ -555,7 +563,7 @@ let AssociationGroupInfoCCInfoReport = class AssociationGroupInfoCCInfoReport ex
555
563
  }
556
564
  return true;
557
565
  }
558
- serialize() {
566
+ serialize(ctx) {
559
567
  this.payload = Buffer.alloc(1 + this.groups.length * 7, 0);
560
568
  this.payload[0] = (this.isListMode ? 0b1000_0000 : 0)
561
569
  | (this.hasDynamicInfo ? 0b0100_0000 : 0)
@@ -566,11 +574,11 @@ let AssociationGroupInfoCCInfoReport = class AssociationGroupInfoCCInfoReport ex
566
574
  this.payload.writeUint16BE(this.groups[i].profile, offset + 2);
567
575
  // The remaining bytes are zero
568
576
  }
569
- return super.serialize();
577
+ return super.serialize(ctx);
570
578
  }
571
- toLogEntry(host) {
579
+ toLogEntry(ctx) {
572
580
  return {
573
- ...super.toLogEntry(host),
581
+ ...super.toLogEntry(ctx),
574
582
  message: {
575
583
  "is list mode": this.isListMode,
576
584
  "has dynamic info": this.hasDynamicInfo,
@@ -589,33 +597,38 @@ exports.AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport;
589
597
  __decorate([
590
598
  (0, CommandClassDecorators_1.ccValue)(exports.AssociationGroupInfoCCValues.hasDynamicInfo)
591
599
  ], AssociationGroupInfoCCInfoReport.prototype, "hasDynamicInfo", void 0);
592
- exports.AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport = __decorate([
600
+ exports.AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport_1 = __decorate([
593
601
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.InfoReport)
594
602
  ], AssociationGroupInfoCCInfoReport);
595
- let AssociationGroupInfoCCInfoGet = class AssociationGroupInfoCCInfoGet extends AssociationGroupInfoCC {
596
- constructor(host, options) {
597
- super(host, options);
598
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
599
- (0, safe_1.validatePayload)(this.payload.length >= 2);
600
- const optionByte = this.payload[0];
601
- this.refreshCache = !!(optionByte & 0b1000_0000);
602
- this.listMode = !!(optionByte & 0b0100_0000);
603
- if (!this.listMode) {
604
- this.groupId = this.payload[1];
605
- }
606
- }
607
- else {
608
- this.refreshCache = options.refreshCache;
609
- if ("listMode" in options)
610
- this.listMode = options.listMode;
611
- if ("groupId" in options)
612
- this.groupId = options.groupId;
613
- }
603
+ let AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet_1 = class AssociationGroupInfoCCInfoGet extends AssociationGroupInfoCC {
604
+ constructor(options) {
605
+ super(options);
606
+ this.refreshCache = options.refreshCache;
607
+ if ("listMode" in options)
608
+ this.listMode = options.listMode;
609
+ if ("groupId" in options)
610
+ this.groupId = options.groupId;
611
+ }
612
+ static from(raw, ctx) {
613
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
614
+ const optionByte = raw.payload[0];
615
+ const refreshCache = !!(optionByte & 0b1000_0000);
616
+ const listMode = !!(optionByte & 0b0100_0000);
617
+ let groupId;
618
+ if (!listMode) {
619
+ groupId = raw.payload[1];
620
+ }
621
+ return new AssociationGroupInfoCCInfoGet_1({
622
+ nodeId: ctx.sourceNodeId,
623
+ refreshCache,
624
+ listMode,
625
+ groupId,
626
+ });
614
627
  }
615
628
  refreshCache;
616
629
  listMode;
617
630
  groupId;
618
- serialize() {
631
+ serialize(ctx) {
619
632
  const isListMode = this.listMode === true;
620
633
  const optionByte = (this.refreshCache ? 0b1000_0000 : 0)
621
634
  | (isListMode ? 0b0100_0000 : 0);
@@ -623,9 +636,9 @@ let AssociationGroupInfoCCInfoGet = class AssociationGroupInfoCCInfoGet extends
623
636
  optionByte,
624
637
  isListMode ? 0 : this.groupId,
625
638
  ]);
626
- return super.serialize();
639
+ return super.serialize(ctx);
627
640
  }
628
- toLogEntry(host) {
641
+ toLogEntry(ctx) {
629
642
  const message = {};
630
643
  if (this.groupId != undefined) {
631
644
  message["group id"] = this.groupId;
@@ -635,46 +648,48 @@ let AssociationGroupInfoCCInfoGet = class AssociationGroupInfoCCInfoGet extends
635
648
  }
636
649
  message["refresh cache"] = this.refreshCache;
637
650
  return {
638
- ...super.toLogEntry(host),
651
+ ...super.toLogEntry(ctx),
639
652
  message,
640
653
  };
641
654
  }
642
655
  };
643
656
  exports.AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet;
644
- exports.AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet = __decorate([
657
+ exports.AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet_1 = __decorate([
645
658
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.InfoGet),
646
659
  (0, CommandClassDecorators_1.expectedCCResponse)(AssociationGroupInfoCCInfoReport)
647
660
  ], AssociationGroupInfoCCInfoGet);
648
- let AssociationGroupInfoCCCommandListReport = class AssociationGroupInfoCCCommandListReport extends AssociationGroupInfoCC {
649
- constructor(host, options) {
650
- super(host, options);
651
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
652
- (0, safe_1.validatePayload)(this.payload.length >= 2);
653
- this.groupId = this.payload[0];
654
- const listLength = this.payload[1];
655
- (0, safe_1.validatePayload)(this.payload.length >= 2 + listLength);
656
- const listBytes = this.payload.subarray(2, 2 + listLength);
657
- // Parse all CC ids and commands
658
- let offset = 0;
659
- const commands = new Map();
660
- while (offset < listLength) {
661
- const { ccId, bytesRead } = (0, safe_1.parseCCId)(listBytes, offset);
662
- const command = listBytes[offset + bytesRead];
663
- if (!commands.has(ccId))
664
- commands.set(ccId, []);
665
- commands.get(ccId).push(command);
666
- offset += bytesRead + 1;
667
- }
668
- this.commands = commands;
669
- }
670
- else {
671
- this.groupId = options.groupId;
672
- this.commands = options.commands;
673
- }
661
+ let AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport_1 = class AssociationGroupInfoCCCommandListReport extends AssociationGroupInfoCC {
662
+ constructor(options) {
663
+ super(options);
664
+ this.groupId = options.groupId;
665
+ this.commands = options.commands;
666
+ }
667
+ static from(raw, ctx) {
668
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
669
+ const groupId = raw.payload[0];
670
+ const listLength = raw.payload[1];
671
+ (0, safe_1.validatePayload)(raw.payload.length >= 2 + listLength);
672
+ const listBytes = raw.payload.subarray(2, 2 + listLength);
673
+ // Parse all CC ids and commands
674
+ let offset = 0;
675
+ const commands = new Map();
676
+ while (offset < listLength) {
677
+ const { ccId, bytesRead } = (0, safe_1.parseCCId)(listBytes, offset);
678
+ const command = listBytes[offset + bytesRead];
679
+ if (!commands.has(ccId))
680
+ commands.set(ccId, []);
681
+ commands.get(ccId).push(command);
682
+ offset += bytesRead + 1;
683
+ }
684
+ return new AssociationGroupInfoCCCommandListReport_1({
685
+ nodeId: ctx.sourceNodeId,
686
+ groupId,
687
+ commands,
688
+ });
674
689
  }
675
690
  groupId;
676
691
  commands;
677
- serialize() {
692
+ serialize(ctx) {
678
693
  // To make it easier to encode possible extended CCs, we first
679
694
  // allocate as much space as we may need, then trim it again
680
695
  this.payload = Buffer.allocUnsafe(2 + this.commands.size * 3);
@@ -688,11 +703,11 @@ let AssociationGroupInfoCCCommandListReport = class AssociationGroupInfoCCComman
688
703
  }
689
704
  }
690
705
  this.payload[1] = offset - 2; // list length
691
- return super.serialize();
706
+ return super.serialize(ctx);
692
707
  }
693
- toLogEntry(host) {
708
+ toLogEntry(ctx) {
694
709
  return {
695
- ...super.toLogEntry(host),
710
+ ...super.toLogEntry(ctx),
696
711
  message: {
697
712
  "group id": this.groupId,
698
713
  commands: `${[...this.commands]
@@ -710,34 +725,37 @@ exports.AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandL
710
725
  __decorate([
711
726
  (0, CommandClassDecorators_1.ccValue)(exports.AssociationGroupInfoCCValues.commands, (self) => [self.groupId])
712
727
  ], AssociationGroupInfoCCCommandListReport.prototype, "commands", void 0);
713
- exports.AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport = __decorate([
728
+ exports.AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport_1 = __decorate([
714
729
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.CommandListReport)
715
730
  ], AssociationGroupInfoCCCommandListReport);
716
- let AssociationGroupInfoCCCommandListGet = class AssociationGroupInfoCCCommandListGet extends AssociationGroupInfoCC {
717
- constructor(host, options) {
718
- super(host, options);
719
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
720
- (0, safe_1.validatePayload)(this.payload.length >= 2);
721
- this.allowCache = !!(this.payload[0] & 0b1000_0000);
722
- this.groupId = this.payload[1];
723
- }
724
- else {
725
- this.allowCache = options.allowCache;
726
- this.groupId = options.groupId;
727
- }
731
+ let AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet_1 = class AssociationGroupInfoCCCommandListGet extends AssociationGroupInfoCC {
732
+ constructor(options) {
733
+ super(options);
734
+ this.allowCache = options.allowCache;
735
+ this.groupId = options.groupId;
736
+ }
737
+ static from(raw, ctx) {
738
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
739
+ const allowCache = !!(raw.payload[0] & 0b1000_0000);
740
+ const groupId = raw.payload[1];
741
+ return new AssociationGroupInfoCCCommandListGet_1({
742
+ nodeId: ctx.sourceNodeId,
743
+ allowCache,
744
+ groupId,
745
+ });
728
746
  }
729
747
  allowCache;
730
748
  groupId;
731
- serialize() {
749
+ serialize(ctx) {
732
750
  this.payload = Buffer.from([
733
751
  this.allowCache ? 0b1000_0000 : 0,
734
752
  this.groupId,
735
753
  ]);
736
- return super.serialize();
754
+ return super.serialize(ctx);
737
755
  }
738
- toLogEntry(host) {
756
+ toLogEntry(ctx) {
739
757
  return {
740
- ...super.toLogEntry(host),
758
+ ...super.toLogEntry(ctx),
741
759
  message: {
742
760
  "group id": this.groupId,
743
761
  "allow cache": this.allowCache,
@@ -746,7 +764,7 @@ let AssociationGroupInfoCCCommandListGet = class AssociationGroupInfoCCCommandLi
746
764
  }
747
765
  };
748
766
  exports.AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet;
749
- exports.AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet = __decorate([
767
+ exports.AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet_1 = __decorate([
750
768
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.CommandListGet),
751
769
  (0, CommandClassDecorators_1.expectedCCResponse)(AssociationGroupInfoCCCommandListReport)
752
770
  ], AssociationGroupInfoCCCommandListGet);