@zwave-js/cc 13.10.1 → 14.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/build/cc/AlarmSensorCC.d.ts +31 -20
  2. package/build/cc/AlarmSensorCC.d.ts.map +1 -1
  3. package/build/cc/AlarmSensorCC.js +106 -87
  4. package/build/cc/AlarmSensorCC.js.map +1 -1
  5. package/build/cc/AssociationCC.d.ts +38 -32
  6. package/build/cc/AssociationCC.d.ts.map +1 -1
  7. package/build/cc/AssociationCC.js +193 -176
  8. package/build/cc/AssociationCC.js.map +1 -1
  9. package/build/cc/AssociationGroupInfoCC.d.ts +42 -36
  10. package/build/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  11. package/build/cc/AssociationGroupInfoCC.js +218 -200
  12. package/build/cc/AssociationGroupInfoCC.js.map +1 -1
  13. package/build/cc/BarrierOperatorCC.d.ts +41 -24
  14. package/build/cc/BarrierOperatorCC.d.ts.map +1 -1
  15. package/build/cc/BarrierOperatorCC.js +143 -109
  16. package/build/cc/BarrierOperatorCC.js.map +1 -1
  17. package/build/cc/BasicCC.d.ts +22 -23
  18. package/build/cc/BasicCC.d.ts.map +1 -1
  19. package/build/cc/BasicCC.js +83 -77
  20. package/build/cc/BasicCC.js.map +1 -1
  21. package/build/cc/BatteryCC.d.ts +22 -14
  22. package/build/cc/BatteryCC.d.ts.map +1 -1
  23. package/build/cc/BatteryCC.js +116 -87
  24. package/build/cc/BatteryCC.js.map +1 -1
  25. package/build/cc/BinarySensorCC.d.ts +22 -19
  26. package/build/cc/BinarySensorCC.d.ts.map +1 -1
  27. package/build/cc/BinarySensorCC.js +103 -93
  28. package/build/cc/BinarySensorCC.js.map +1 -1
  29. package/build/cc/BinarySwitchCC.d.ts +20 -20
  30. package/build/cc/BinarySwitchCC.d.ts.map +1 -1
  31. package/build/cc/BinarySwitchCC.js +71 -59
  32. package/build/cc/BinarySwitchCC.js.map +1 -1
  33. package/build/cc/CRC16CC.d.ts +9 -9
  34. package/build/cc/CRC16CC.d.ts.map +1 -1
  35. package/build/cc/CRC16CC.js +36 -36
  36. package/build/cc/CRC16CC.js.map +1 -1
  37. package/build/cc/CentralSceneCC.d.ts +34 -16
  38. package/build/cc/CentralSceneCC.d.ts.map +1 -1
  39. package/build/cc/CentralSceneCC.js +116 -79
  40. package/build/cc/CentralSceneCC.js.map +1 -1
  41. package/build/cc/ClimateControlScheduleCC.d.ts +38 -21
  42. package/build/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  43. package/build/cc/ClimateControlScheduleCC.js +113 -81
  44. package/build/cc/ClimateControlScheduleCC.js.map +1 -1
  45. package/build/cc/ClockCC.d.ts +18 -11
  46. package/build/cc/ClockCC.d.ts.map +1 -1
  47. package/build/cc/ClockCC.js +57 -43
  48. package/build/cc/ClockCC.js.map +1 -1
  49. package/build/cc/ColorSwitchCC.d.ts +37 -33
  50. package/build/cc/ColorSwitchCC.d.ts.map +1 -1
  51. package/build/cc/ColorSwitchCC.js +216 -189
  52. package/build/cc/ColorSwitchCC.js.map +1 -1
  53. package/build/cc/ConfigurationCC.d.ts +89 -74
  54. package/build/cc/ConfigurationCC.d.ts.map +1 -1
  55. package/build/cc/ConfigurationCC.js +541 -485
  56. package/build/cc/ConfigurationCC.js.map +1 -1
  57. package/build/cc/DeviceResetLocallyCC.d.ts +3 -3
  58. package/build/cc/DeviceResetLocallyCC.d.ts.map +1 -1
  59. package/build/cc/DeviceResetLocallyCC.js +14 -14
  60. package/build/cc/DeviceResetLocallyCC.js.map +1 -1
  61. package/build/cc/DoorLockCC.d.ts +66 -27
  62. package/build/cc/DoorLockCC.d.ts.map +1 -1
  63. package/build/cc/DoorLockCC.js +288 -197
  64. package/build/cc/DoorLockCC.js.map +1 -1
  65. package/build/cc/DoorLockLoggingCC.d.ts +23 -13
  66. package/build/cc/DoorLockLoggingCC.d.ts.map +1 -1
  67. package/build/cc/DoorLockLoggingCC.js +81 -63
  68. package/build/cc/DoorLockLoggingCC.js.map +1 -1
  69. package/build/cc/EnergyProductionCC.d.ts +16 -14
  70. package/build/cc/EnergyProductionCC.d.ts.map +1 -1
  71. package/build/cc/EnergyProductionCC.js +58 -52
  72. package/build/cc/EnergyProductionCC.js.map +1 -1
  73. package/build/cc/EntryControlCC.d.ts +44 -18
  74. package/build/cc/EntryControlCC.d.ts.map +1 -1
  75. package/build/cc/EntryControlCC.js +163 -112
  76. package/build/cc/EntryControlCC.js.map +1 -1
  77. package/build/cc/FirmwareUpdateMetaDataCC.d.ts +69 -34
  78. package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  79. package/build/cc/FirmwareUpdateMetaDataCC.js +311 -245
  80. package/build/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  81. package/build/cc/HumidityControlModeCC.d.ts +24 -16
  82. package/build/cc/HumidityControlModeCC.d.ts.map +1 -1
  83. package/build/cc/HumidityControlModeCC.js +80 -65
  84. package/build/cc/HumidityControlModeCC.js.map +1 -1
  85. package/build/cc/HumidityControlOperatingStateCC.d.ts +11 -7
  86. package/build/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  87. package/build/cc/HumidityControlOperatingStateCC.js +31 -22
  88. package/build/cc/HumidityControlOperatingStateCC.js.map +1 -1
  89. package/build/cc/HumidityControlSetpointCC.d.ts +68 -49
  90. package/build/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  91. package/build/cc/HumidityControlSetpointCC.js +203 -181
  92. package/build/cc/HumidityControlSetpointCC.js.map +1 -1
  93. package/build/cc/InclusionControllerCC.d.ts +13 -11
  94. package/build/cc/InclusionControllerCC.d.ts.map +1 -1
  95. package/build/cc/InclusionControllerCC.js +49 -42
  96. package/build/cc/InclusionControllerCC.js.map +1 -1
  97. package/build/cc/IndicatorCC.d.ts +46 -39
  98. package/build/cc/IndicatorCC.d.ts.map +1 -1
  99. package/build/cc/IndicatorCC.js +298 -277
  100. package/build/cc/IndicatorCC.js.map +1 -1
  101. package/build/cc/IrrigationCC.d.ts +127 -57
  102. package/build/cc/IrrigationCC.d.ts.map +1 -1
  103. package/build/cc/IrrigationCC.js +496 -352
  104. package/build/cc/IrrigationCC.js.map +1 -1
  105. package/build/cc/LanguageCC.d.ts +17 -11
  106. package/build/cc/LanguageCC.d.ts.map +1 -1
  107. package/build/cc/LanguageCC.js +54 -44
  108. package/build/cc/LanguageCC.js.map +1 -1
  109. package/build/cc/LockCC.d.ts +16 -11
  110. package/build/cc/LockCC.d.ts.map +1 -1
  111. package/build/cc/LockCC.js +48 -38
  112. package/build/cc/LockCC.js.map +1 -1
  113. package/build/cc/ManufacturerProprietaryCC.d.ts +12 -11
  114. package/build/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
  115. package/build/cc/ManufacturerProprietaryCC.js +45 -50
  116. package/build/cc/ManufacturerProprietaryCC.js.map +1 -1
  117. package/build/cc/ManufacturerSpecificCC.d.ts +20 -13
  118. package/build/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  119. package/build/cc/ManufacturerSpecificCC.js +79 -63
  120. package/build/cc/ManufacturerSpecificCC.js.map +1 -1
  121. package/build/cc/MeterCC.d.ts +30 -26
  122. package/build/cc/MeterCC.d.ts.map +1 -1
  123. package/build/cc/MeterCC.js +236 -204
  124. package/build/cc/MeterCC.js.map +1 -1
  125. package/build/cc/MultiChannelAssociationCC.d.ts +31 -26
  126. package/build/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  127. package/build/cc/MultiChannelAssociationCC.js +177 -168
  128. package/build/cc/MultiChannelAssociationCC.js.map +1 -1
  129. package/build/cc/MultiChannelCC.d.ts +70 -49
  130. package/build/cc/MultiChannelCC.d.ts.map +1 -1
  131. package/build/cc/MultiChannelCC.js +377 -318
  132. package/build/cc/MultiChannelCC.js.map +1 -1
  133. package/build/cc/MultiCommandCC.d.ts +9 -9
  134. package/build/cc/MultiCommandCC.d.ts.map +1 -1
  135. package/build/cc/MultiCommandCC.js +35 -36
  136. package/build/cc/MultiCommandCC.js.map +1 -1
  137. package/build/cc/MultilevelSensorCC.d.ts +38 -33
  138. package/build/cc/MultilevelSensorCC.d.ts.map +1 -1
  139. package/build/cc/MultilevelSensorCC.js +172 -152
  140. package/build/cc/MultilevelSensorCC.js.map +1 -1
  141. package/build/cc/MultilevelSwitchCC.d.ts +29 -25
  142. package/build/cc/MultilevelSwitchCC.d.ts.map +1 -1
  143. package/build/cc/MultilevelSwitchCC.js +147 -127
  144. package/build/cc/MultilevelSwitchCC.js.map +1 -1
  145. package/build/cc/NoOperationCC.d.ts +0 -8
  146. package/build/cc/NoOperationCC.d.ts.map +1 -1
  147. package/build/cc/NoOperationCC.js +2 -11
  148. package/build/cc/NoOperationCC.js.map +1 -1
  149. package/build/cc/NodeNamingCC.d.ts +27 -17
  150. package/build/cc/NodeNamingCC.d.ts.map +1 -1
  151. package/build/cc/NodeNamingCC.js +86 -69
  152. package/build/cc/NodeNamingCC.js.map +1 -1
  153. package/build/cc/NotificationCC.d.ts +46 -43
  154. package/build/cc/NotificationCC.d.ts.map +1 -1
  155. package/build/cc/NotificationCC.js +317 -303
  156. package/build/cc/NotificationCC.js.map +1 -1
  157. package/build/cc/PowerlevelCC.d.ts +22 -18
  158. package/build/cc/PowerlevelCC.d.ts.map +1 -1
  159. package/build/cc/PowerlevelCC.js +125 -95
  160. package/build/cc/PowerlevelCC.js.map +1 -1
  161. package/build/cc/ProtectionCC.d.ts +49 -26
  162. package/build/cc/ProtectionCC.d.ts.map +1 -1
  163. package/build/cc/ProtectionCC.js +172 -126
  164. package/build/cc/ProtectionCC.js.map +1 -1
  165. package/build/cc/SceneActivationCC.d.ts +8 -7
  166. package/build/cc/SceneActivationCC.d.ts.map +1 -1
  167. package/build/cc/SceneActivationCC.js +28 -23
  168. package/build/cc/SceneActivationCC.js.map +1 -1
  169. package/build/cc/SceneActuatorConfigurationCC.d.ts +23 -15
  170. package/build/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  171. package/build/cc/SceneActuatorConfigurationCC.js +79 -62
  172. package/build/cc/SceneActuatorConfigurationCC.js.map +1 -1
  173. package/build/cc/SceneControllerConfigurationCC.d.ts +25 -17
  174. package/build/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  175. package/build/cc/SceneControllerConfigurationCC.js +92 -78
  176. package/build/cc/SceneControllerConfigurationCC.js.map +1 -1
  177. package/build/cc/ScheduleEntryLockCC.d.ts +86 -72
  178. package/build/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  179. package/build/cc/ScheduleEntryLockCC.js +607 -455
  180. package/build/cc/ScheduleEntryLockCC.js.map +1 -1
  181. package/build/cc/Security2CC.d.ts +78 -87
  182. package/build/cc/Security2CC.d.ts.map +1 -1
  183. package/build/cc/Security2CC.js +798 -765
  184. package/build/cc/Security2CC.js.map +1 -1
  185. package/build/cc/SecurityCC.d.ts +47 -42
  186. package/build/cc/SecurityCC.d.ts.map +1 -1
  187. package/build/cc/SecurityCC.js +240 -218
  188. package/build/cc/SecurityCC.js.map +1 -1
  189. package/build/cc/SoundSwitchCC.d.ts +36 -29
  190. package/build/cc/SoundSwitchCC.d.ts.map +1 -1
  191. package/build/cc/SoundSwitchCC.js +180 -157
  192. package/build/cc/SoundSwitchCC.js.map +1 -1
  193. package/build/cc/SupervisionCC.d.ts +17 -14
  194. package/build/cc/SupervisionCC.d.ts.map +1 -1
  195. package/build/cc/SupervisionCC.js +86 -66
  196. package/build/cc/SupervisionCC.js.map +1 -1
  197. package/build/cc/ThermostatFanModeCC.d.ts +25 -15
  198. package/build/cc/ThermostatFanModeCC.d.ts.map +1 -1
  199. package/build/cc/ThermostatFanModeCC.js +79 -60
  200. package/build/cc/ThermostatFanModeCC.js.map +1 -1
  201. package/build/cc/ThermostatFanStateCC.d.ts +11 -7
  202. package/build/cc/ThermostatFanStateCC.d.ts.map +1 -1
  203. package/build/cc/ThermostatFanStateCC.js +31 -22
  204. package/build/cc/ThermostatFanStateCC.js.map +1 -1
  205. package/build/cc/ThermostatModeCC.d.ts +24 -21
  206. package/build/cc/ThermostatModeCC.d.ts.map +1 -1
  207. package/build/cc/ThermostatModeCC.js +106 -90
  208. package/build/cc/ThermostatModeCC.js.map +1 -1
  209. package/build/cc/ThermostatOperatingStateCC.d.ts +11 -7
  210. package/build/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  211. package/build/cc/ThermostatOperatingStateCC.js +31 -22
  212. package/build/cc/ThermostatOperatingStateCC.js.map +1 -1
  213. package/build/cc/ThermostatSetbackCC.d.ts +14 -13
  214. package/build/cc/ThermostatSetbackCC.d.ts.map +1 -1
  215. package/build/cc/ThermostatSetbackCC.js +64 -57
  216. package/build/cc/ThermostatSetbackCC.js.map +1 -1
  217. package/build/cc/ThermostatSetpointCC.d.ts +38 -57
  218. package/build/cc/ThermostatSetpointCC.d.ts.map +1 -1
  219. package/build/cc/ThermostatSetpointCC.js +200 -264
  220. package/build/cc/ThermostatSetpointCC.js.map +1 -1
  221. package/build/cc/TimeCC.d.ts +24 -20
  222. package/build/cc/TimeCC.d.ts.map +1 -1
  223. package/build/cc/TimeCC.js +119 -108
  224. package/build/cc/TimeCC.js.map +1 -1
  225. package/build/cc/TimeParametersCC.d.ts +18 -14
  226. package/build/cc/TimeParametersCC.d.ts.map +1 -1
  227. package/build/cc/TimeParametersCC.js +77 -69
  228. package/build/cc/TimeParametersCC.js.map +1 -1
  229. package/build/cc/TransportServiceCC.d.ts +29 -32
  230. package/build/cc/TransportServiceCC.d.ts.map +1 -1
  231. package/build/cc/TransportServiceCC.js +159 -161
  232. package/build/cc/TransportServiceCC.js.map +1 -1
  233. package/build/cc/UserCodeCC.d.ts +83 -66
  234. package/build/cc/UserCodeCC.d.ts.map +1 -1
  235. package/build/cc/UserCodeCC.js +449 -402
  236. package/build/cc/UserCodeCC.js.map +1 -1
  237. package/build/cc/VersionCC.d.ts +36 -20
  238. package/build/cc/VersionCC.d.ts.map +1 -1
  239. package/build/cc/VersionCC.js +190 -149
  240. package/build/cc/VersionCC.js.map +1 -1
  241. package/build/cc/WakeUpCC.d.ts +27 -13
  242. package/build/cc/WakeUpCC.d.ts.map +1 -1
  243. package/build/cc/WakeUpCC.js +105 -77
  244. package/build/cc/WakeUpCC.js.map +1 -1
  245. package/build/cc/WindowCoveringCC.d.ts +39 -27
  246. package/build/cc/WindowCoveringCC.d.ts.map +1 -1
  247. package/build/cc/WindowCoveringCC.js +169 -137
  248. package/build/cc/WindowCoveringCC.js.map +1 -1
  249. package/build/cc/ZWavePlusCC.d.ts +8 -7
  250. package/build/cc/ZWavePlusCC.d.ts.map +1 -1
  251. package/build/cc/ZWavePlusCC.js +44 -37
  252. package/build/cc/ZWavePlusCC.js.map +1 -1
  253. package/build/cc/ZWaveProtocolCC.d.ts +111 -84
  254. package/build/cc/ZWaveProtocolCC.d.ts.map +1 -1
  255. package/build/cc/ZWaveProtocolCC.js +583 -508
  256. package/build/cc/ZWaveProtocolCC.js.map +1 -1
  257. package/build/cc/index.d.ts +37 -34
  258. package/build/cc/index.d.ts.map +1 -1
  259. package/build/cc/index.js +6 -7
  260. package/build/cc/index.js.map +1 -1
  261. package/build/cc/manufacturerProprietary/FibaroCC.d.ts +29 -24
  262. package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
  263. package/build/cc/manufacturerProprietary/FibaroCC.js +109 -112
  264. package/build/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  265. package/build/index.d.ts +0 -1
  266. package/build/index.d.ts.map +1 -1
  267. package/build/index.js +0 -1
  268. package/build/index.js.map +1 -1
  269. package/build/lib/API.d.ts +21 -18
  270. package/build/lib/API.d.ts.map +1 -1
  271. package/build/lib/API.js +25 -49
  272. package/build/lib/API.js.map +1 -1
  273. package/build/lib/CommandClass.d.ts +51 -89
  274. package/build/lib/CommandClass.d.ts.map +1 -1
  275. package/build/lib/CommandClass.js +177 -249
  276. package/build/lib/CommandClass.js.map +1 -1
  277. package/build/lib/EncapsulatingCommandClass.d.ts +1 -15
  278. package/build/lib/EncapsulatingCommandClass.d.ts.map +1 -1
  279. package/build/lib/EncapsulatingCommandClass.js.map +1 -1
  280. package/build/lib/ICommandClassContainer.d.ts +1 -8
  281. package/build/lib/ICommandClassContainer.d.ts.map +1 -1
  282. package/build/lib/ICommandClassContainer.js +0 -8
  283. package/build/lib/ICommandClassContainer.js.map +1 -1
  284. package/build/lib/Values.d.ts +3 -3
  285. package/build/lib/Values.d.ts.map +1 -1
  286. package/build/lib/_Types.d.ts.map +1 -1
  287. package/build/lib/_Types.js +1 -0
  288. package/build/lib/_Types.js.map +1 -1
  289. package/build/lib/utils.d.ts +14 -13
  290. package/build/lib/utils.d.ts.map +1 -1
  291. package/build/lib/utils.js +94 -92
  292. package/build/lib/utils.js.map +1 -1
  293. package/package.json +4 -5
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var HumidityControlSetpointCCReport_1, HumidityControlSetpointCCSupportedReport_1, HumidityControlSetpointCCScaleSupportedReport_1, HumidityControlSetpointCCCapabilitiesReport_1;
8
9
  Object.defineProperty(exports, "__esModule", { value: true });
