@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 IrrigationCC_1;
8
+ var IrrigationCC_1, IrrigationCCSystemInfoReport_1, IrrigationCCSystemStatusReport_1, IrrigationCCSystemConfigReport_1, IrrigationCCValveInfoReport_1, IrrigationCCValveConfigReport_1, IrrigationCCValveTableReport_1;
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.IrrigationCCSystemShutoff = exports.IrrigationCCValveTableRun = exports.IrrigationCCValveTableGet = exports.IrrigationCCValveTableReport = exports.IrrigationCCValveTableSet = exports.IrrigationCCValveRun = exports.IrrigationCCValveConfigGet = exports.IrrigationCCValveConfigReport = exports.IrrigationCCValveConfigSet = exports.IrrigationCCValveInfoGet = exports.IrrigationCCValveInfoReport = exports.IrrigationCCSystemConfigGet = exports.IrrigationCCSystemConfigReport = exports.IrrigationCCSystemConfigSet = exports.IrrigationCCSystemStatusGet = exports.IrrigationCCSystemStatusReport = exports.IrrigationCCSystemInfoGet = exports.IrrigationCCSystemInfoReport = exports.IrrigationCC = exports.IrrigationCCAPI = exports.IrrigationCCValues = void 0;
11
11
  function __assertType(argName, typeName, boundHasError) {
@@ -485,11 +485,11 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
485
485
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
486
486
  async getSystemInfo() {
487
487
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemInfoGet);
488
- const cc = new IrrigationCCSystemInfoGet(this.applHost, {
488
+ const cc = new IrrigationCCSystemInfoGet({
489
489
  nodeId: this.endpoint.nodeId,
490
- endpoint: this.endpoint.index,
490
+ endpointIndex: this.endpoint.index,
491
491
  });
492
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
492
+ const response = await this.host.sendCommand(cc, this.commandOptions);
493
493
  if (response) {
494
494
  return (0, safe_2.pick)(response, [
495
495
  "numValves",
@@ -502,11 +502,11 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
502
502
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
503
503
  async getSystemStatus() {
504
504
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemStatusGet);
505
- const cc = new IrrigationCCSystemStatusGet(this.applHost, {
505
+ const cc = new IrrigationCCSystemStatusGet({
506
506
  nodeId: this.endpoint.nodeId,
507
- endpoint: this.endpoint.index,
507
+ endpointIndex: this.endpoint.index,
508
508
  });
509
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
509
+ const response = await this.host.sendCommand(cc, this.commandOptions);
510
510
  if (response) {
511
511
  return (0, safe_2.pick)(response, [
512
512
  "systemVoltage",
@@ -530,11 +530,11 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
530
530
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
531
531
  async getSystemConfig() {
532
532
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemConfigGet);
533
- const cc = new IrrigationCCSystemConfigGet(this.applHost, {
533
+ const cc = new IrrigationCCSystemConfigGet({
534
534
  nodeId: this.endpoint.nodeId,
535
- endpoint: this.endpoint.index,
535
+ endpointIndex: this.endpoint.index,
536
536
  });
537
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
537
+ const response = await this.host.sendCommand(cc, this.commandOptions);
538
538
  if (response) {
539
539
  return (0, safe_2.pick)(response, [
540
540
  "masterValveDelay",
@@ -548,22 +548,22 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
548
548
  async setSystemConfig(config) {
549
549
  __assertType("config", "IrrigationCCSystemConfigSetOptions", __assertType__IrrigationCCSystemConfigSetOptions.bind(void 0, config));
550
550
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemConfigSet);
551
- const cc = new IrrigationCCSystemConfigSet(this.applHost, {
551
+ const cc = new IrrigationCCSystemConfigSet({
552
552
  nodeId: this.endpoint.nodeId,
553
- endpoint: this.endpoint.index,
553
+ endpointIndex: this.endpoint.index,
554
554
  ...config,
555
555
  });
556
- return this.applHost.sendCommand(cc, this.commandOptions);
556
+ return this.host.sendCommand(cc, this.commandOptions);
557
557
  }
558
558
  async getValveInfo(valveId) {
559
559
  __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
560
560
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveInfoGet);
561
- const cc = new IrrigationCCValveInfoGet(this.applHost, {
561
+ const cc = new IrrigationCCValveInfoGet({
562
562
  nodeId: this.endpoint.nodeId,
563
- endpoint: this.endpoint.index,
563
+ endpointIndex: this.endpoint.index,
564
564
  valveId,
565
565
  });
566
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
566
+ const response = await this.host.sendCommand(cc, this.commandOptions);
567
567
  if (response) {
568
568
  return (0, safe_2.pick)(response, [
569
569
  "connected",
@@ -580,22 +580,22 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
580
580
  async setValveConfig(options) {
581
581
  __assertType("options", "IrrigationCCValveConfigSetOptions", __assertType__IrrigationCCValveConfigSetOptions.bind(void 0, options));
582
582
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveConfigSet);
583
- const cc = new IrrigationCCValveConfigSet(this.applHost, {
583
+ const cc = new IrrigationCCValveConfigSet({
584
584
  nodeId: this.endpoint.nodeId,
585
- endpoint: this.endpoint.index,
585
+ endpointIndex: this.endpoint.index,
586
586
  ...options,
587
587
  });
588
- return this.applHost.sendCommand(cc, this.commandOptions);
588
+ return this.host.sendCommand(cc, this.commandOptions);
589
589
  }
590
590
  async getValveConfig(valveId) {
591
591
  __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
592
592
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveConfigGet);
593
- const cc = new IrrigationCCValveConfigGet(this.applHost, {
593
+ const cc = new IrrigationCCValveConfigGet({
594
594
  nodeId: this.endpoint.nodeId,
595
- endpoint: this.endpoint.index,
595
+ endpointIndex: this.endpoint.index,
596
596
  valveId,
597
597
  });
598
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
598
+ const response = await this.host.sendCommand(cc, this.commandOptions);
599
599
  if (response) {
600
600
  return (0, safe_2.pick)(response, [
601
601
  "nominalCurrentHighThreshold",
@@ -612,13 +612,13 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
612
612
  __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
613
613
  __assertType("duration", "number", __assertType__number.bind(void 0, duration));
614
614
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveRun);
615
- const cc = new IrrigationCCValveRun(this.applHost, {
615
+ const cc = new IrrigationCCValveRun({
616
616
  nodeId: this.endpoint.nodeId,
617
- endpoint: this.endpoint.index,
617
+ endpointIndex: this.endpoint.index,
618
618
  valveId,
619
619
  duration,
620
620
  });
621
- return this.applHost.sendCommand(cc, this.commandOptions);
621
+ return this.host.sendCommand(cc, this.commandOptions);
622
622
  }
623
623
  shutoffValve(valveId) {
624
624
  __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
@@ -629,29 +629,29 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
629
629
  __assertType("entries", undefined, __assertType__sa__2_ea_2.bind(void 0, entries));
630
630
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveTableSet);
631
631
  if (!this.endpoint.virtual) {
632
- const maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(this.applHost, this.endpoint);
632
+ const maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(this.host, this.endpoint);
633
633
  if (maxValveTableSize != undefined
634
634
  && entries.length > maxValveTableSize) {
635
635
  throw new safe_1.ZWaveError(`The number of valve table entries must not exceed ${maxValveTableSize}.`, safe_1.ZWaveErrorCodes.Argument_Invalid);
636
636
  }
637
637
  }
638
- const cc = new IrrigationCCValveTableSet(this.applHost, {
638
+ const cc = new IrrigationCCValveTableSet({
639
639
  nodeId: this.endpoint.nodeId,
640
- endpoint: this.endpoint.index,
640
+ endpointIndex: this.endpoint.index,
641
641
  tableId,
642
642
  entries,
643
643
  });
644
- return this.applHost.sendCommand(cc, this.commandOptions);
644
+ return this.host.sendCommand(cc, this.commandOptions);
645
645
  }
646
646
  async getValveTable(tableId) {
647
647
  __assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
648
648
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveTableGet);
649
- const cc = new IrrigationCCValveTableGet(this.applHost, {
649
+ const cc = new IrrigationCCValveTableGet({
650
650
  nodeId: this.endpoint.nodeId,
651
- endpoint: this.endpoint.index,
651
+ endpointIndex: this.endpoint.index,
652
652
  tableId,
653
653
  });
654
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
654
+ const response = await this.host.sendCommand(cc, this.commandOptions);
655
655
  if (response) {
656
656
  return response?.entries;
657
657
  }
@@ -659,12 +659,12 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
659
659
  async runTables(tableIDs) {
660
660
  __assertType("tableIDs", undefined, __assertType__sa__number_ea_2.bind(void 0, tableIDs));
661
661
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveTableRun);
662
- const cc = new IrrigationCCValveTableRun(this.applHost, {
662
+ const cc = new IrrigationCCValveTableRun({
663
663
  nodeId: this.endpoint.nodeId,
664
- endpoint: this.endpoint.index,
664
+ endpointIndex: this.endpoint.index,
665
665
  tableIDs,
666
666
  });
667
- return this.applHost.sendCommand(cc, this.commandOptions);
667
+ return this.host.sendCommand(cc, this.commandOptions);
668
668
  }
669
669
  /**
670
670
  * Shuts off the entire system for the given duration.
@@ -673,12 +673,12 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
673
673
  async shutoffSystem(duration) {
674
674
  __assertType("duration", "number", __assertType__number.bind(void 0, duration));
675
675
  this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemShutoff);
676
- const cc = new IrrigationCCSystemShutoff(this.applHost, {
676
+ const cc = new IrrigationCCSystemShutoff({
677
677
  nodeId: this.endpoint.nodeId,
678
- endpoint: this.endpoint.index,
678
+ endpointIndex: this.endpoint.index,
679
679
  duration,
680
680
  });
681
- return this.applHost.sendCommand(cc, this.commandOptions);
681
+ return this.host.sendCommand(cc, this.commandOptions);
682
682
  }
683
683
  /** Shuts off the entire system permanently and prevents schedules from running */
684
684
  shutoffSystemPermanently() {
@@ -833,8 +833,8 @@ let IrrigationCC = IrrigationCC_1 = class IrrigationCC extends CommandClass_1.Co
833
833
  * Returns the maximum number of valve table entries reported by the node.
834
834
  * This only works AFTER the node has been interviewed.
835
835
  */
836
- static getMaxValveTableSizeCached(applHost, endpoint) {
837
- return applHost
836
+ static getMaxValveTableSizeCached(ctx, endpoint) {
837
+ return ctx
838
838
  .getValueDB(endpoint.nodeId)
839
839
  .getValue(exports.IrrigationCCValues.maxValveTableSize.endpoint(endpoint.index));
840
840
  }
@@ -842,8 +842,8 @@ let IrrigationCC = IrrigationCC_1 = class IrrigationCC extends CommandClass_1.Co
842
842
  * Returns the number of zone valves reported by the node.
843
843
  * This only works AFTER the node has been interviewed.
844
844
  */
845
- static getNumValvesCached(applHost, endpoint) {
846
- return applHost
845
+ static getNumValvesCached(ctx, endpoint) {
846
+ return ctx
847
847
  .getValueDB(endpoint.nodeId)
848
848
  .getValue(exports.IrrigationCCValues.numValves.endpoint(endpoint.index));
849
849
  }
@@ -851,30 +851,30 @@ let IrrigationCC = IrrigationCC_1 = class IrrigationCC extends CommandClass_1.Co
851
851
  * Returns whether the node supports a master valve
852
852
  * This only works AFTER the node has been interviewed.
853
853
  */
854
- static supportsMasterValveCached(applHost, endpoint) {
855
- return !!applHost
854
+ static supportsMasterValveCached(ctx, endpoint) {
855
+ return !!ctx
856
856
  .getValueDB(endpoint.nodeId)
857
857
  .getValue(exports.IrrigationCCValues.supportsMasterValve.endpoint(endpoint.index));
858
858
  }
859
- async interview(applHost) {
860
- const node = this.getNode(applHost);
861
- const endpoint = this.getEndpoint(applHost);
862
- const api = API_1.CCAPI.create(safe_1.CommandClasses.Irrigation, applHost, endpoint).withOptions({
859
+ async interview(ctx) {
860
+ const node = this.getNode(ctx);
861
+ const endpoint = this.getEndpoint(ctx);
862
+ const api = API_1.CCAPI.create(safe_1.CommandClasses.Irrigation, ctx, endpoint).withOptions({
863
863
  priority: safe_1.MessagePriority.NodeQuery,
864
864
  });
865
- applHost.controllerLog.logNode(node.id, {
865
+ ctx.logNode(node.id, {
866
866
  endpoint: this.endpointIndex,
867
867
  message: `Interviewing ${this.ccName}...`,
868
868
  direction: "none",
869
869
  });
870
- applHost.controllerLog.logNode(node.id, {
870
+ ctx.logNode(node.id, {
871
871
  endpoint: this.endpointIndex,
872
872
  message: "Querying irrigation system info...",
873
873
  direction: "outbound",
874
874
  });
875
875
  const systemInfo = await api.getSystemInfo();
876
876
  if (!systemInfo) {
877
- applHost.controllerLog.logNode(node.id, {
877
+ ctx.logNode(node.id, {
878
878
  endpoint: this.endpointIndex,
879
879
  message: "Time out while querying irrigation system info, skipping interview...",
880
880
  level: "warn",
@@ -886,31 +886,31 @@ supports master valve: ${systemInfo.supportsMasterValve}
886
886
  no. of valves: ${systemInfo.numValves}
887
887
  no. of valve tables: ${systemInfo.numValveTables}
888
888
  max. valve table size: ${systemInfo.maxValveTableSize}`;
889
- applHost.controllerLog.logNode(node.id, {
889
+ ctx.logNode(node.id, {
890
890
  endpoint: this.endpointIndex,
891
891
  message: logMessage,
892
892
  direction: "inbound",
893
893
  });
894
894
  // For each valve, create the values to start/stop a run
895
895
  for (let i = 1; i <= systemInfo.numValves; i++) {
896
- this.ensureMetadata(applHost, exports.IrrigationCCValues.valveRunDuration(i));
897
- this.ensureMetadata(applHost, exports.IrrigationCCValues.valveRunStartStop(i));
896
+ this.ensureMetadata(ctx, exports.IrrigationCCValues.valveRunDuration(i));
897
+ this.ensureMetadata(ctx, exports.IrrigationCCValues.valveRunStartStop(i));
898
898
  }
899
899
  // And create a shutoff value
900
- this.ensureMetadata(applHost, exports.IrrigationCCValues.shutoffSystem);
900
+ this.ensureMetadata(ctx, exports.IrrigationCCValues.shutoffSystem);
901
901
  // Query current values
902
- await this.refreshValues(applHost);
902
+ await this.refreshValues(ctx);
903
903
  // Remember that the interview is complete
904
- this.setInterviewComplete(applHost, true);
904
+ this.setInterviewComplete(ctx, true);
905
905
  }
906
- async refreshValues(applHost) {
907
- const node = this.getNode(applHost);
908
- const endpoint = this.getEndpoint(applHost);
909
- const api = API_1.CCAPI.create(safe_1.CommandClasses.Irrigation, applHost, endpoint).withOptions({
906
+ async refreshValues(ctx) {
907
+ const node = this.getNode(ctx);
908
+ const endpoint = this.getEndpoint(ctx);
909
+ const api = API_1.CCAPI.create(safe_1.CommandClasses.Irrigation, ctx, endpoint).withOptions({
910
910
  priority: safe_1.MessagePriority.NodeQuery,
911
911
  });
912
912
  // Query the current system config
913
- applHost.controllerLog.logNode(node.id, {
913
+ ctx.logNode(node.id, {
914
914
  endpoint: this.endpointIndex,
915
915
  message: "Querying irrigation system configuration...",
916
916
  direction: "outbound",
@@ -929,7 +929,7 @@ rain sensor polarity: ${(0, safe_2.getEnumMemberName)(_Types_1.IrrigationSen
929
929
  logMessage += `
930
930
  moisture sensor polarity: ${(0, safe_2.getEnumMemberName)(_Types_1.IrrigationSensorPolarity, systemConfig.moistureSensorPolarity)}`;
931
931
  }
932
- applHost.controllerLog.logNode(node.id, {
932
+ ctx.logNode(node.id, {
933
933
  endpoint: this.endpointIndex,
934
934
  message: logMessage,
935
935
  direction: "inbound",
@@ -937,35 +937,35 @@ moisture sensor polarity: ${(0, safe_2.getEnumMemberName)(_Types_1.IrrigationSen
937
937
  }
938
938
  // and status
939
939
  // Query the current system config
940
- applHost.controllerLog.logNode(node.id, {
940
+ ctx.logNode(node.id, {
941
941
  endpoint: this.endpointIndex,
942
942
  message: "Querying irrigation system status...",
943
943
  direction: "outbound",
944
944
  });
945
945
  await api.getSystemStatus();
946
946
  // for each valve, query the current status and configuration
947
- if (IrrigationCC_1.supportsMasterValveCached(applHost, endpoint)) {
948
- applHost.controllerLog.logNode(node.id, {
947
+ if (IrrigationCC_1.supportsMasterValveCached(ctx, endpoint)) {
948
+ ctx.logNode(node.id, {
949
949
  endpoint: this.endpointIndex,
950
950
  message: "Querying master valve configuration...",
951
951
  direction: "outbound",
952
952
  });
953
953
  await api.getValveConfig("master");
954
- applHost.controllerLog.logNode(node.id, {
954
+ ctx.logNode(node.id, {
955
955
  endpoint: this.endpointIndex,
956
956
  message: "Querying master valve status...",
957
957
  direction: "outbound",
958
958
  });
959
959
  await api.getValveInfo("master");
960
960
  }
961
- for (let i = 1; i <= (IrrigationCC_1.getNumValvesCached(applHost, endpoint) ?? 0); i++) {
962
- applHost.controllerLog.logNode(node.id, {
961
+ for (let i = 1; i <= (IrrigationCC_1.getNumValvesCached(ctx, endpoint) ?? 0); i++) {
962
+ ctx.logNode(node.id, {
963
963
  endpoint: this.endpointIndex,
964
964
  message: `Querying configuration for valve ${(0, strings_1.padStart)(i.toString(), 3, "0")}...`,
965
965
  direction: "outbound",
966
966
  });
967
967
  await api.getValveConfig(i);
968
- applHost.controllerLog.logNode(node.id, {
968
+ ctx.logNode(node.id, {
969
969
  endpoint: this.endpointIndex,
970
970
  message: `Querying status for valve ${(0, strings_1.padStart)(i.toString(), 3, "0")}...`,
971
971
  direction: "outbound",
@@ -973,14 +973,14 @@ moisture sensor polarity: ${(0, safe_2.getEnumMemberName)(_Types_1.IrrigationSen
973
973
  await api.getValveInfo(i);
974
974
  }
975
975
  }
976
- translateProperty(applHost, property, propertyKey) {
976
+ translateProperty(ctx, property, propertyKey) {
977
977
  if (property === "master") {
978
978
  return "Master valve";
979
979
  }
980
980
  else if (typeof property === "number") {
981
981
  return `Valve ${(0, strings_1.padStart)(property.toString(), 3, "0")}`;
982
982
  }
983
- return super.translateProperty(applHost, property, propertyKey);
983
+ return super.translateProperty(ctx, property, propertyKey);
984
984
  }
985
985
  };
986
986
  exports.IrrigationCC = IrrigationCC;
@@ -989,22 +989,36 @@ exports.IrrigationCC = IrrigationCC = IrrigationCC_1 = __decorate([
989
989
  (0, CommandClassDecorators_1.implementedVersion)(1),
990
990
  (0, CommandClassDecorators_1.ccValues)(exports.IrrigationCCValues)
991
991
  ], IrrigationCC);
992
- let IrrigationCCSystemInfoReport = class IrrigationCCSystemInfoReport extends IrrigationCC {
993
- constructor(host, options) {
994
- super(host, options);
995
- (0, safe_1.validatePayload)(this.payload.length >= 4);
996
- this.supportsMasterValve = !!(this.payload[0] & 0x01);
997
- this.numValves = this.payload[1];
998
- this.numValveTables = this.payload[2];
999
- this.maxValveTableSize = this.payload[3] & 0b1111;
992
+ let IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport_1 = class IrrigationCCSystemInfoReport extends IrrigationCC {
993
+ constructor(options) {
994
+ super(options);
995
+ // TODO: Check implementation:
996
+ this.supportsMasterValve = options.supportsMasterValve;
997
+ this.numValves = options.numValves;
998
+ this.numValveTables = options.numValveTables;
999
+ this.maxValveTableSize = options.maxValveTableSize;
1000
+ }
1001
+ static from(raw, ctx) {
1002
+ (0, safe_1.validatePayload)(raw.payload.length >= 4);
1003
+ const supportsMasterValve = !!(raw.payload[0] & 0x01);
1004
+ const numValves = raw.payload[1];
1005
+ const numValveTables = raw.payload[2];
1006
+ const maxValveTableSize = raw.payload[3] & 0b1111;
1007
+ return new IrrigationCCSystemInfoReport_1({
1008
+ nodeId: ctx.sourceNodeId,
1009
+ supportsMasterValve,
1010
+ numValves,
1011
+ numValveTables,
1012
+ maxValveTableSize,
1013
+ });
1000
1014
  }
1001
1015
  numValves;
1002
1016
  numValveTables;
1003
1017
  supportsMasterValve;
1004
1018
  maxValveTableSize;
1005
- toLogEntry(host) {
1019
+ toLogEntry(ctx) {
1006
1020
  return {
1007
- ...super.toLogEntry(host),
1021
+ ...super.toLogEntry(ctx),
1008
1022
  message: {
1009
1023
  "supports master valve": this.supportsMasterValve,
1010
1024
  "no. of valves": this.numValves,
@@ -1027,7 +1041,7 @@ __decorate([
1027
1041
  __decorate([
1028
1042
  (0, CommandClassDecorators_1.ccValue)(exports.IrrigationCCValues.maxValveTableSize)
1029
1043
  ], IrrigationCCSystemInfoReport.prototype, "maxValveTableSize", void 0);
1030
- exports.IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport = __decorate([
1044
+ exports.IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport_1 = __decorate([
1031
1045
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemInfoReport)
1032
1046
  ], IrrigationCCSystemInfoReport);
1033
1047
  let IrrigationCCSystemInfoGet = class IrrigationCCSystemInfoGet extends IrrigationCC {
@@ -1037,41 +1051,80 @@ exports.IrrigationCCSystemInfoGet = IrrigationCCSystemInfoGet = __decorate([
1037
1051
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemInfoGet),
1038
1052
  (0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCSystemInfoReport)
1039
1053
  ], IrrigationCCSystemInfoGet);
1040
- let IrrigationCCSystemStatusReport = class IrrigationCCSystemStatusReport extends IrrigationCC {
1041
- constructor(host, options) {
1042
- super(host, options);
1043
- (0, safe_1.validatePayload)(this.payload.length >= 2);
1044
- this.systemVoltage = this.payload[0];
1045
- this.flowSensorActive = !!(this.payload[1] & 0x01);
1046
- this.pressureSensorActive = !!(this.payload[1] & 0x02);
1047
- this.rainSensorActive = !!(this.payload[1] & 0x04);
1048
- this.moistureSensorActive = !!(this.payload[1] & 0x08);
1054
+ let IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport_1 = class IrrigationCCSystemStatusReport extends IrrigationCC {
1055
+ constructor(options) {
1056
+ super(options);
1057
+ // TODO: Check implementation:
1058
+ this.systemVoltage = options.systemVoltage;
1059
+ this.flowSensorActive = options.flowSensorActive;
1060
+ this.pressureSensorActive = options.pressureSensorActive;
1061
+ this.rainSensorActive = options.rainSensorActive;
1062
+ this.moistureSensorActive = options.moistureSensorActive;
1063
+ this.flow = options.flow;
1064
+ this.pressure = options.pressure;
1065
+ this.shutoffDuration = options.shutoffDuration;
1066
+ this.errorNotProgrammed = options.errorNotProgrammed;
1067
+ this.errorEmergencyShutdown = options.errorEmergencyShutdown;
1068
+ this.errorHighPressure = options.errorHighPressure;
1069
+ this.errorLowPressure = options.errorLowPressure;
1070
+ this.errorValve = options.errorValve;
1071
+ this.masterValveOpen = options.masterValveOpen;
1072
+ this.firstOpenZoneId = options.firstOpenZoneId;
1073
+ }
1074
+ static from(raw, ctx) {
1075
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
1076
+ const systemVoltage = raw.payload[0];
1077
+ const flowSensorActive = !!(raw.payload[1] & 0x01);
1078
+ const pressureSensorActive = !!(raw.payload[1] & 0x02);
1079
+ const rainSensorActive = !!(raw.payload[1] & 0x04);
1080
+ const moistureSensorActive = !!(raw.payload[1] & 0x08);
1049
1081
  let offset = 2;
1082
+ let flow;
1050
1083
  {
1051
- const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(offset));
1084
+ const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
1052
1085
  (0, safe_1.validatePayload)(scale === 0);
1053
- if (this.flowSensorActive)
1054
- this.flow = value;
1086
+ if (flowSensorActive)
1087
+ flow = value;
1055
1088
  offset += bytesRead;
1056
1089
  }
1090
+ let pressure;
1057
1091
  {
1058
- const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(offset));
1092
+ const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
1059
1093
  (0, safe_1.validatePayload)(scale === 0);
1060
- if (this.pressureSensorActive)
1061
- this.pressure = value;
1094
+ if (pressureSensorActive)
1095
+ pressure = value;
1062
1096
  offset += bytesRead;
1063
1097
  }
1064
- (0, safe_1.validatePayload)(this.payload.length >= offset + 4);
1065
- this.shutoffDuration = this.payload[offset];
1066
- this.errorNotProgrammed = !!(this.payload[offset + 1] & 0x01);
1067
- this.errorEmergencyShutdown = !!(this.payload[offset + 1] & 0x02);
1068
- this.errorHighPressure = !!(this.payload[offset + 1] & 0x04);
1069
- this.errorLowPressure = !!(this.payload[offset + 1] & 0x08);
1070
- this.errorValve = !!(this.payload[offset + 1] & 0x10);
1071
- this.masterValveOpen = !!(this.payload[offset + 2] & 0x01);
1072
- if (this.payload[offset + 3]) {
1073
- this.firstOpenZoneId = this.payload[offset + 3];
1074
- }
1098
+ (0, safe_1.validatePayload)(raw.payload.length >= offset + 4);
1099
+ const shutoffDuration = raw.payload[offset];
1100
+ const errorNotProgrammed = !!(raw.payload[offset + 1] & 0x01);
1101
+ const errorEmergencyShutdown = !!(raw.payload[offset + 1] & 0x02);
1102
+ const errorHighPressure = !!(raw.payload[offset + 1] & 0x04);
1103
+ const errorLowPressure = !!(raw.payload[offset + 1] & 0x08);
1104
+ const errorValve = !!(raw.payload[offset + 1] & 0x10);
1105
+ const masterValveOpen = !!(raw.payload[offset + 2] & 0x01);
1106
+ let firstOpenZoneId;
1107
+ if (raw.payload[offset + 3]) {
1108
+ firstOpenZoneId = raw.payload[offset + 3];
1109
+ }
1110
+ return new IrrigationCCSystemStatusReport_1({
1111
+ nodeId: ctx.sourceNodeId,
1112
+ systemVoltage,
1113
+ flowSensorActive,
1114
+ pressureSensorActive,
1115
+ rainSensorActive,
1116
+ moistureSensorActive,
1117
+ flow,
1118
+ pressure,
1119
+ shutoffDuration,
1120
+ errorNotProgrammed,
1121
+ errorEmergencyShutdown,
1122
+ errorHighPressure,
1123
+ errorLowPressure,
1124
+ errorValve,
1125
+ masterValveOpen,
1126
+ firstOpenZoneId,
1127
+ });
1075
1128
  }
1076
1129
  systemVoltage;
1077
1130
  flowSensorActive;
@@ -1088,7 +1141,7 @@ let IrrigationCCSystemStatusReport = class IrrigationCCSystemStatusReport extend
1088
1141
  errorValve;
1089
1142
  masterValveOpen;
1090
1143
  firstOpenZoneId;
1091
- toLogEntry(host) {
1144
+ toLogEntry(ctx) {
1092
1145
  const message = {
1093
1146
  "system voltage": `${this.systemVoltage} V`,
1094
1147
  "active sensors": [
@@ -1128,7 +1181,7 @@ let IrrigationCCSystemStatusReport = class IrrigationCCSystemStatusReport extend
1128
1181
  message.errors = errors.map((e) => `\n· ${e}`).join("");
1129
1182
  }
1130
1183
  return {
1131
- ...super.toLogEntry(host),
1184
+ ...super.toLogEntry(ctx),
1132
1185
  message,
1133
1186
  };
1134
1187
  }
@@ -1179,7 +1232,7 @@ __decorate([
1179
1232
  __decorate([
1180
1233
  (0, CommandClassDecorators_1.ccValue)(exports.IrrigationCCValues.firstOpenZoneId)
1181
1234
  ], IrrigationCCSystemStatusReport.prototype, "firstOpenZoneId", void 0);
1182
- exports.IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport = __decorate([
1235
+ exports.IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport_1 = __decorate([
1183
1236
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemStatusReport)
1184
1237
  ], IrrigationCCSystemStatusReport);
1185
1238
  let IrrigationCCSystemStatusGet = class IrrigationCCSystemStatusGet extends IrrigationCC {
@@ -1190,26 +1243,27 @@ exports.IrrigationCCSystemStatusGet = IrrigationCCSystemStatusGet = __decorate([
1190
1243
  (0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCSystemStatusReport)
1191
1244
  ], IrrigationCCSystemStatusGet);
1192
1245
  let IrrigationCCSystemConfigSet = class IrrigationCCSystemConfigSet extends IrrigationCC {
1193
- constructor(host, options) {
1194
- super(host, options);
1195
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1196
- // TODO: Deserialize payload
1197
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1198
- }
1199
- else {
1200
- this.masterValveDelay = options.masterValveDelay;
1201
- this.highPressureThreshold = options.highPressureThreshold;
1202
- this.lowPressureThreshold = options.lowPressureThreshold;
1203
- this.rainSensorPolarity = options.rainSensorPolarity;
1204
- this.moistureSensorPolarity = options.moistureSensorPolarity;
1205
- }
1246
+ constructor(options) {
1247
+ super(options);
1248
+ this.masterValveDelay = options.masterValveDelay;
1249
+ this.highPressureThreshold = options.highPressureThreshold;
1250
+ this.lowPressureThreshold = options.lowPressureThreshold;
1251
+ this.rainSensorPolarity = options.rainSensorPolarity;
1252
+ this.moistureSensorPolarity = options.moistureSensorPolarity;
1253
+ }
1254
+ static from(_raw, _ctx) {
1255
+ // TODO: Deserialize payload
1256
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1257
+ // return new IrrigationCCSystemConfigSet({
1258
+ // nodeId: ctx.sourceNodeId,
1259
+ // });
1206
1260
  }
1207
1261
  masterValveDelay;
1208
1262
  highPressureThreshold;
1209
1263
  lowPressureThreshold;
1210
1264
  rainSensorPolarity;
1211
1265
  moistureSensorPolarity;
1212
- serialize() {
1266
+ serialize(ctx) {
1213
1267
  let polarity = 0;
1214
1268
  if (this.rainSensorPolarity != undefined)
1215
1269
  polarity |= 0b1;
@@ -1226,9 +1280,9 @@ let IrrigationCCSystemConfigSet = class IrrigationCCSystemConfigSet extends Irri
1226
1280
  (0, safe_1.encodeFloatWithScale)(this.lowPressureThreshold, 0 /* kPa */),
1227
1281
  Buffer.from([polarity]),
1228
1282
  ]);
1229
- return super.serialize();
1283
+ return super.serialize(ctx);
1230
1284
  }
1231
- toLogEntry(host) {
1285
+ toLogEntry(ctx) {
1232
1286
  const message = {
1233
1287
  "master valve delay": `${this.masterValveDelay} s`,
1234
1288
  "high pressure threshold": `${this.highPressureThreshold} kPa`,
@@ -1241,7 +1295,7 @@ let IrrigationCCSystemConfigSet = class IrrigationCCSystemConfigSet extends Irri
1241
1295
  message["moisture sensor polarity"] = (0, safe_2.getEnumMemberName)(_Types_1.IrrigationSensorPolarity, this.moistureSensorPolarity);
1242
1296
  }
1243
1297
  return {
1244
- ...super.toLogEntry(host),
1298
+ ...super.toLogEntry(ctx),
1245
1299
  message,
1246
1300
  };
1247
1301
  }
@@ -1251,38 +1305,58 @@ exports.IrrigationCCSystemConfigSet = IrrigationCCSystemConfigSet = __decorate([
1251
1305
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemConfigSet),
1252
1306
  (0, CommandClassDecorators_1.useSupervision)()
1253
1307
  ], IrrigationCCSystemConfigSet);
1254
- let IrrigationCCSystemConfigReport = class IrrigationCCSystemConfigReport extends IrrigationCC {
1255
- constructor(host, options) {
1256
- super(host, options);
1257
- (0, safe_1.validatePayload)(this.payload.length >= 2);
1258
- this.masterValveDelay = this.payload[0];
1308
+ let IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport_1 = class IrrigationCCSystemConfigReport extends IrrigationCC {
1309
+ constructor(options) {
1310
+ super(options);
1311
+ // TODO: Check implementation:
1312
+ this.masterValveDelay = options.masterValveDelay;
1313
+ this.highPressureThreshold = options.highPressureThreshold;
1314
+ this.lowPressureThreshold = options.lowPressureThreshold;
1315
+ this.rainSensorPolarity = options.rainSensorPolarity;
1316
+ this.moistureSensorPolarity = options.moistureSensorPolarity;
1317
+ }
1318
+ static from(raw, ctx) {
1319
+ (0, safe_1.validatePayload)(raw.payload.length >= 2);
1320
+ const masterValveDelay = raw.payload[0];
1259
1321
  let offset = 1;
1322
+ let highPressureThreshold;
1260
1323
  {
1261
- const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(offset));
1324
+ const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
1262
1325
  (0, safe_1.validatePayload)(scale === 0 /* kPa */);
1263
- this.highPressureThreshold = value;
1326
+ highPressureThreshold = value;
1264
1327
  offset += bytesRead;
1265
1328
  }
1329
+ let lowPressureThreshold;
1266
1330
  {
1267
- const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(offset));
1331
+ const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
1268
1332
  (0, safe_1.validatePayload)(scale === 0 /* kPa */);
1269
- this.lowPressureThreshold = value;
1333
+ lowPressureThreshold = value;
1270
1334
  offset += bytesRead;
1271
1335
  }
1272
- (0, safe_1.validatePayload)(this.payload.length >= offset + 1);
1273
- const polarity = this.payload[offset];
1336
+ (0, safe_1.validatePayload)(raw.payload.length >= offset + 1);
1337
+ const polarity = raw.payload[offset];
1338
+ let rainSensorPolarity;
1339
+ let moistureSensorPolarity;
1274
1340
  if (!!(polarity & 0b1000_0000)) {
1275
1341
  // The valid bit is set
1276
- this.rainSensorPolarity = polarity & 0b1;
1277
- this.moistureSensorPolarity = (polarity & 0b10) >>> 1;
1278
- }
1342
+ rainSensorPolarity = polarity & 0b1;
1343
+ moistureSensorPolarity = (polarity & 0b10) >>> 1;
1344
+ }
1345
+ return new IrrigationCCSystemConfigReport_1({
1346
+ nodeId: ctx.sourceNodeId,
1347
+ masterValveDelay,
1348
+ highPressureThreshold,
1349
+ lowPressureThreshold,
1350
+ rainSensorPolarity,
1351
+ moistureSensorPolarity,
1352
+ });
1279
1353
  }
1280
1354
  masterValveDelay;
1281
1355
  highPressureThreshold;
1282
1356
  lowPressureThreshold;
1283
1357
  rainSensorPolarity;
1284
1358
  moistureSensorPolarity;
1285
- toLogEntry(host) {
1359
+ toLogEntry(ctx) {
1286
1360
  const message = {
1287
1361
  "master valve delay": `${this.masterValveDelay} s`,
1288
1362
  "high pressure threshold": `${this.highPressureThreshold} kPa`,
@@ -1295,7 +1369,7 @@ let IrrigationCCSystemConfigReport = class IrrigationCCSystemConfigReport extend
1295
1369
  message["moisture sensor polarity"] = (0, safe_2.getEnumMemberName)(_Types_1.IrrigationSensorPolarity, this.moistureSensorPolarity);
1296
1370
  }
1297
1371
  return {
1298
- ...super.toLogEntry(host),
1372
+ ...super.toLogEntry(ctx),
1299
1373
  message,
1300
1374
  };
1301
1375
  }
@@ -1316,7 +1390,7 @@ __decorate([
1316
1390
  __decorate([
1317
1391
  (0, CommandClassDecorators_1.ccValue)(exports.IrrigationCCValues.moistureSensorPolarity)
1318
1392
  ], IrrigationCCSystemConfigReport.prototype, "moistureSensorPolarity", void 0);
1319
- exports.IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport = __decorate([
1393
+ exports.IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport_1 = __decorate([
1320
1394
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemConfigReport)
1321
1395
  ], IrrigationCCSystemConfigReport);
1322
1396
  let IrrigationCCSystemConfigGet = class IrrigationCCSystemConfigGet extends IrrigationCC {
@@ -1326,26 +1400,54 @@ exports.IrrigationCCSystemConfigGet = IrrigationCCSystemConfigGet = __decorate([
1326
1400
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemConfigGet),
1327
1401
  (0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCSystemConfigReport)
1328
1402
  ], IrrigationCCSystemConfigGet);
1329
- let IrrigationCCValveInfoReport = class IrrigationCCValveInfoReport extends IrrigationCC {
1330
- constructor(host, options) {
1331
- super(host, options);
1332
- (0, safe_1.validatePayload)(this.payload.length >= 4);
1333
- if ((this.payload[0] & 0b1) === _Types_1.ValveType.MasterValve) {
1334
- this.valveId = "master";
1403
+ let IrrigationCCValveInfoReport = IrrigationCCValveInfoReport_1 = class IrrigationCCValveInfoReport extends IrrigationCC {
1404
+ constructor(options) {
1405
+ super(options);
1406
+ // TODO: Check implementation:
1407
+ this.valveId = options.valveId;
1408
+ this.connected = options.connected;
1409
+ this.nominalCurrent = options.nominalCurrent;
1410
+ this.errorShortCircuit = options.errorShortCircuit;
1411
+ this.errorHighCurrent = options.errorHighCurrent;
1412
+ this.errorLowCurrent = options.errorLowCurrent;
1413
+ this.errorMaximumFlow = options.errorMaximumFlow;
1414
+ this.errorHighFlow = options.errorHighFlow;
1415
+ this.errorLowFlow = options.errorLowFlow;
1416
+ }
1417
+ static from(raw, ctx) {
1418
+ (0, safe_1.validatePayload)(raw.payload.length >= 4);
1419
+ let valveId;
1420
+ if ((raw.payload[0] & 0b1) === _Types_1.ValveType.MasterValve) {
1421
+ valveId = "master";
1335
1422
  }
1336
1423
  else {
1337
- this.valveId = this.payload[1];
1338
- }
1339
- this.connected = !!(this.payload[0] & 0b10);
1340
- this.nominalCurrent = 10 * this.payload[2];
1341
- this.errorShortCircuit = !!(this.payload[3] & 0b1);
1342
- this.errorHighCurrent = !!(this.payload[3] & 0b10);
1343
- this.errorLowCurrent = !!(this.payload[3] & 0b100);
1344
- if (this.valveId === "master") {
1345
- this.errorMaximumFlow = !!(this.payload[3] & 0b1000);
1346
- this.errorHighFlow = !!(this.payload[3] & 0b1_0000);
1347
- this.errorLowFlow = !!(this.payload[3] & 0b10_0000);
1348
- }
1424
+ valveId = raw.payload[1];
1425
+ }
1426
+ const connected = !!(raw.payload[0] & 0b10);
1427
+ const nominalCurrent = 10 * raw.payload[2];
1428
+ const errorShortCircuit = !!(raw.payload[3] & 0b1);
1429
+ const errorHighCurrent = !!(raw.payload[3] & 0b10);
1430
+ const errorLowCurrent = !!(raw.payload[3] & 0b100);
1431
+ let errorMaximumFlow;
1432
+ let errorHighFlow;
1433
+ let errorLowFlow;
1434
+ if (valveId === "master") {
1435
+ errorMaximumFlow = !!(raw.payload[3] & 0b1000);
1436
+ errorHighFlow = !!(raw.payload[3] & 0b1_0000);
1437
+ errorLowFlow = !!(raw.payload[3] & 0b10_0000);
1438
+ }
1439
+ return new IrrigationCCValveInfoReport_1({
1440
+ nodeId: ctx.sourceNodeId,
1441
+ valveId,
1442
+ connected,
1443
+ nominalCurrent,
1444
+ errorShortCircuit,
1445
+ errorHighCurrent,
1446
+ errorLowCurrent,
1447
+ errorMaximumFlow,
1448
+ errorHighFlow,
1449
+ errorLowFlow,
1450
+ });
1349
1451
  }
1350
1452
  valveId;
1351
1453
  connected;
@@ -1356,47 +1458,47 @@ let IrrigationCCValveInfoReport = class IrrigationCCValveInfoReport extends Irri
1356
1458
  errorMaximumFlow;
1357
1459
  errorHighFlow;
1358
1460
  errorLowFlow;
1359
- persistValues(applHost) {
1360
- if (!super.persistValues(applHost))
1461
+ persistValues(ctx) {
1462
+ if (!super.persistValues(ctx))
1361
1463
  return false;
1362
1464
  // connected
1363
1465
  const valveConnectedValue = exports.IrrigationCCValues.valveConnected(this.valveId);
1364
- this.ensureMetadata(applHost, valveConnectedValue);
1365
- this.setValue(applHost, valveConnectedValue, this.connected);
1466
+ this.ensureMetadata(ctx, valveConnectedValue);
1467
+ this.setValue(ctx, valveConnectedValue, this.connected);
1366
1468
  // nominalCurrent
1367
1469
  const nominalCurrentValue = exports.IrrigationCCValues.nominalCurrent(this.valveId);
1368
- this.ensureMetadata(applHost, nominalCurrentValue);
1369
- this.setValue(applHost, nominalCurrentValue, this.nominalCurrent);
1470
+ this.ensureMetadata(ctx, nominalCurrentValue);
1471
+ this.setValue(ctx, nominalCurrentValue, this.nominalCurrent);
1370
1472
  // errorShortCircuit
1371
1473
  const errorShortCircuitValue = exports.IrrigationCCValues.errorShortCircuit(this.valveId);
1372
- this.ensureMetadata(applHost, errorShortCircuitValue);
1373
- this.setValue(applHost, errorShortCircuitValue, this.errorShortCircuit);
1474
+ this.ensureMetadata(ctx, errorShortCircuitValue);
1475
+ this.setValue(ctx, errorShortCircuitValue, this.errorShortCircuit);
1374
1476
  // errorHighCurrent
1375
1477
  const errorHighCurrentValue = exports.IrrigationCCValues.errorHighCurrent(this.valveId);
1376
- this.ensureMetadata(applHost, errorHighCurrentValue);
1377
- this.setValue(applHost, errorHighCurrentValue, this.errorHighCurrent);
1478
+ this.ensureMetadata(ctx, errorHighCurrentValue);
1479
+ this.setValue(ctx, errorHighCurrentValue, this.errorHighCurrent);
1378
1480
  // errorLowCurrent
1379
1481
  const errorLowCurrentValue = exports.IrrigationCCValues.errorLowCurrent(this.valveId);
1380
- this.ensureMetadata(applHost, errorLowCurrentValue);
1381
- this.setValue(applHost, errorLowCurrentValue, this.errorLowCurrent);
1482
+ this.ensureMetadata(ctx, errorLowCurrentValue);
1483
+ this.setValue(ctx, errorLowCurrentValue, this.errorLowCurrent);
1382
1484
  if (this.errorMaximumFlow != undefined) {
1383
1485
  const errorMaximumFlowValue = exports.IrrigationCCValues.errorMaximumFlow(this.valveId);
1384
- this.ensureMetadata(applHost, errorMaximumFlowValue);
1385
- this.setValue(applHost, errorMaximumFlowValue, this.errorMaximumFlow);
1486
+ this.ensureMetadata(ctx, errorMaximumFlowValue);
1487
+ this.setValue(ctx, errorMaximumFlowValue, this.errorMaximumFlow);
1386
1488
  }
1387
1489
  if (this.errorHighFlow != undefined) {
1388
1490
  const errorHighFlowValue = exports.IrrigationCCValues.errorHighFlow(this.valveId);
1389
- this.ensureMetadata(applHost, errorHighFlowValue);
1390
- this.setValue(applHost, errorHighFlowValue, this.errorHighFlow);
1491
+ this.ensureMetadata(ctx, errorHighFlowValue);
1492
+ this.setValue(ctx, errorHighFlowValue, this.errorHighFlow);
1391
1493
  }
1392
1494
  if (this.errorLowFlow != undefined) {
1393
1495
  const errorLowFlowValue = exports.IrrigationCCValues.errorLowFlow(this.valveId);
1394
- this.ensureMetadata(applHost, errorLowFlowValue);
1395
- this.setValue(applHost, errorLowFlowValue, this.errorLowFlow);
1496
+ this.ensureMetadata(ctx, errorLowFlowValue);
1497
+ this.setValue(ctx, errorLowFlowValue, this.errorLowFlow);
1396
1498
  }
1397
1499
  return true;
1398
1500
  }
1399
- toLogEntry(host) {
1501
+ toLogEntry(ctx) {
1400
1502
  const message = {
1401
1503
  "valve ID": this.valveId,
1402
1504
  connected: this.connected,
@@ -1414,40 +1516,41 @@ let IrrigationCCValveInfoReport = class IrrigationCCValveInfoReport extends Irri
1414
1516
  message.errors = errors.map((e) => `\n· ${e}`).join("");
1415
1517
  }
1416
1518
  return {
1417
- ...super.toLogEntry(host),
1519
+ ...super.toLogEntry(ctx),
1418
1520
  message,
1419
1521
  };
1420
1522
  }
1421
1523
  };
1422
1524
  exports.IrrigationCCValveInfoReport = IrrigationCCValveInfoReport;
1423
- exports.IrrigationCCValveInfoReport = IrrigationCCValveInfoReport = __decorate([
1525
+ exports.IrrigationCCValveInfoReport = IrrigationCCValveInfoReport = IrrigationCCValveInfoReport_1 = __decorate([
1424
1526
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveInfoReport)
1425
1527
  ], IrrigationCCValveInfoReport);
1426
1528
  function testResponseForIrrigationCommandWithValveId(sent, received) {
1427
1529
  return received.valveId === sent.valveId;
1428
1530
  }
1429
1531
  let IrrigationCCValveInfoGet = class IrrigationCCValveInfoGet extends IrrigationCC {
1430
- constructor(host, options) {
1431
- super(host, options);
1432
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1433
- // TODO: Deserialize payload
1434
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1435
- }
1436
- else {
1437
- this.valveId = options.valveId;
1438
- }
1532
+ constructor(options) {
1533
+ super(options);
1534
+ this.valveId = options.valveId;
1535
+ }
1536
+ static from(_raw, _ctx) {
1537
+ // TODO: Deserialize payload
1538
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1539
+ // return new IrrigationCCValveInfoGet({
1540
+ // nodeId: ctx.sourceNodeId,
1541
+ // });
1439
1542
  }
1440
1543
  valveId;
1441
- serialize() {
1544
+ serialize(ctx) {
1442
1545
  this.payload = Buffer.from([
1443
1546
  this.valveId === "master" ? 1 : 0,
1444
1547
  this.valveId === "master" ? 1 : this.valveId || 1,
1445
1548
  ]);
1446
- return super.serialize();
1549
+ return super.serialize(ctx);
1447
1550
  }
1448
- toLogEntry(host) {
1551
+ toLogEntry(ctx) {
1449
1552
  return {
1450
- ...super.toLogEntry(host),
1553
+ ...super.toLogEntry(ctx),
1451
1554
  message: {
1452
1555
  "valve ID": this.valveId,
1453
1556
  },
@@ -1460,24 +1563,23 @@ exports.IrrigationCCValveInfoGet = IrrigationCCValveInfoGet = __decorate([
1460
1563
  (0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCValveInfoReport, testResponseForIrrigationCommandWithValveId)
1461
1564
  ], IrrigationCCValveInfoGet);
1462
1565
  let IrrigationCCValveConfigSet = class IrrigationCCValveConfigSet extends IrrigationCC {
1463
- constructor(host, options) {
1464
- super(host, options);
1465
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1466
- // TODO: Deserialize payload
1467
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1468
- }
1469
- else {
1470
- this.valveId = options.valveId;
1471
- this.nominalCurrentHighThreshold =
1472
- options.nominalCurrentHighThreshold;
1473
- this.nominalCurrentLowThreshold =
1474
- options.nominalCurrentLowThreshold;
1475
- this.maximumFlow = options.maximumFlow;
1476
- this.highFlowThreshold = options.highFlowThreshold;
1477
- this.lowFlowThreshold = options.lowFlowThreshold;
1478
- this.useRainSensor = options.useRainSensor;
1479
- this.useMoistureSensor = options.useMoistureSensor;
1480
- }
1566
+ constructor(options) {
1567
+ super(options);
1568
+ this.valveId = options.valveId;
1569
+ this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
1570
+ this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
1571
+ this.maximumFlow = options.maximumFlow;
1572
+ this.highFlowThreshold = options.highFlowThreshold;
1573
+ this.lowFlowThreshold = options.lowFlowThreshold;
1574
+ this.useRainSensor = options.useRainSensor;
1575
+ this.useMoistureSensor = options.useMoistureSensor;
1576
+ }
1577
+ static from(_raw, _ctx) {
1578
+ // TODO: Deserialize payload
1579
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1580
+ // return new IrrigationCCValveConfigSet({
1581
+ // nodeId: ctx.sourceNodeId,
1582
+ // });
1481
1583
  }
1482
1584
  valveId;
1483
1585
  nominalCurrentHighThreshold;
@@ -1487,7 +1589,7 @@ let IrrigationCCValveConfigSet = class IrrigationCCValveConfigSet extends Irriga
1487
1589
  lowFlowThreshold;
1488
1590
  useRainSensor;
1489
1591
  useMoistureSensor;
1490
- serialize() {
1592
+ serialize(ctx) {
1491
1593
  this.payload = Buffer.concat([
1492
1594
  Buffer.from([
1493
1595
  this.valveId === "master" ? 1 : 0,
@@ -1503,11 +1605,11 @@ let IrrigationCCValveConfigSet = class IrrigationCCValveConfigSet extends Irriga
1503
1605
  | (this.useMoistureSensor ? 0b10 : 0),
1504
1606
  ]),
1505
1607
  ]);
1506
- return super.serialize();
1608
+ return super.serialize(ctx);
1507
1609
  }
1508
- toLogEntry(host) {
1610
+ toLogEntry(ctx) {
1509
1611
  return {
1510
- ...super.toLogEntry(host),
1612
+ ...super.toLogEntry(ctx),
1511
1613
  message: {
1512
1614
  "valve ID": this.valveId,
1513
1615
  "nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
@@ -1526,74 +1628,100 @@ exports.IrrigationCCValveConfigSet = IrrigationCCValveConfigSet = __decorate([
1526
1628
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveConfigSet),
1527
1629
  (0, CommandClassDecorators_1.useSupervision)()
1528
1630
  ], IrrigationCCValveConfigSet);
1529
- let IrrigationCCValveConfigReport = class IrrigationCCValveConfigReport extends IrrigationCC {
1530
- constructor(host, options) {
1531
- super(host, options);
1532
- (0, safe_1.validatePayload)(this.payload.length >= 4);
1533
- if ((this.payload[0] & 0b1) === _Types_1.ValveType.MasterValve) {
1534
- this.valveId = "master";
1631
+ let IrrigationCCValveConfigReport = IrrigationCCValveConfigReport_1 = class IrrigationCCValveConfigReport extends IrrigationCC {
1632
+ constructor(options) {
1633
+ super(options);
1634
+ // TODO: Check implementation:
1635
+ this.valveId = options.valveId;
1636
+ this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
1637
+ this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
1638
+ this.maximumFlow = options.maximumFlow;
1639
+ this.highFlowThreshold = options.highFlowThreshold;
1640
+ this.lowFlowThreshold = options.lowFlowThreshold;
1641
+ this.useRainSensor = options.useRainSensor;
1642
+ this.useMoistureSensor = options.useMoistureSensor;
1643
+ }
1644
+ static from(raw, ctx) {
1645
+ (0, safe_1.validatePayload)(raw.payload.length >= 4);
1646
+ let valveId;
1647
+ if ((raw.payload[0] & 0b1) === _Types_1.ValveType.MasterValve) {
1648
+ valveId = "master";
1535
1649
  }
1536
1650
  else {
1537
- this.valveId = this.payload[1];
1651
+ valveId = raw.payload[1];
1538
1652
  }
1539
- this.nominalCurrentHighThreshold = 10 * this.payload[2];
1540
- this.nominalCurrentLowThreshold = 10 * this.payload[3];
1653
+ const nominalCurrentHighThreshold = 10 * raw.payload[2];
1654
+ const nominalCurrentLowThreshold = 10 * raw.payload[3];
1541
1655
  let offset = 4;
1656
+ let maximumFlow;
1542
1657
  {
1543
- const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(offset));
1658
+ const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
1544
1659
  (0, safe_1.validatePayload)(scale === 0 /* l/h */);
1545
- this.maximumFlow = value;
1660
+ maximumFlow = value;
1546
1661
  offset += bytesRead;
1547
1662
  }
1663
+ let highFlowThreshold;
1548
1664
  {
1549
- const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(offset));
1665
+ const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
1550
1666
  (0, safe_1.validatePayload)(scale === 0 /* l/h */);
1551
- this.highFlowThreshold = value;
1667
+ highFlowThreshold = value;
1552
1668
  offset += bytesRead;
1553
1669
  }
1670
+ let lowFlowThreshold;
1554
1671
  {
1555
- const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(offset));
1672
+ const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
1556
1673
  (0, safe_1.validatePayload)(scale === 0 /* l/h */);
1557
- this.lowFlowThreshold = value;
1674
+ lowFlowThreshold = value;
1558
1675
  offset += bytesRead;
1559
1676
  }
1560
- (0, safe_1.validatePayload)(this.payload.length >= offset + 1);
1561
- this.useRainSensor = !!(this.payload[offset] & 0b1);
1562
- this.useMoistureSensor = !!(this.payload[offset] & 0b10);
1677
+ (0, safe_1.validatePayload)(raw.payload.length >= offset + 1);
1678
+ const useRainSensor = !!(raw.payload[offset] & 0b1);
1679
+ const useMoistureSensor = !!(raw.payload[offset] & 0b10);
1680
+ return new IrrigationCCValveConfigReport_1({
1681
+ nodeId: ctx.sourceNodeId,
1682
+ valveId,
1683
+ nominalCurrentHighThreshold,
1684
+ nominalCurrentLowThreshold,
1685
+ maximumFlow,
1686
+ highFlowThreshold,
1687
+ lowFlowThreshold,
1688
+ useRainSensor,
1689
+ useMoistureSensor,
1690
+ });
1563
1691
  }
1564
- persistValues(applHost) {
1565
- if (!super.persistValues(applHost))
1692
+ persistValues(ctx) {
1693
+ if (!super.persistValues(ctx))
1566
1694
  return false;
1567
1695
  // nominalCurrentHighThreshold
1568
1696
  const nominalCurrentHighThresholdValue = exports.IrrigationCCValues
1569
1697
  .nominalCurrentHighThreshold(this.valveId);
1570
- this.ensureMetadata(applHost, nominalCurrentHighThresholdValue);
1571
- this.setValue(applHost, nominalCurrentHighThresholdValue, this.nominalCurrentHighThreshold);
1698
+ this.ensureMetadata(ctx, nominalCurrentHighThresholdValue);
1699
+ this.setValue(ctx, nominalCurrentHighThresholdValue, this.nominalCurrentHighThreshold);
1572
1700
  // nominalCurrentLowThreshold
1573
1701
  const nominalCurrentLowThresholdValue = exports.IrrigationCCValues
1574
1702
  .nominalCurrentLowThreshold(this.valveId);
1575
- this.ensureMetadata(applHost, nominalCurrentLowThresholdValue);
1576
- this.setValue(applHost, nominalCurrentLowThresholdValue, this.nominalCurrentLowThreshold);
1703
+ this.ensureMetadata(ctx, nominalCurrentLowThresholdValue);
1704
+ this.setValue(ctx, nominalCurrentLowThresholdValue, this.nominalCurrentLowThreshold);
1577
1705
  // maximumFlow
1578
1706
  const maximumFlowValue = exports.IrrigationCCValues.maximumFlow(this.valveId);
1579
- this.ensureMetadata(applHost, maximumFlowValue);
1580
- this.setValue(applHost, maximumFlowValue, this.maximumFlow);
1707
+ this.ensureMetadata(ctx, maximumFlowValue);
1708
+ this.setValue(ctx, maximumFlowValue, this.maximumFlow);
1581
1709
  // highFlowThreshold
1582
1710
  const highFlowThresholdValue = exports.IrrigationCCValues.highFlowThreshold(this.valveId);
1583
- this.ensureMetadata(applHost, highFlowThresholdValue);
1584
- this.setValue(applHost, highFlowThresholdValue, this.highFlowThreshold);
1711
+ this.ensureMetadata(ctx, highFlowThresholdValue);
1712
+ this.setValue(ctx, highFlowThresholdValue, this.highFlowThreshold);
1585
1713
  // lowFlowThreshold
1586
1714
  const lowFlowThresholdValue = exports.IrrigationCCValues.lowFlowThreshold(this.valveId);
1587
- this.ensureMetadata(applHost, lowFlowThresholdValue);
1588
- this.setValue(applHost, lowFlowThresholdValue, this.lowFlowThreshold);
1715
+ this.ensureMetadata(ctx, lowFlowThresholdValue);
1716
+ this.setValue(ctx, lowFlowThresholdValue, this.lowFlowThreshold);
1589
1717
  // useRainSensor
1590
1718
  const useRainSensorValue = exports.IrrigationCCValues.useRainSensor(this.valveId);
1591
- this.ensureMetadata(applHost, useRainSensorValue);
1592
- this.setValue(applHost, useRainSensorValue, this.useRainSensor);
1719
+ this.ensureMetadata(ctx, useRainSensorValue);
1720
+ this.setValue(ctx, useRainSensorValue, this.useRainSensor);
1593
1721
  // useMoistureSensor
1594
1722
  const useMoistureSensorValue = exports.IrrigationCCValues.useMoistureSensor(this.valveId);
1595
- this.ensureMetadata(applHost, useMoistureSensorValue);
1596
- this.setValue(applHost, useMoistureSensorValue, this.useMoistureSensor);
1723
+ this.ensureMetadata(ctx, useMoistureSensorValue);
1724
+ this.setValue(ctx, useMoistureSensorValue, this.useMoistureSensor);
1597
1725
  return true;
1598
1726
  }
1599
1727
  valveId;
@@ -1604,9 +1732,9 @@ let IrrigationCCValveConfigReport = class IrrigationCCValveConfigReport extends
1604
1732
  lowFlowThreshold;
1605
1733
  useRainSensor;
1606
1734
  useMoistureSensor;
1607
- toLogEntry(host) {
1735
+ toLogEntry(ctx) {
1608
1736
  return {
1609
- ...super.toLogEntry(host),
1737
+ ...super.toLogEntry(ctx),
1610
1738
  message: {
1611
1739
  "valve ID": this.valveId,
1612
1740
  "nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
@@ -1621,31 +1749,32 @@ let IrrigationCCValveConfigReport = class IrrigationCCValveConfigReport extends
1621
1749
  }
1622
1750
  };
1623
1751
  exports.IrrigationCCValveConfigReport = IrrigationCCValveConfigReport;
1624
- exports.IrrigationCCValveConfigReport = IrrigationCCValveConfigReport = __decorate([
1752
+ exports.IrrigationCCValveConfigReport = IrrigationCCValveConfigReport = IrrigationCCValveConfigReport_1 = __decorate([
1625
1753
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveConfigReport)
1626
1754
  ], IrrigationCCValveConfigReport);
1627
1755
  let IrrigationCCValveConfigGet = class IrrigationCCValveConfigGet extends IrrigationCC {
1628
- constructor(host, options) {
1629
- super(host, options);
1630
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1631
- // TODO: Deserialize payload
1632
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1633
- }
1634
- else {
1635
- this.valveId = options.valveId;
1636
- }
1756
+ constructor(options) {
1757
+ super(options);
1758
+ this.valveId = options.valveId;
1759
+ }
1760
+ static from(_raw, _ctx) {
1761
+ // TODO: Deserialize payload
1762
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1763
+ // return new IrrigationCCValveConfigGet({
1764
+ // nodeId: ctx.sourceNodeId,
1765
+ // });
1637
1766
  }
1638
1767
  valveId;
1639
- serialize() {
1768
+ serialize(ctx) {
1640
1769
  this.payload = Buffer.from([
1641
1770
  this.valveId === "master" ? 1 : 0,
1642
1771
  this.valveId === "master" ? 1 : this.valveId || 1,
1643
1772
  ]);
1644
- return super.serialize();
1773
+ return super.serialize(ctx);
1645
1774
  }
1646
- toLogEntry(host) {
1775
+ toLogEntry(ctx) {
1647
1776
  return {
1648
- ...super.toLogEntry(host),
1777
+ ...super.toLogEntry(ctx),
1649
1778
  message: {
1650
1779
  "valve ID": this.valveId,
1651
1780
  },
@@ -1658,20 +1787,21 @@ exports.IrrigationCCValveConfigGet = IrrigationCCValveConfigGet = __decorate([
1658
1787
  (0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCValveConfigReport, testResponseForIrrigationCommandWithValveId)
1659
1788
  ], IrrigationCCValveConfigGet);
1660
1789
  let IrrigationCCValveRun = class IrrigationCCValveRun extends IrrigationCC {
1661
- constructor(host, options) {
1662
- super(host, options);
1663
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1664
- // TODO: Deserialize payload
1665
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1666
- }
1667
- else {
1668
- this.valveId = options.valveId;
1669
- this.duration = options.duration;
1670
- }
1790
+ constructor(options) {
1791
+ super(options);
1792
+ this.valveId = options.valveId;
1793
+ this.duration = options.duration;
1794
+ }
1795
+ static from(_raw, _ctx) {
1796
+ // TODO: Deserialize payload
1797
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1798
+ // return new IrrigationCCValveRun({
1799
+ // nodeId: ctx.sourceNodeId,
1800
+ // });
1671
1801
  }
1672
1802
  valveId;
1673
1803
  duration;
1674
- serialize() {
1804
+ serialize(ctx) {
1675
1805
  this.payload = Buffer.from([
1676
1806
  this.valveId === "master" ? 1 : 0,
1677
1807
  this.valveId === "master" ? 1 : this.valveId || 1,
@@ -1679,9 +1809,9 @@ let IrrigationCCValveRun = class IrrigationCCValveRun extends IrrigationCC {
1679
1809
  0,
1680
1810
  ]);
1681
1811
  this.payload.writeUInt16BE(this.duration, 2);
1682
- return super.serialize();
1812
+ return super.serialize(ctx);
1683
1813
  }
1684
- toLogEntry(host) {
1814
+ toLogEntry(ctx) {
1685
1815
  const message = {
1686
1816
  "valve ID": this.valveId,
1687
1817
  };
@@ -1692,7 +1822,7 @@ let IrrigationCCValveRun = class IrrigationCCValveRun extends IrrigationCC {
1692
1822
  message.action = "turn off";
1693
1823
  }
1694
1824
  return {
1695
- ...super.toLogEntry(host),
1825
+ ...super.toLogEntry(ctx),
1696
1826
  message,
1697
1827
  };
1698
1828
  }
@@ -1703,20 +1833,21 @@ exports.IrrigationCCValveRun = IrrigationCCValveRun = __decorate([
1703
1833
  (0, CommandClassDecorators_1.useSupervision)()
1704
1834
  ], IrrigationCCValveRun);
1705
1835
  let IrrigationCCValveTableSet = class IrrigationCCValveTableSet extends IrrigationCC {
1706
- constructor(host, options) {
1707
- super(host, options);
1708
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1709
- // TODO: Deserialize payload
1710
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1711
- }
1712
- else {
1713
- this.tableId = options.tableId;
1714
- this.entries = options.entries;
1715
- }
1836
+ constructor(options) {
1837
+ super(options);
1838
+ this.tableId = options.tableId;
1839
+ this.entries = options.entries;
1840
+ }
1841
+ static from(_raw, _ctx) {
1842
+ // TODO: Deserialize payload
1843
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1844
+ // return new IrrigationCCValveTableSet({
1845
+ // nodeId: ctx.sourceNodeId,
1846
+ // });
1716
1847
  }
1717
1848
  tableId;
1718
1849
  entries;
1719
- serialize() {
1850
+ serialize(ctx) {
1720
1851
  this.payload = Buffer.allocUnsafe(1 + this.entries.length * 3);
1721
1852
  this.payload[0] = this.tableId;
1722
1853
  for (let i = 0; i < this.entries.length; i++) {
@@ -1725,9 +1856,9 @@ let IrrigationCCValveTableSet = class IrrigationCCValveTableSet extends Irrigati
1725
1856
  this.payload[offset] = entry.valveId;
1726
1857
  this.payload.writeUInt16BE(entry.duration, offset + 1);
1727
1858
  }
1728
- return super.serialize();
1859
+ return super.serialize(ctx);
1729
1860
  }
1730
- toLogEntry(host) {
1861
+ toLogEntry(ctx) {
1731
1862
  const message = {
1732
1863
  "table ID": this.tableId,
1733
1864
  };
@@ -1742,7 +1873,7 @@ let IrrigationCCValveTableSet = class IrrigationCCValveTableSet extends Irrigati
1742
1873
  }
1743
1874
  }
1744
1875
  return {
1745
- ...super.toLogEntry(host),
1876
+ ...super.toLogEntry(ctx),
1746
1877
  message,
1747
1878
  };
1748
1879
  }
@@ -1752,22 +1883,32 @@ exports.IrrigationCCValveTableSet = IrrigationCCValveTableSet = __decorate([
1752
1883
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveTableSet),
1753
1884
  (0, CommandClassDecorators_1.useSupervision)()
1754
1885
  ], IrrigationCCValveTableSet);
1755
- let IrrigationCCValveTableReport = class IrrigationCCValveTableReport extends IrrigationCC {
1756
- constructor(host, options) {
1757
- super(host, options);
1758
- (0, safe_1.validatePayload)((this.payload.length - 1) % 3 === 0);
1759
- this.tableId = this.payload[0];
1760
- this.entries = [];
1761
- for (let offset = 1; offset < this.payload.length; offset += 3) {
1762
- this.entries.push({
1763
- valveId: this.payload[offset],
1764
- duration: this.payload.readUInt16BE(offset + 1),
1886
+ let IrrigationCCValveTableReport = IrrigationCCValveTableReport_1 = class IrrigationCCValveTableReport extends IrrigationCC {
1887
+ constructor(options) {
1888
+ super(options);
1889
+ // TODO: Check implementation:
1890
+ this.tableId = options.tableId;
1891
+ this.entries = options.entries;
1892
+ }
1893
+ static from(raw, ctx) {
1894
+ (0, safe_1.validatePayload)((raw.payload.length - 1) % 3 === 0);
1895
+ const tableId = raw.payload[0];
1896
+ const entries = [];
1897
+ for (let offset = 1; offset < raw.payload.length; offset += 3) {
1898
+ entries.push({
1899
+ valveId: raw.payload[offset],
1900
+ duration: raw.payload.readUInt16BE(offset + 1),
1765
1901
  });
1766
1902
  }
1903
+ return new IrrigationCCValveTableReport_1({
1904
+ nodeId: ctx.sourceNodeId,
1905
+ tableId,
1906
+ entries,
1907
+ });
1767
1908
  }
1768
1909
  tableId;
1769
1910
  entries;
1770
- toLogEntry(host) {
1911
+ toLogEntry(ctx) {
1771
1912
  const message = {
1772
1913
  "table ID": this.tableId,
1773
1914
  };
@@ -1782,37 +1923,38 @@ let IrrigationCCValveTableReport = class IrrigationCCValveTableReport extends Ir
1782
1923
  }
1783
1924
  }
1784
1925
  return {
1785
- ...super.toLogEntry(host),
1926
+ ...super.toLogEntry(ctx),
1786
1927
  message,
1787
1928
  };
1788
1929
  }
1789
1930
  };
1790
1931
  exports.IrrigationCCValveTableReport = IrrigationCCValveTableReport;
1791
- exports.IrrigationCCValveTableReport = IrrigationCCValveTableReport = __decorate([
1932
+ exports.IrrigationCCValveTableReport = IrrigationCCValveTableReport = IrrigationCCValveTableReport_1 = __decorate([
1792
1933
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveTableReport)
1793
1934
  ], IrrigationCCValveTableReport);
1794
1935
  function testResponseForIrrigationValveTableGet(sent, received) {
1795
1936
  return received.tableId === sent.tableId;
1796
1937
  }
1797
1938
  let IrrigationCCValveTableGet = class IrrigationCCValveTableGet extends IrrigationCC {
1798
- constructor(host, options) {
1799
- super(host, options);
1800
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1801
- // TODO: Deserialize payload
1802
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1803
- }
1804
- else {
1805
- this.tableId = options.tableId;
1806
- }
1939
+ constructor(options) {
1940
+ super(options);
1941
+ this.tableId = options.tableId;
1942
+ }
1943
+ static from(_raw, _ctx) {
1944
+ // TODO: Deserialize payload
1945
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1946
+ // return new IrrigationCCValveTableGet({
1947
+ // nodeId: ctx.sourceNodeId,
1948
+ // });
1807
1949
  }
1808
1950
  tableId;
1809
- serialize() {
1951
+ serialize(ctx) {
1810
1952
  this.payload = Buffer.from([this.tableId]);
1811
- return super.serialize();
1953
+ return super.serialize(ctx);
1812
1954
  }
1813
- toLogEntry(host) {
1955
+ toLogEntry(ctx) {
1814
1956
  return {
1815
- ...super.toLogEntry(host),
1957
+ ...super.toLogEntry(ctx),
1816
1958
  message: {
1817
1959
  "table ID": this.tableId,
1818
1960
  },
@@ -1825,27 +1967,28 @@ exports.IrrigationCCValveTableGet = IrrigationCCValveTableGet = __decorate([
1825
1967
  (0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCValveTableReport, testResponseForIrrigationValveTableGet)
1826
1968
  ], IrrigationCCValveTableGet);
1827
1969
  let IrrigationCCValveTableRun = class IrrigationCCValveTableRun extends IrrigationCC {
1828
- constructor(host, options) {
1829
- super(host, options);
1830
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1831
- // TODO: Deserialize payload
1832
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1833
- }
1834
- else {
1835
- this.tableIDs = options.tableIDs;
1836
- if (this.tableIDs.length < 1) {
1837
- throw new safe_1.ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, safe_1.ZWaveErrorCodes.Argument_Invalid);
1838
- }
1970
+ constructor(options) {
1971
+ super(options);
1972
+ this.tableIDs = options.tableIDs;
1973
+ if (this.tableIDs.length < 1) {
1974
+ throw new safe_1.ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, safe_1.ZWaveErrorCodes.Argument_Invalid);
1839
1975
  }
1840
1976
  }
1977
+ static from(_raw, _ctx) {
1978
+ // TODO: Deserialize payload
1979
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1980
+ // return new IrrigationCCValveTableRun({
1981
+ // nodeId: ctx.sourceNodeId,
1982
+ // });
1983
+ }
1841
1984
  tableIDs;
1842
- serialize() {
1985
+ serialize(ctx) {
1843
1986
  this.payload = Buffer.from(this.tableIDs);
1844
- return super.serialize();
1987
+ return super.serialize(ctx);
1845
1988
  }
1846
- toLogEntry(host) {
1989
+ toLogEntry(ctx) {
1847
1990
  return {
1848
- ...super.toLogEntry(host),
1991
+ ...super.toLogEntry(ctx),
1849
1992
  message: {
1850
1993
  "table IDs": this.tableIDs
1851
1994
  .map((id) => (0, strings_1.padStart)(id.toString(), 3, "0"))
@@ -1860,24 +2003,25 @@ exports.IrrigationCCValveTableRun = IrrigationCCValveTableRun = __decorate([
1860
2003
  (0, CommandClassDecorators_1.useSupervision)()
1861
2004
  ], IrrigationCCValveTableRun);
1862
2005
  let IrrigationCCSystemShutoff = class IrrigationCCSystemShutoff extends IrrigationCC {
1863
- constructor(host, options) {
1864
- super(host, options);
1865
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
1866
- // TODO: Deserialize payload
1867
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
1868
- }
1869
- else {
1870
- this.duration = options.duration;
1871
- }
2006
+ constructor(options) {
2007
+ super(options);
2008
+ this.duration = options.duration;
2009
+ }
2010
+ static from(_raw, _ctx) {
2011
+ // TODO: Deserialize payload
2012
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
2013
+ // return new IrrigationCCSystemShutoff({
2014
+ // nodeId: ctx.sourceNodeId,
2015
+ // });
1872
2016
  }
1873
2017
  duration;
1874
- serialize() {
2018
+ serialize(ctx) {
1875
2019
  this.payload = Buffer.from([this.duration ?? 255]);
1876
- return super.serialize();
2020
+ return super.serialize(ctx);
1877
2021
  }
1878
- toLogEntry(host) {
2022
+ toLogEntry(ctx) {
1879
2023
  return {
1880
- ...super.toLogEntry(host),
2024
+ ...super.toLogEntry(ctx),
1881
2025
  message: {
1882
2026
  duration: this.duration === 0
1883
2027
  ? "temporarily"