9
10
  exports.HumidityControlSetpointCCCapabilitiesGet = exports.HumidityControlSetpointCCCapabilitiesReport = exports.HumidityControlSetpointCCScaleSupportedGet = exports.HumidityControlSetpointCCScaleSupportedReport = exports.HumidityControlSetpointCCSupportedGet = exports.HumidityControlSetpointCCSupportedReport = exports.HumidityControlSetpointCCGet = exports.HumidityControlSetpointCCReport = exports.HumidityControlSetpointCCSet = exports.HumidityControlSetpointCC = exports.HumidityControlSetpointCCAPI = exports.HumidityControlSetpointCCValues = void 0;
10
11
  function __assertType(argName, typeName, boundHasError) {
@@ -100,12 +101,12 @@ let HumidityControlSetpointCCAPI = class HumidityControlSetpointCCAPI extends AP
100
101
  async get(setpointType) {
101
102
  __assertType("setpointType", "HumidityControlSetpointType", __assertType__number.bind(void 0, setpointType));
102
103
  this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.Get);
103
- const cc = new HumidityControlSetpointCCGet(this.applHost, {
104
+ const cc = new HumidityControlSetpointCCGet({
104
105
  nodeId: this.endpoint.nodeId,
105
- endpoint: this.endpoint.index,
106
+ endpointIndex: this.endpoint.index,
106
107
  setpointType,
107
108
  });
108
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
109
+ const response = await this.host.sendCommand(cc, this.commandOptions);
109
110
  if (!response)
110
111
  return;
111
112
  return response.type === _Types_1.HumidityControlSetpointType["N/A"]
@@ -122,24 +123,24 @@ let HumidityControlSetpointCCAPI = class HumidityControlSetpointCCAPI extends AP
122
123
  __assertType("value", "number", __assertType__number.bind(void 0, value));
123
124
  __assertType("scale", "number", __assertType__number.bind(void 0, scale));
124
125
  this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.Set);
125
- const cc = new HumidityControlSetpointCCSet(this.applHost, {
126
+ const cc = new HumidityControlSetpointCCSet({
126
127
  nodeId: this.endpoint.nodeId,
127
- endpoint: this.endpoint.index,
128
+ endpointIndex: this.endpoint.index,
128
129
  setpointType,
129
130
  value,
130
131
  scale,
131
132
  });
132
- return this.applHost.sendCommand(cc, this.commandOptions);
133
+ return this.host.sendCommand(cc, this.commandOptions);
133
134
  }
134
135
  async getCapabilities(setpointType) {
135
136
  __assertType("setpointType", "HumidityControlSetpointType", __assertType__number.bind(void 0, setpointType));
136
137
  this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.CapabilitiesGet);
137
- const cc = new HumidityControlSetpointCCCapabilitiesGet(this.applHost, {
138
+ const cc = new HumidityControlSetpointCCCapabilitiesGet({
138
139
  nodeId: this.endpoint.nodeId,
139
- endpoint: this.endpoint.index,
140
+ endpointIndex: this.endpoint.index,
140
141
  setpointType,
141
142
  });
142
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
143
+ const response = await this.host.sendCommand(cc, this.commandOptions);
143
144
  if (response) {
144
145
  return (0, safe_2.pick)(response, [
145
146
  "minValue",
@@ -151,22 +152,22 @@ let HumidityControlSetpointCCAPI = class HumidityControlSetpointCCAPI extends AP
151
152
  }
152
153
  async getSupportedSetpointTypes() {
153
154
  this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.SupportedGet);
154
- const cc = new HumidityControlSetpointCCSupportedGet(this.applHost, {
155
+ const cc = new HumidityControlSetpointCCSupportedGet({
155
156
  nodeId: this.endpoint.nodeId,
156
- endpoint: this.endpoint.index,
157
+ endpointIndex: this.endpoint.index,
157
158
  });
158
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
159
+ const response = await this.host.sendCommand(cc, this.commandOptions);
159
160
  return response?.supportedSetpointTypes;
160
161
  }
161
162
  async getSupportedScales(setpointType) {
162
163
  __assertType("setpointType", "HumidityControlSetpointType", __assertType__number.bind(void 0, setpointType));
163
164
  this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.SupportedGet);
164
- const cc = new HumidityControlSetpointCCScaleSupportedGet(this.applHost, {
165
+ const cc = new HumidityControlSetpointCCScaleSupportedGet({
165
166
  nodeId: this.endpoint.nodeId,
166
- endpoint: this.endpoint.index,
167
+ endpointIndex: this.endpoint.index,
167
168
  setpointType,
168
169
  });
169
- const response = await this.applHost.sendCommand(cc, this.commandOptions);
170
+ const response = await this.host.sendCommand(cc, this.commandOptions);
170
171
  if (response) {
171
172
  return response.supportedScales.map((scale) => getScale(scale));
172
173
  }
@@ -177,28 +178,28 @@ exports.HumidityControlSetpointCCAPI = HumidityControlSetpointCCAPI = __decorate
177
178
  (0, CommandClassDecorators_1.API)(safe_1.CommandClasses["Humidity Control Setpoint"])
178
179
  ], HumidityControlSetpointCCAPI);
179
180
  let HumidityControlSetpointCC = class HumidityControlSetpointCC extends CommandClass_1.CommandClass {
180
- translatePropertyKey(applHost, property, propertyKey) {
181
+ translatePropertyKey(ctx, property, propertyKey) {
181
182
  if (property === "setpoint") {
182
183
  return (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, propertyKey);
183
184
  }
184
185
  else {
185
- return super.translatePropertyKey(applHost, property, propertyKey);
186
+ return super.translatePropertyKey(ctx, property, propertyKey);
186
187
  }
187
188
  }
188
- async interview(applHost) {
189
- const node = this.getNode(applHost);
190
- const endpoint = this.getEndpoint(applHost);
191
- const api = API_1.CCAPI.create(safe_1.CommandClasses["Humidity Control Setpoint"], applHost, endpoint).withOptions({
189
+ async interview(ctx) {
190
+ const node = this.getNode(ctx);
191
+ const endpoint = this.getEndpoint(ctx);
192
+ const api = API_1.CCAPI.create(safe_1.CommandClasses["Humidity Control Setpoint"], ctx, endpoint).withOptions({
192
193
  priority: safe_1.MessagePriority.NodeQuery,
193
194
  });
194
- applHost.controllerLog.logNode(node.id, {
195
+ ctx.logNode(node.id, {
195
196
  endpoint: this.endpointIndex,
196
197
  message: `Interviewing ${this.ccName}...`,
197
198
  direction: "none",
198
199
  });
199
200
  // Query the supported setpoint types
200
201
  let setpointTypes = [];
201
- applHost.controllerLog.logNode(node.id, {
202
+ ctx.logNode(node.id, {
202
203
  endpoint: this.endpointIndex,
203
204
  message: "retrieving supported setpoint types...",
204
205
  direction: "outbound",
@@ -211,14 +212,14 @@ let HumidityControlSetpointCC = class HumidityControlSetpointCC extends CommandC
211
212
  .map((type) => (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, type))
212
213
  .map((name) => `· ${name}`)
213
214
  .join("\n");
214
- applHost.controllerLog.logNode(node.id, {
215
+ ctx.logNode(node.id, {
215
216
  endpoint: this.endpointIndex,
216
217
  message: logMessage,
217
218
  direction: "inbound",
218
219
  });
219
220
  }
220
221
  else {
221
- applHost.controllerLog.logNode(node.id, {
222
+ ctx.logNode(node.id, {
222
223
  endpoint: this.endpointIndex,
223
224
  message: "Querying supported setpoint types timed out, skipping interview...",
224
225
  level: "warn",
@@ -228,7 +229,7 @@ let HumidityControlSetpointCC = class HumidityControlSetpointCC extends CommandC
228
229
  for (const type of setpointTypes) {
229
230
  const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, type);
230
231
  // Find out the capabilities of this setpoint
231
- applHost.controllerLog.logNode(node.id, {
232
+ ctx.logNode(node.id, {
232
233
  endpoint: this.endpointIndex,
233
234
  message: `retrieving capabilities for setpoint ${setpointName}...`,
234
235
  direction: "outbound",
@@ -239,7 +240,7 @@ let HumidityControlSetpointCC = class HumidityControlSetpointCC extends CommandC
239
240
  ${setpointScaleSupported
240
241
  .map((t) => `\n· ${t.key} ${t.unit} - ${t.label}`)
241
242
  .join("")}`;
242
- applHost.controllerLog.logNode(node.id, {
243
+ ctx.logNode(node.id, {
243
244
  endpoint: this.endpointIndex,
244
245
  message: logMessage,
245
246
  direction: "inbound",
@@ -251,7 +252,7 @@ ${setpointScaleSupported
251
252
  if (scale.unit)
252
253
  states[scale.key] = scale.unit;
253
254
  }
254
- this.setMetadata(applHost, scaleValue, {
255
+ this.setMetadata(ctx, scaleValue, {
255
256
  ...scaleValue.meta,
256
257
  states,
257
258
  });
@@ -263,7 +264,7 @@ ${setpointScaleSupported
263
264
  const logMessage = `received capabilities for setpoint ${setpointName}:
264
265
  minimum value: ${setpointCaps.minValue} ${minValueUnit}
265
266
  maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
266
- applHost.controllerLog.logNode(node.id, {
267
+ ctx.logNode(node.id, {
267
268
  endpoint: this.endpointIndex,
268
269
  message: logMessage,
269
270
  direction: "inbound",
@@ -271,22 +272,22 @@ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
271
272
  }
272
273
  }
273
274
  // Query the current value for all setpoint types
274
- await this.refreshValues(applHost);
275
+ await this.refreshValues(ctx);
275
276
  // Remember that the interview is complete
276
- this.setInterviewComplete(applHost, true);
277
+ this.setInterviewComplete(ctx, true);
277
278
  }
278
- async refreshValues(applHost) {
279
- const node = this.getNode(applHost);
280
- const endpoint = this.getEndpoint(applHost);
281
- const api = API_1.CCAPI.create(safe_1.CommandClasses["Humidity Control Setpoint"], applHost, endpoint).withOptions({
279
+ async refreshValues(ctx) {
280
+ const node = this.getNode(ctx);
281
+ const endpoint = this.getEndpoint(ctx);
282
+ const api = API_1.CCAPI.create(safe_1.CommandClasses["Humidity Control Setpoint"], ctx, endpoint).withOptions({
282
283
  priority: safe_1.MessagePriority.NodeQuery,
283
284
  });
284
- const setpointTypes = this.getValue(applHost, exports.HumidityControlSetpointCCValues.supportedSetpointTypes) ?? [];
285
+ const setpointTypes = this.getValue(ctx, exports.HumidityControlSetpointCCValues.supportedSetpointTypes) ?? [];
285
286
  // Query each setpoint's current value
286
287
  for (const type of setpointTypes) {
287
288
  const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, type);
288
289
  // Every time, query the current value
289
- applHost.controllerLog.logNode(node.id, {
290
+ ctx.logNode(node.id, {
290
291
  endpoint: this.endpointIndex,
291
292
  message: `querying current value of setpoint ${setpointName}...`,
292
293
  direction: "outbound",
@@ -294,7 +295,7 @@ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
294
295
  const setpoint = await api.get(type);
295
296
  if (setpoint) {
296
297
  const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${getScale(setpoint.scale).unit ?? ""}`;
297
- applHost.controllerLog.logNode(node.id, {
298
+ ctx.logNode(node.id, {
298
299
  endpoint: this.endpointIndex,
299
300
  message: logMessage,
300
301
  direction: "inbound",
@@ -310,32 +311,33 @@ exports.HumidityControlSetpointCC = HumidityControlSetpointCC = __decorate([
310
311
  (0, CommandClassDecorators_1.ccValues)(exports.HumidityControlSetpointCCValues)
311
312
  ], HumidityControlSetpointCC);
312
313
  let HumidityControlSetpointCCSet = class HumidityControlSetpointCCSet extends HumidityControlSetpointCC {
313
- constructor(host, options) {
314
- super(host, options);
315
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
316
- // TODO: Deserialize payload
317
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
318
- }
319
- else {
320
- this.setpointType = options.setpointType;
321
- this.value = options.value;
322
- this.scale = options.scale;
323
- }
314
+ constructor(options) {
315
+ super(options);
316
+ this.setpointType = options.setpointType;
317
+ this.value = options.value;
318
+ this.scale = options.scale;
319
+ }
320
+ static from(_raw, _ctx) {
321
+ // TODO: Deserialize payload
322
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
323
+ // return new HumidityControlSetpointCCSet({
324
+ // nodeId: ctx.sourceNodeId,
325
+ // });
324
326
  }
325
327
  setpointType;
326
328
  value;
327
329
  scale;
328
- serialize() {
330
+ serialize(ctx) {
329
331
  this.payload = Buffer.concat([
330
332
  Buffer.from([this.setpointType & 0b1111]),
331
333
  (0, safe_1.encodeFloatWithScale)(this.value, this.scale),
332
334
  ]);
333
- return super.serialize();
335
+ return super.serialize(ctx);
334
336
  }
335
- toLogEntry(host) {
337
+ toLogEntry(ctx) {
336
338
  const scale = getScale(this.scale);
337
339
  return {
338
- ...super.toLogEntry(host),
340
+ ...super.toLogEntry(ctx),
339
341
  message: {
340
342
  "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.setpointType),
341
343
  value: `${this.value} ${scale.unit}`,
@@ -348,54 +350,61 @@ exports.HumidityControlSetpointCCSet = HumidityControlSetpointCCSet = __decorate
348
350
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.Set),
349
351
  (0, CommandClassDecorators_1.useSupervision)()
350
352
  ], HumidityControlSetpointCCSet);
351
- let HumidityControlSetpointCCReport = class HumidityControlSetpointCCReport extends HumidityControlSetpointCC {
352
- constructor(host, options) {
353
- super(host, options);
354
- (0, safe_1.validatePayload)(this.payload.length >= 1);
355
- this._type = this.payload[0] & 0b1111;
353
+ let HumidityControlSetpointCCReport = HumidityControlSetpointCCReport_1 = class HumidityControlSetpointCCReport extends HumidityControlSetpointCC {
354
+ constructor(options) {
355
+ super(options);
356
+ // TODO: Check implementation:
357
+ this.type = options.type;
358
+ this.value = options.value;
359
+ this.scale = options.scale;
360
+ }
361
+ static from(raw, ctx) {
362
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
363
+ const type = raw.payload[0] & 0b1111;
356
364
  // Setpoint type 0 is not defined in the spec, prevent devices from using it.
357
- if (this._type === 0) {
365
+ if (type === 0) {
358
366
  // Not supported
359
- this._value = 0;
360
- this.scale = 0;
361
- return;
367
+ return new HumidityControlSetpointCCReport_1({
368
+ nodeId: ctx.sourceNodeId,
369
+ type,
370
+ value: 0,
371
+ scale: 0,
372
+ });
362
373
  }
363
374
  // parseFloatWithScale does its own validation
364
- const { value, scale } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(1));
365
- this._value = value;
366
- this.scale = scale;
375
+ const { value, scale } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1));
376
+ return new HumidityControlSetpointCCReport_1({
377
+ nodeId: ctx.sourceNodeId,
378
+ type,
379
+ value,
380
+ scale,
381
+ });
367
382
  }
368
- persistValues(applHost) {
369
- if (!super.persistValues(applHost))
383
+ persistValues(ctx) {
384
+ if (!super.persistValues(ctx))
370
385
  return false;
371
386
  const scale = getScale(this.scale);
372
387
  const setpointValue = exports.HumidityControlSetpointCCValues.setpoint(this.type);
373
- const existingMetadata = this.getMetadata(applHost, setpointValue);
388
+ const existingMetadata = this.getMetadata(ctx, setpointValue);
374
389
  // Update the metadata when it is missing or the unit has changed
375
390
  if (existingMetadata?.unit !== scale.unit) {
376
- this.setMetadata(applHost, setpointValue, {
391
+ this.setMetadata(ctx, setpointValue, {
377
392
  ...(existingMetadata ?? setpointValue.meta),
378
393
  unit: scale.unit,
379
394
  });
380
395
  }
381
- this.setValue(applHost, setpointValue, this._value);
396
+ this.setValue(ctx, setpointValue, this.value);
382
397
  // Remember the device-preferred setpoint scale so it can be used in SET commands
383
- this.setValue(applHost, exports.HumidityControlSetpointCCValues.setpointScale(this.type), this.scale);
398
+ this.setValue(ctx, exports.HumidityControlSetpointCCValues.setpointScale(this.type), this.scale);
384
399
  return true;
385
400
  }
386
- _type;
387
- get type() {
388
- return this._type;
389
- }
401
+ type;
390
402
  scale;
391
- _value;
392
- get value() {
393
- return this._value;
394
- }
395
- toLogEntry(host) {
403
+ value;
404
+ toLogEntry(ctx) {
396
405
  const scale = getScale(this.scale);
397
406
  return {
398
- ...super.toLogEntry(host),
407
+ ...super.toLogEntry(ctx),
399
408
  message: {
400
409
  "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.type),
401
410
  value: `${this.value} ${scale.unit}`,
@@ -404,7 +413,7 @@ let HumidityControlSetpointCCReport = class HumidityControlSetpointCCReport exte
404
413
  }
405
414
  };
406
415
  exports.HumidityControlSetpointCCReport = HumidityControlSetpointCCReport;
407
- exports.HumidityControlSetpointCCReport = HumidityControlSetpointCCReport = __decorate([
416
+ exports.HumidityControlSetpointCCReport = HumidityControlSetpointCCReport = HumidityControlSetpointCCReport_1 = __decorate([
408
417
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.Report)
409
418
  ], HumidityControlSetpointCCReport);
410
419
  function testResponseForHumidityControlSetpointGet(sent, received) {
@@ -412,24 +421,25 @@ function testResponseForHumidityControlSetpointGet(sent, received) {
412
421
  return received.type === sent.setpointType;
413
422
  }
414
423
  let HumidityControlSetpointCCGet = class HumidityControlSetpointCCGet extends HumidityControlSetpointCC {
415
- constructor(host, options) {
416
- super(host, options);
417
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
418
- // TODO: Deserialize payload
419
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
420
- }
421
- else {
422
- this.setpointType = options.setpointType;
423
- }
424
+ constructor(options) {
425
+ super(options);
426
+ this.setpointType = options.setpointType;
427
+ }
428
+ static from(_raw, _ctx) {
429
+ // TODO: Deserialize payload
430
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
431
+ // return new HumidityControlSetpointCCGet({
432
+ // nodeId: ctx.sourceNodeId,
433
+ // });
424
434
  }
425
435
  setpointType;
426
- serialize() {
436
+ serialize(ctx) {
427
437
  this.payload = Buffer.from([this.setpointType & 0b1111]);
428
- return super.serialize();
438
+ return super.serialize(ctx);
429
439
  }
430
- toLogEntry(host) {
440
+ toLogEntry(ctx) {
431
441
  return {
432
- ...super.toLogEntry(host),
442
+ ...super.toLogEntry(ctx),
433
443
  message: {
434
444
  "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.setpointType),
435
445
  },
@@ -441,16 +451,24 @@ exports.HumidityControlSetpointCCGet = HumidityControlSetpointCCGet = __decorate
441
451
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.Get),
442
452
  (0, CommandClassDecorators_1.expectedCCResponse)(HumidityControlSetpointCCReport, testResponseForHumidityControlSetpointGet)
443
453
  ], HumidityControlSetpointCCGet);
444
- let HumidityControlSetpointCCSupportedReport = class HumidityControlSetpointCCSupportedReport extends HumidityControlSetpointCC {
445
- constructor(host, options) {
446
- super(host, options);
447
- (0, safe_1.validatePayload)(this.payload.length >= 1);
448
- this.supportedSetpointTypes = (0, safe_1.parseBitMask)(this.payload, _Types_1.HumidityControlSetpointType["N/A"]);
454
+ let HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupportedReport_1 = class HumidityControlSetpointCCSupportedReport extends HumidityControlSetpointCC {
455
+ constructor(options) {
456
+ super(options);
457
+ // TODO: Check implementation:
458
+ this.supportedSetpointTypes = options.supportedSetpointTypes;
459
+ }
460
+ static from(raw, ctx) {
461
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
462
+ const supportedSetpointTypes = (0, safe_1.parseBitMask)(raw.payload, _Types_1.HumidityControlSetpointType["N/A"]);
463
+ return new HumidityControlSetpointCCSupportedReport_1({
464
+ nodeId: ctx.sourceNodeId,
465
+ supportedSetpointTypes,
466
+ });
449
467
  }
450
468
  supportedSetpointTypes;
451
- toLogEntry(host) {
469
+ toLogEntry(ctx) {
452
470
  return {
453
- ...super.toLogEntry(host),
471
+ ...super.toLogEntry(ctx),
454
472
  message: {
455
473
  "supported setpoint types": this.supportedSetpointTypes
456
474
  .map((t) => `\n· ${(0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, t)}`)
@@ -463,7 +481,7 @@ exports.HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupp
463
481
  __decorate([
464
482
  (0, CommandClassDecorators_1.ccValue)(exports.HumidityControlSetpointCCValues.supportedSetpointTypes)
465
483
  ], HumidityControlSetpointCCSupportedReport.prototype, "supportedSetpointTypes", void 0);
466
- exports.HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupportedReport = __decorate([
484
+ exports.HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupportedReport_1 = __decorate([
467
485
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.SupportedReport)
468
486
  ], HumidityControlSetpointCCSupportedReport);
469
487
  let HumidityControlSetpointCCSupportedGet = class HumidityControlSetpointCCSupportedGet extends HumidityControlSetpointCC {
@@ -473,17 +491,25 @@ exports.HumidityControlSetpointCCSupportedGet = HumidityControlSetpointCCSupport
473
491
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.SupportedGet),
474
492
  (0, CommandClassDecorators_1.expectedCCResponse)(HumidityControlSetpointCCSupportedReport)
475
493
  ], HumidityControlSetpointCCSupportedGet);
476
- let HumidityControlSetpointCCScaleSupportedReport = class HumidityControlSetpointCCScaleSupportedReport extends HumidityControlSetpointCC {
477
- constructor(host, options) {
478
- super(host, options);
479
- (0, safe_1.validatePayload)(this.payload.length >= 1);
480
- this.supportedScales = (0, safe_1.parseBitMask)(Buffer.from([this.payload[0] & 0b1111]), 0);
494
+ let HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport_1 = class HumidityControlSetpointCCScaleSupportedReport extends HumidityControlSetpointCC {
495
+ constructor(options) {
496
+ super(options);
497
+ // TODO: Check implementation:
498
+ this.supportedScales = options.supportedScales;
499
+ }
500
+ static from(raw, ctx) {
501
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
502
+ const supportedScales = (0, safe_1.parseBitMask)(Buffer.from([raw.payload[0] & 0b1111]), 0);
503
+ return new HumidityControlSetpointCCScaleSupportedReport_1({
504
+ nodeId: ctx.sourceNodeId,
505
+ supportedScales,
506
+ });
481
507
  }
482
508
  supportedScales;
483
- toLogEntry(host) {
509
+ toLogEntry(ctx) {
484
510
  const supportedScales = this.supportedScales.map((scale) => getScale(scale));
485
511
  return {
486
- ...super.toLogEntry(host),
512
+ ...super.toLogEntry(ctx),
487
513
  message: {
488
514
  "scale supported": supportedScales
489
515
  .map((t) => `\n· ${t.key} ${t.unit} - ${t.label}`)
@@ -493,28 +519,29 @@ let HumidityControlSetpointCCScaleSupportedReport = class HumidityControlSetpoin
493
519
  }
494
520
  };
495
521
  exports.HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport;
496
- exports.HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport = __decorate([
522
+ exports.HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport_1 = __decorate([
497
523
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.ScaleSupportedReport)
498
524
  ], HumidityControlSetpointCCScaleSupportedReport);
499
525
  let HumidityControlSetpointCCScaleSupportedGet = class HumidityControlSetpointCCScaleSupportedGet extends HumidityControlSetpointCC {
500
- constructor(host, options) {
501
- super(host, options);
502
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
503
- // TODO: Deserialize payload
504
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
505
- }
506
- else {
507
- this.setpointType = options.setpointType;
508
- }
526
+ constructor(options) {
527
+ super(options);
528
+ this.setpointType = options.setpointType;
529
+ }
530
+ static from(_raw, _ctx) {
531
+ // TODO: Deserialize payload
532
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
533
+ // return new HumidityControlSetpointCCScaleSupportedGet({
534
+ // nodeId: ctx.sourceNodeId,
535
+ // });
509
536
  }
510
537
  setpointType;
511
- serialize() {
538
+ serialize(ctx) {
512
539
  this.payload = Buffer.from([this.setpointType & 0b1111]);
513
- return super.serialize();
540
+ return super.serialize(ctx);
514
541
  }
515
- toLogEntry(host) {
542
+ toLogEntry(ctx) {
516
543
  return {
517
- ...super.toLogEntry(host),
544
+ ...super.toLogEntry(ctx),
518
545
  message: {
519
546
  "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.setpointType),
520
547
  },
@@ -526,60 +553,54 @@ exports.HumidityControlSetpointCCScaleSupportedGet = HumidityControlSetpointCCSc
526
553
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.ScaleSupportedGet),
527
554
  (0, CommandClassDecorators_1.expectedCCResponse)(HumidityControlSetpointCCScaleSupportedReport)
528
555
  ], HumidityControlSetpointCCScaleSupportedGet);
529
- let HumidityControlSetpointCCCapabilitiesReport = class HumidityControlSetpointCCCapabilitiesReport extends HumidityControlSetpointCC {
530
- constructor(host, options) {
531
- super(host, options);
532
- (0, safe_1.validatePayload)(this.payload.length >= 1);
533
- this._type = this.payload[0] & 0b1111;
534
- let bytesRead;
556
+ let HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport_1 = class HumidityControlSetpointCCCapabilitiesReport extends HumidityControlSetpointCC {
557
+ constructor(options) {
558
+ super(options);
559
+ this.type = options.type;
560
+ this.minValue = options.minValue;
561
+ this.maxValue = options.maxValue;
562
+ this.minValueScale = options.minValueScale;
563
+ this.maxValueScale = options.maxValueScale;
564
+ }
565
+ static from(raw, ctx) {
566
+ (0, safe_1.validatePayload)(raw.payload.length >= 1);
567
+ const type = raw.payload[0] & 0b1111;
535
568
  // parseFloatWithScale does its own validation
536
- ({
537
- value: this._minValue,
538
- scale: this._minValueScale,
539
- bytesRead,
540
- } = (0, safe_1.parseFloatWithScale)(this.payload.subarray(1)));
541
- ({ value: this._maxValue, scale: this._maxValueScale } =
542
- (0, safe_1.parseFloatWithScale)(this.payload.subarray(1 + bytesRead)));
543
- }
544
- persistValues(applHost) {
545
- if (!super.persistValues(applHost))
569
+ const { value: minValue, scale: minValueScale, bytesRead, } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1));
570
+ const { value: maxValue, scale: maxValueScale } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1 + bytesRead));
571
+ return new HumidityControlSetpointCCCapabilitiesReport_1({
572
+ nodeId: ctx.sourceNodeId,
573
+ type,
574
+ minValue,
575
+ minValueScale,
576
+ maxValue,
577
+ maxValueScale,
578
+ });
579
+ }
580
+ persistValues(ctx) {
581
+ if (!super.persistValues(ctx))
546
582
  return false;
547
583
  // Predefine the metadata
548
584
  const setpointValue = exports.HumidityControlSetpointCCValues.setpoint(this.type);
549
- this.setMetadata(applHost, setpointValue, {
585
+ this.setMetadata(ctx, setpointValue, {
550
586
  ...setpointValue.meta,
551
- min: this._minValue,
552
- max: this._maxValue,
553
- unit: getSetpointUnit(this._minValueScale)
554
- || getSetpointUnit(this._maxValueScale),
587
+ min: this.minValue,
588
+ max: this.maxValue,
589
+ unit: getSetpointUnit(this.minValueScale)
590
+ || getSetpointUnit(this.maxValueScale),
555
591
  });
556
592
  return true;
557
593
  }
558
- _type;
559
- get type() {
560
- return this._type;
561
- }
562
- _minValue;
563
- get minValue() {
564
- return this._minValue;
565
- }
566
- _maxValue;
567
- get maxValue() {
568
- return this._maxValue;
569
- }
570
- _minValueScale;
571
- get minValueScale() {
572
- return this._minValueScale;
573
- }
574
- _maxValueScale;
575
- get maxValueScale() {
576
- return this._maxValueScale;
577
- }
578
- toLogEntry(host) {
594
+ type;
595
+ minValue;
596
+ maxValue;
597
+ minValueScale;
598
+ maxValueScale;
599
+ toLogEntry(ctx) {
579
600
  const minValueScale = getScale(this.minValueScale);
580
601
  const maxValueScale = getScale(this.maxValueScale);
581
602
  return {
582
- ...super.toLogEntry(host),
603
+ ...super.toLogEntry(ctx),
583
604
  message: {
584
605
  "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.type),
585
606
  "min value": `${this.minValue} ${minValueScale.unit}`,
@@ -589,28 +610,29 @@ let HumidityControlSetpointCCCapabilitiesReport = class HumidityControlSetpointC
589
610
  }
590
611
  };
591
612
  exports.HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport;
592
- exports.HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport = __decorate([
613
+ exports.HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport_1 = __decorate([
593
614
  (0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.CapabilitiesReport)
594
615
  ], HumidityControlSetpointCCCapabilitiesReport);
595
616
  let HumidityControlSetpointCCCapabilitiesGet = class HumidityControlSetpointCCCapabilitiesGet extends HumidityControlSetpointCC {
596
- constructor(host, options) {
597
- super(host, options);
598
- if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
599
- // TODO: Deserialize payload
600
- throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
601
- }
602
- else {
603
- this.setpointType = options.setpointType;
604
- }
617
+ constructor(options) {
618
+ super(options);
619
+ this.setpointType = options.setpointType;
620
+ }
621
+ static from(_raw, _ctx) {
622
+ // TODO: Deserialize payload
623
+ throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
624
+ // return new HumidityControlSetpointCCCapabilitiesGet({
625
+ // nodeId: ctx.sourceNodeId,
626
+ // });
605
627
  }
606
628
  setpointType;
607
- serialize() {
629
+ serialize(ctx) {
608
630
  this.payload = Buffer.from([this.setpointType & 0b1111]);
609
- return super.serialize();
631
+ return super.serialize(ctx);
610
632
  }
611
- toLogEntry(host) {
633
+ toLogEntry(ctx) {
612
634
  return {
613
- ...super.toLogEntry(host),
635
+ ...super.toLogEntry(ctx),
614
636
  message: {
615
637
  "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.setpointType),
616
638
  },