@zwave-js/cc 9.3.1-0-pr-4662-79458fb

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 (297) hide show
  1. package/build/cc/AlarmSensorCC.d.ts +54 -0
  2. package/build/cc/AlarmSensorCC.d.ts.map +1 -0
  3. package/build/cc/AlarmSensorCC.js +378 -0
  4. package/build/cc/AlarmSensorCC.js.map +1 -0
  5. package/build/cc/AssociationCC.d.ts +123 -0
  6. package/build/cc/AssociationCC.d.ts.map +1 -0
  7. package/build/cc/AssociationCC.js +615 -0
  8. package/build/cc/AssociationCC.js.map +1 -0
  9. package/build/cc/AssociationGroupInfoCC.d.ts +97 -0
  10. package/build/cc/AssociationGroupInfoCC.d.ts.map +1 -0
  11. package/build/cc/AssociationGroupInfoCC.js +530 -0
  12. package/build/cc/AssociationGroupInfoCC.js.map +1 -0
  13. package/build/cc/BarrierOperatorCC.d.ts +75 -0
  14. package/build/cc/BarrierOperatorCC.d.ts.map +1 -0
  15. package/build/cc/BarrierOperatorCC.js +492 -0
  16. package/build/cc/BarrierOperatorCC.js.map +1 -0
  17. package/build/cc/BasicCC.d.ts +51 -0
  18. package/build/cc/BasicCC.d.ts.map +1 -0
  19. package/build/cc/BasicCC.js +344 -0
  20. package/build/cc/BasicCC.js.map +1 -0
  21. package/build/cc/BatteryCC.d.ts +56 -0
  22. package/build/cc/BatteryCC.d.ts.map +1 -0
  23. package/build/cc/BatteryCC.js +417 -0
  24. package/build/cc/BatteryCC.js.map +1 -0
  25. package/build/cc/BinarySensorCC.d.ts +52 -0
  26. package/build/cc/BinarySensorCC.d.ts.map +1 -0
  27. package/build/cc/BinarySensorCC.js +321 -0
  28. package/build/cc/BinarySensorCC.js.map +1 -0
  29. package/build/cc/BinarySwitchCC.d.ts +55 -0
  30. package/build/cc/BinarySwitchCC.d.ts.map +1 -0
  31. package/build/cc/BinarySwitchCC.js +327 -0
  32. package/build/cc/BinarySwitchCC.js.map +1 -0
  33. package/build/cc/CRC16CC.d.ts +28 -0
  34. package/build/cc/CRC16CC.d.ts.map +1 -0
  35. package/build/cc/CRC16CC.js +109 -0
  36. package/build/cc/CRC16CC.js.map +1 -0
  37. package/build/cc/CentralSceneCC.d.ts +69 -0
  38. package/build/cc/CentralSceneCC.d.ts.map +1 -0
  39. package/build/cc/CentralSceneCC.js +443 -0
  40. package/build/cc/CentralSceneCC.js.map +1 -0
  41. package/build/cc/ClimateControlScheduleCC.d.ts +78 -0
  42. package/build/cc/ClimateControlScheduleCC.d.ts.map +1 -0
  43. package/build/cc/ClimateControlScheduleCC.js +417 -0
  44. package/build/cc/ClimateControlScheduleCC.js.map +1 -0
  45. package/build/cc/ClockCC.d.ts +40 -0
  46. package/build/cc/ClockCC.d.ts.map +1 -0
  47. package/build/cc/ClockCC.js +185 -0
  48. package/build/cc/ClockCC.js.map +1 -0
  49. package/build/cc/ColorSwitchCC.d.ts +98 -0
  50. package/build/cc/ColorSwitchCC.d.ts.map +1 -0
  51. package/build/cc/ColorSwitchCC.js +1045 -0
  52. package/build/cc/ColorSwitchCC.js.map +1 -0
  53. package/build/cc/ConfigurationCC.d.ts +315 -0
  54. package/build/cc/ConfigurationCC.d.ts.map +1 -0
  55. package/build/cc/ConfigurationCC.js +2257 -0
  56. package/build/cc/ConfigurationCC.js.map +1 -0
  57. package/build/cc/DeviceResetLocallyCC.d.ts +9 -0
  58. package/build/cc/DeviceResetLocallyCC.d.ts.map +1 -0
  59. package/build/cc/DeviceResetLocallyCC.js +28 -0
  60. package/build/cc/DeviceResetLocallyCC.js.map +1 -0
  61. package/build/cc/DoorLockCC.d.ts +116 -0
  62. package/build/cc/DoorLockCC.d.ts.map +1 -0
  63. package/build/cc/DoorLockCC.js +1112 -0
  64. package/build/cc/DoorLockCC.js.map +1 -0
  65. package/build/cc/DoorLockLoggingCC.d.ts +41 -0
  66. package/build/cc/DoorLockLoggingCC.d.ts.map +1 -0
  67. package/build/cc/DoorLockLoggingCC.js +288 -0
  68. package/build/cc/DoorLockLoggingCC.js.map +1 -0
  69. package/build/cc/EntryControlCC.d.ts +71 -0
  70. package/build/cc/EntryControlCC.d.ts.map +1 -0
  71. package/build/cc/EntryControlCC.js +492 -0
  72. package/build/cc/EntryControlCC.js.map +1 -0
  73. package/build/cc/FirmwareUpdateMetaDataCC.d.ts +148 -0
  74. package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -0
  75. package/build/cc/FirmwareUpdateMetaDataCC.js +727 -0
  76. package/build/cc/FirmwareUpdateMetaDataCC.js.map +1 -0
  77. package/build/cc/HailCC.d.ts +6 -0
  78. package/build/cc/HailCC.d.ts.map +1 -0
  79. package/build/cc/HailCC.js +23 -0
  80. package/build/cc/HailCC.js.map +1 -0
  81. package/build/cc/HumidityControlModeCC.d.ts +47 -0
  82. package/build/cc/HumidityControlModeCC.d.ts.map +1 -0
  83. package/build/cc/HumidityControlModeCC.js +288 -0
  84. package/build/cc/HumidityControlModeCC.js.map +1 -0
  85. package/build/cc/HumidityControlOperatingStateCC.d.ts +24 -0
  86. package/build/cc/HumidityControlOperatingStateCC.d.ts.map +1 -0
  87. package/build/cc/HumidityControlOperatingStateCC.js +129 -0
  88. package/build/cc/HumidityControlOperatingStateCC.js.map +1 -0
  89. package/build/cc/HumidityControlSetpointCC.d.ts +103 -0
  90. package/build/cc/HumidityControlSetpointCC.d.ts.map +1 -0
  91. package/build/cc/HumidityControlSetpointCC.js +626 -0
  92. package/build/cc/HumidityControlSetpointCC.js.map +1 -0
  93. package/build/cc/IndicatorCC.d.ts +88 -0
  94. package/build/cc/IndicatorCC.d.ts.map +1 -0
  95. package/build/cc/IndicatorCC.js +758 -0
  96. package/build/cc/IndicatorCC.js.map +1 -0
  97. package/build/cc/IrrigationCC.d.ts +278 -0
  98. package/build/cc/IrrigationCC.d.ts.map +1 -0
  99. package/build/cc/IrrigationCC.js +2062 -0
  100. package/build/cc/IrrigationCC.js.map +1 -0
  101. package/build/cc/LanguageCC.d.ts +41 -0
  102. package/build/cc/LanguageCC.d.ts.map +1 -0
  103. package/build/cc/LanguageCC.js +220 -0
  104. package/build/cc/LanguageCC.js.map +1 -0
  105. package/build/cc/LockCC.d.ts +41 -0
  106. package/build/cc/LockCC.d.ts.map +1 -0
  107. package/build/cc/LockCC.js +185 -0
  108. package/build/cc/LockCC.js.map +1 -0
  109. package/build/cc/ManufacturerProprietaryCC.d.ts +31 -0
  110. package/build/cc/ManufacturerProprietaryCC.d.ts.map +1 -0
  111. package/build/cc/ManufacturerProprietaryCC.js +275 -0
  112. package/build/cc/ManufacturerProprietaryCC.js.map +1 -0
  113. package/build/cc/ManufacturerSpecificCC.d.ts +59 -0
  114. package/build/cc/ManufacturerSpecificCC.d.ts.map +1 -0
  115. package/build/cc/ManufacturerSpecificCC.js +285 -0
  116. package/build/cc/ManufacturerSpecificCC.js.map +1 -0
  117. package/build/cc/MeterCC.d.ts +100 -0
  118. package/build/cc/MeterCC.d.ts.map +1 -0
  119. package/build/cc/MeterCC.js +820 -0
  120. package/build/cc/MeterCC.js.map +1 -0
  121. package/build/cc/MultiChannelAssociationCC.d.ts +127 -0
  122. package/build/cc/MultiChannelAssociationCC.d.ts.map +1 -0
  123. package/build/cc/MultiChannelAssociationCC.js +883 -0
  124. package/build/cc/MultiChannelAssociationCC.js.map +1 -0
  125. package/build/cc/MultiChannelCC.d.ts +164 -0
  126. package/build/cc/MultiChannelCC.d.ts.map +1 -0
  127. package/build/cc/MultiChannelCC.js +1004 -0
  128. package/build/cc/MultiChannelCC.js.map +1 -0
  129. package/build/cc/MultiCommandCC.d.ts +28 -0
  130. package/build/cc/MultiCommandCC.d.ts.map +1 -0
  131. package/build/cc/MultiCommandCC.js +137 -0
  132. package/build/cc/MultiCommandCC.js.map +1 -0
  133. package/build/cc/MultilevelSensorCC.d.ts +83 -0
  134. package/build/cc/MultilevelSensorCC.d.ts.map +1 -0
  135. package/build/cc/MultilevelSensorCC.js +633 -0
  136. package/build/cc/MultilevelSensorCC.js.map +1 -0
  137. package/build/cc/MultilevelSwitchCC.d.ts +86 -0
  138. package/build/cc/MultilevelSwitchCC.d.ts.map +1 -0
  139. package/build/cc/MultilevelSwitchCC.js +774 -0
  140. package/build/cc/MultilevelSwitchCC.js.map +1 -0
  141. package/build/cc/NoOperationCC.d.ts +17 -0
  142. package/build/cc/NoOperationCC.d.ts.map +1 -0
  143. package/build/cc/NoOperationCC.js +50 -0
  144. package/build/cc/NoOperationCC.js.map +1 -0
  145. package/build/cc/NodeNamingCC.d.ts +57 -0
  146. package/build/cc/NodeNamingCC.d.ts.map +1 -0
  147. package/build/cc/NodeNamingCC.js +313 -0
  148. package/build/cc/NodeNamingCC.js.map +1 -0
  149. package/build/cc/NotificationCC.d.ts +127 -0
  150. package/build/cc/NotificationCC.d.ts.map +1 -0
  151. package/build/cc/NotificationCC.js +1193 -0
  152. package/build/cc/NotificationCC.js.map +1 -0
  153. package/build/cc/PowerlevelCC.d.ts +63 -0
  154. package/build/cc/PowerlevelCC.d.ts.map +1 -0
  155. package/build/cc/PowerlevelCC.js +262 -0
  156. package/build/cc/PowerlevelCC.js.map +1 -0
  157. package/build/cc/ProtectionCC.d.ts +94 -0
  158. package/build/cc/ProtectionCC.d.ts.map +1 -0
  159. package/build/cc/ProtectionCC.js +630 -0
  160. package/build/cc/ProtectionCC.js.map +1 -0
  161. package/build/cc/SceneActivationCC.d.ts +34 -0
  162. package/build/cc/SceneActivationCC.d.ts.map +1 -0
  163. package/build/cc/SceneActivationCC.js +170 -0
  164. package/build/cc/SceneActivationCC.js.map +1 -0
  165. package/build/cc/SceneActuatorConfigurationCC.d.ts +52 -0
  166. package/build/cc/SceneActuatorConfigurationCC.d.ts.map +1 -0
  167. package/build/cc/SceneActuatorConfigurationCC.js +368 -0
  168. package/build/cc/SceneActuatorConfigurationCC.js.map +1 -0
  169. package/build/cc/SceneControllerConfigurationCC.d.ts +61 -0
  170. package/build/cc/SceneControllerConfigurationCC.d.ts.map +1 -0
  171. package/build/cc/SceneControllerConfigurationCC.js +444 -0
  172. package/build/cc/SceneControllerConfigurationCC.js.map +1 -0
  173. package/build/cc/Security2CC.d.ts +213 -0
  174. package/build/cc/Security2CC.d.ts.map +1 -0
  175. package/build/cc/Security2CC.js +1124 -0
  176. package/build/cc/Security2CC.js.map +1 -0
  177. package/build/cc/SecurityCC.d.ts +109 -0
  178. package/build/cc/SecurityCC.d.ts.map +1 -0
  179. package/build/cc/SecurityCC.js +609 -0
  180. package/build/cc/SecurityCC.js.map +1 -0
  181. package/build/cc/SoundSwitchCC.d.ts +87 -0
  182. package/build/cc/SoundSwitchCC.d.ts.map +1 -0
  183. package/build/cc/SoundSwitchCC.js +548 -0
  184. package/build/cc/SoundSwitchCC.js.map +1 -0
  185. package/build/cc/SupervisionCC.d.ts +63 -0
  186. package/build/cc/SupervisionCC.d.ts.map +1 -0
  187. package/build/cc/SupervisionCC.js +239 -0
  188. package/build/cc/SupervisionCC.js.map +1 -0
  189. package/build/cc/ThermostatFanModeCC.d.ts +53 -0
  190. package/build/cc/ThermostatFanModeCC.d.ts.map +1 -0
  191. package/build/cc/ThermostatFanModeCC.js +359 -0
  192. package/build/cc/ThermostatFanModeCC.js.map +1 -0
  193. package/build/cc/ThermostatFanStateCC.d.ts +24 -0
  194. package/build/cc/ThermostatFanStateCC.d.ts.map +1 -0
  195. package/build/cc/ThermostatFanStateCC.js +131 -0
  196. package/build/cc/ThermostatFanStateCC.js.map +1 -0
  197. package/build/cc/ThermostatModeCC.d.ts +58 -0
  198. package/build/cc/ThermostatModeCC.d.ts.map +1 -0
  199. package/build/cc/ThermostatModeCC.js +370 -0
  200. package/build/cc/ThermostatModeCC.js.map +1 -0
  201. package/build/cc/ThermostatOperatingStateCC.d.ts +24 -0
  202. package/build/cc/ThermostatOperatingStateCC.d.ts.map +1 -0
  203. package/build/cc/ThermostatOperatingStateCC.js +127 -0
  204. package/build/cc/ThermostatOperatingStateCC.js.map +1 -0
  205. package/build/cc/ThermostatSetbackCC.d.ts +42 -0
  206. package/build/cc/ThermostatSetbackCC.d.ts.map +1 -0
  207. package/build/cc/ThermostatSetbackCC.js +237 -0
  208. package/build/cc/ThermostatSetbackCC.js.map +1 -0
  209. package/build/cc/ThermostatSetpointCC.d.ts +98 -0
  210. package/build/cc/ThermostatSetpointCC.d.ts.map +1 -0
  211. package/build/cc/ThermostatSetpointCC.js +707 -0
  212. package/build/cc/ThermostatSetpointCC.js.map +1 -0
  213. package/build/cc/TimeCC.d.ts +78 -0
  214. package/build/cc/TimeCC.d.ts.map +1 -0
  215. package/build/cc/TimeCC.js +373 -0
  216. package/build/cc/TimeCC.js.map +1 -0
  217. package/build/cc/TimeParametersCC.d.ts +40 -0
  218. package/build/cc/TimeParametersCC.d.ts.map +1 -0
  219. package/build/cc/TimeParametersCC.js +275 -0
  220. package/build/cc/TimeParametersCC.js.map +1 -0
  221. package/build/cc/TransportServiceCC.d.ts +101 -0
  222. package/build/cc/TransportServiceCC.d.ts.map +1 -0
  223. package/build/cc/TransportServiceCC.js +404 -0
  224. package/build/cc/TransportServiceCC.js.map +1 -0
  225. package/build/cc/UserCodeCC.d.ts +219 -0
  226. package/build/cc/UserCodeCC.d.ts.map +1 -0
  227. package/build/cc/UserCodeCC.js +1526 -0
  228. package/build/cc/UserCodeCC.js.map +1 -0
  229. package/build/cc/VersionCC.d.ts +91 -0
  230. package/build/cc/VersionCC.d.ts.map +1 -0
  231. package/build/cc/VersionCC.js +654 -0
  232. package/build/cc/VersionCC.js.map +1 -0
  233. package/build/cc/WakeUpCC.d.ts +67 -0
  234. package/build/cc/WakeUpCC.d.ts.map +1 -0
  235. package/build/cc/WakeUpCC.js +425 -0
  236. package/build/cc/WakeUpCC.js.map +1 -0
  237. package/build/cc/ZWavePlusCC.d.ts +40 -0
  238. package/build/cc/ZWavePlusCC.d.ts.map +1 -0
  239. package/build/cc/ZWavePlusCC.js +269 -0
  240. package/build/cc/ZWavePlusCC.js.map +1 -0
  241. package/build/cc/index.d.ts +64 -0
  242. package/build/cc/index.d.ts.map +1 -0
  243. package/build/cc/index.js +496 -0
  244. package/build/cc/index.js.map +1 -0
  245. package/build/cc/manufacturerProprietary/FibaroCC.d.ts +62 -0
  246. package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -0
  247. package/build/cc/manufacturerProprietary/FibaroCC.js +247 -0
  248. package/build/cc/manufacturerProprietary/FibaroCC.js.map +1 -0
  249. package/build/index.d.ts +11 -0
  250. package/build/index.d.ts.map +1 -0
  251. package/build/index.js +48 -0
  252. package/build/index.js.map +1 -0
  253. package/build/index_safe.d.ts +4 -0
  254. package/build/index_safe.d.ts.map +1 -0
  255. package/build/index_safe.js +30 -0
  256. package/build/index_safe.js.map +1 -0
  257. package/build/lib/API.d.ts +176 -0
  258. package/build/lib/API.d.ts.map +1 -0
  259. package/build/lib/API.js +325 -0
  260. package/build/lib/API.js.map +1 -0
  261. package/build/lib/CommandClass.d.ts +341 -0
  262. package/build/lib/CommandClass.d.ts.map +1 -0
  263. package/build/lib/CommandClass.js +1088 -0
  264. package/build/lib/CommandClass.js.map +1 -0
  265. package/build/lib/EncapsulatingCommandClass.d.ts +35 -0
  266. package/build/lib/EncapsulatingCommandClass.d.ts.map +1 -0
  267. package/build/lib/EncapsulatingCommandClass.js +53 -0
  268. package/build/lib/EncapsulatingCommandClass.js.map +1 -0
  269. package/build/lib/ICommandClassContainer.d.ts +9 -0
  270. package/build/lib/ICommandClassContainer.d.ts.map +1 -0
  271. package/build/lib/ICommandClassContainer.js +12 -0
  272. package/build/lib/ICommandClassContainer.js.map +1 -0
  273. package/build/lib/NotificationEventPayload.d.ts +11 -0
  274. package/build/lib/NotificationEventPayload.d.ts.map +1 -0
  275. package/build/lib/NotificationEventPayload.js +11 -0
  276. package/build/lib/NotificationEventPayload.js.map +1 -0
  277. package/build/lib/Security2/Extension.d.ts +87 -0
  278. package/build/lib/Security2/Extension.d.ts.map +1 -0
  279. package/build/lib/Security2/Extension.js +235 -0
  280. package/build/lib/Security2/Extension.js.map +1 -0
  281. package/build/lib/Security2/shared.d.ts +31 -0
  282. package/build/lib/Security2/shared.d.ts.map +1 -0
  283. package/build/lib/Security2/shared.js +37 -0
  284. package/build/lib/Security2/shared.js.map +1 -0
  285. package/build/lib/_Types.d.ts +1446 -0
  286. package/build/lib/_Types.d.ts.map +1 -0
  287. package/build/lib/_Types.js +1334 -0
  288. package/build/lib/_Types.js.map +1 -0
  289. package/build/lib/serializers.d.ts +24 -0
  290. package/build/lib/serializers.d.ts.map +1 -0
  291. package/build/lib/serializers.js +66 -0
  292. package/build/lib/serializers.js.map +1 -0
  293. package/build/lib/utils.d.ts +13 -0
  294. package/build/lib/utils.d.ts.map +1 -0
  295. package/build/lib/utils.js +675 -0
  296. package/build/lib/utils.js.map +1 -0
  297. package/package.json +77 -0
@@ -0,0 +1,707 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var _a, _b;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ThermostatSetpointCCSupportedGet = exports.ThermostatSetpointCCSupportedReport = exports.ThermostatSetpointCCCapabilitiesGet = exports.ThermostatSetpointCCCapabilitiesReport = exports.ThermostatSetpointCCGet = exports.ThermostatSetpointCCReport = exports.ThermostatSetpointCCSet = exports.ThermostatSetpointCC = exports.ThermostatSetpointCCAPI = void 0;
11
+ function __assertType(argName, typeName, boundHasError) {
12
+ const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
13
+ if (boundHasError()) {
14
+ throw new ZWaveError(typeName ? `${argName} is not a ${typeName}` : `${argName} has the wrong type`, ZWaveErrorCodes.Argument_Invalid);
15
+ }
16
+ }
17
+ const __assertType__number = $o => {
18
+ function _number($o) {
19
+ return typeof $o !== "number" ? {} : null;
20
+ }
21
+ return _number($o);
22
+ };
23
+ const safe_1 = require("@zwave-js/core/safe");
24
+ const safe_2 = require("@zwave-js/shared/safe");
25
+ const API_1 = require("../lib/API");
26
+ const CommandClass_1 = require("../lib/CommandClass");
27
+ const _Types_1 = require("../lib/_Types");
28
+ // This array is used to map the advertised supported types (interpretation A)
29
+ // to the actual enum values
30
+ // prettier-ignore
31
+ const thermostatSetpointTypeMap = [0x00, 0x01, 0x02, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f];
32
+ const thermostatSetpointScaleName = "temperature";
33
+ function getScale(configManager, scale) {
34
+ return configManager.lookupNamedScale(thermostatSetpointScaleName, scale);
35
+ }
36
+ function getSetpointUnit(configManager, scale) {
37
+ var _c;
38
+ return (_c = getScale(configManager, scale).unit) !== null && _c !== void 0 ? _c : "";
39
+ }
40
+ function getSupportedSetpointTypesValueID(endpoint) {
41
+ return {
42
+ commandClass: safe_1.CommandClasses["Thermostat Setpoint"],
43
+ property: "supportedSetpointTypes",
44
+ endpoint,
45
+ };
46
+ }
47
+ function getSetpointTypesInterpretationValueID(endpoint) {
48
+ return {
49
+ commandClass: safe_1.CommandClasses["Thermostat Setpoint"],
50
+ property: "setpointTypesInterpretation",
51
+ endpoint,
52
+ };
53
+ }
54
+ function getSetpointValueID(endpoint, setpointType) {
55
+ return {
56
+ commandClass: safe_1.CommandClasses["Thermostat Setpoint"],
57
+ endpoint,
58
+ property: "setpoint",
59
+ propertyKey: setpointType,
60
+ };
61
+ }
62
+ function getSetpointScaleValueID(endpoint, setpointType) {
63
+ return {
64
+ commandClass: safe_1.CommandClasses["Thermostat Setpoint"],
65
+ endpoint,
66
+ property: "setpointScale",
67
+ propertyKey: setpointType,
68
+ };
69
+ }
70
+ let ThermostatSetpointCCAPI = class ThermostatSetpointCCAPI extends API_1.CCAPI {
71
+ constructor() {
72
+ super(...arguments);
73
+ this[_a] = async ({ property, propertyKey }, value) => {
74
+ var _c;
75
+ if (property !== "setpoint") {
76
+ (0, API_1.throwUnsupportedProperty)(this.ccId, property);
77
+ }
78
+ if (typeof propertyKey !== "number") {
79
+ throw new safe_1.ZWaveError(`${safe_1.CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, safe_1.ZWaveErrorCodes.Argument_Invalid);
80
+ }
81
+ if (typeof value !== "number") {
82
+ (0, API_1.throwWrongValueType)(this.ccId, property, "number", typeof value);
83
+ }
84
+ // SDS14223: The Scale field value MUST be identical to the value received in the Thermostat Setpoint Report for the
85
+ // actual Setpoint Type during the node interview. Fall back to the first scale if none is known
86
+ const preferredScale = (_c = this.tryGetValueDB()) === null || _c === void 0 ? void 0 : _c.getValue(getSetpointScaleValueID(this.endpoint.index, propertyKey));
87
+ await this.set(propertyKey, value, preferredScale !== null && preferredScale !== void 0 ? preferredScale : 0);
88
+ if (this.isSinglecast()) {
89
+ // Verify the current value after a delay
90
+ // TODO: Ideally this would be a short delay, but some thermostats like Remotec ZXT-600
91
+ // aren't able to handle the GET this quickly.
92
+ this.schedulePoll({ property, propertyKey }, value);
93
+ }
94
+ };
95
+ this[_b] = async ({ property, propertyKey, }) => {
96
+ var _c;
97
+ switch (property) {
98
+ case "setpoint":
99
+ if (typeof propertyKey !== "number") {
100
+ throw new safe_1.ZWaveError(`${safe_1.CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, safe_1.ZWaveErrorCodes.Argument_Invalid);
101
+ }
102
+ return (_c = (await this.get(propertyKey))) === null || _c === void 0 ? void 0 : _c.value;
103
+ default:
104
+ (0, API_1.throwUnsupportedProperty)(this.ccId, property);
105
+ }
106
+ };
107
+ }
108
+ supportsCommand(cmd) {
109
+ switch (cmd) {
110
+ case _Types_1.ThermostatSetpointCommand.Get:
111
+ case _Types_1.ThermostatSetpointCommand.SupportedGet:
112
+ return this.isSinglecast();
113
+ case _Types_1.ThermostatSetpointCommand.Set:
114
+ return true; // This is mandatory
115
+ case _Types_1.ThermostatSetpointCommand.CapabilitiesGet:
116
+ return this.version >= 3 && this.isSinglecast();
117
+ }
118
+ return super.supportsCommand(cmd);
119
+ }
120
+ async get(setpointType) {
121
+ __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
122
+ this.assertSupportsCommand(_Types_1.ThermostatSetpointCommand, _Types_1.ThermostatSetpointCommand.Get);
123
+ const cc = new ThermostatSetpointCCGet(this.applHost, {
124
+ nodeId: this.endpoint.nodeId,
125
+ endpoint: this.endpoint.index,
126
+ setpointType,
127
+ });
128
+ const response = await this.applHost.sendCommand(cc, this.commandOptions);
129
+ if (!response)
130
+ return;
131
+ if (response.type !== _Types_1.ThermostatSetpointType["N/A"]) {
132
+ // This is a supported setpoint
133
+ const scale = getScale(this.applHost.configManager, response.scale);
134
+ return {
135
+ value: response.value,
136
+ scale,
137
+ };
138
+ }
139
+ }
140
+ async set(setpointType, value, scale) {
141
+ __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
142
+ __assertType("value", "number", __assertType__number.bind(void 0, value));
143
+ __assertType("scale", "number", __assertType__number.bind(void 0, scale));
144
+ this.assertSupportsCommand(_Types_1.ThermostatSetpointCommand, _Types_1.ThermostatSetpointCommand.Set);
145
+ const cc = new ThermostatSetpointCCSet(this.applHost, {
146
+ nodeId: this.endpoint.nodeId,
147
+ endpoint: this.endpoint.index,
148
+ setpointType,
149
+ value,
150
+ scale,
151
+ });
152
+ await this.applHost.sendCommand(cc, this.commandOptions);
153
+ }
154
+ async getCapabilities(setpointType) {
155
+ __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
156
+ this.assertSupportsCommand(_Types_1.ThermostatSetpointCommand, _Types_1.ThermostatSetpointCommand.CapabilitiesGet);
157
+ const cc = new ThermostatSetpointCCCapabilitiesGet(this.applHost, {
158
+ nodeId: this.endpoint.nodeId,
159
+ endpoint: this.endpoint.index,
160
+ setpointType,
161
+ });
162
+ const response = await this.applHost.sendCommand(cc, this.commandOptions);
163
+ if (response) {
164
+ return (0, safe_2.pick)(response, [
165
+ "minValue",
166
+ "maxValue",
167
+ "minValueScale",
168
+ "maxValueScale",
169
+ ]);
170
+ }
171
+ }
172
+ /**
173
+ * Requests the supported setpoint types from the node. Due to inconsistencies it is NOT recommended
174
+ * to use this method on nodes with CC versions 1 and 2. Instead rely on the information determined
175
+ * during node interview.
176
+ */
177
+ async getSupportedSetpointTypes() {
178
+ this.assertSupportsCommand(_Types_1.ThermostatSetpointCommand, _Types_1.ThermostatSetpointCommand.SupportedGet);
179
+ const cc = new ThermostatSetpointCCSupportedGet(this.applHost, {
180
+ nodeId: this.endpoint.nodeId,
181
+ endpoint: this.endpoint.index,
182
+ });
183
+ const response = await this.applHost.sendCommand(cc, this.commandOptions);
184
+ return response === null || response === void 0 ? void 0 : response.supportedSetpointTypes;
185
+ }
186
+ };
187
+ _a = API_1.SET_VALUE, _b = API_1.POLL_VALUE;
188
+ ThermostatSetpointCCAPI = __decorate([
189
+ (0, CommandClass_1.API)(safe_1.CommandClasses["Thermostat Setpoint"])
190
+ ], ThermostatSetpointCCAPI);
191
+ exports.ThermostatSetpointCCAPI = ThermostatSetpointCCAPI;
192
+ let ThermostatSetpointCC = class ThermostatSetpointCC extends CommandClass_1.CommandClass {
193
+ constructor(host, options) {
194
+ super(host, options);
195
+ this.registerValue(getSetpointTypesInterpretationValueID(0).property, {
196
+ internal: true,
197
+ });
198
+ // The setpoint scale is only used internally
199
+ this.registerValue(getSetpointScaleValueID(0, 0).property, {
200
+ internal: true,
201
+ });
202
+ }
203
+ translatePropertyKey(applHost, property, propertyKey) {
204
+ if (property === "setpoint") {
205
+ return (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, propertyKey);
206
+ }
207
+ else {
208
+ return super.translatePropertyKey(applHost, property, propertyKey);
209
+ }
210
+ }
211
+ async interview(applHost) {
212
+ var _c;
213
+ const node = this.getNode(applHost);
214
+ const endpoint = this.getEndpoint(applHost);
215
+ const api = API_1.CCAPI.create(safe_1.CommandClasses["Thermostat Setpoint"], applHost, endpoint).withOptions({
216
+ priority: safe_1.MessagePriority.NodeQuery,
217
+ });
218
+ const valueDB = this.getValueDB(applHost);
219
+ applHost.controllerLog.logNode(node.id, {
220
+ endpoint: this.endpointIndex,
221
+ message: `Interviewing ${this.ccName}...`,
222
+ direction: "none",
223
+ });
224
+ if (this.version <= 2) {
225
+ let setpointTypes;
226
+ let interpretation;
227
+ // Whether our tests changed the assumed bitmask interpretation
228
+ let interpretationChanged = false;
229
+ const supportedSetpointTypesValueId = getSupportedSetpointTypesValueID(this.endpointIndex);
230
+ // Query the supported setpoint types
231
+ applHost.controllerLog.logNode(node.id, {
232
+ endpoint: this.endpointIndex,
233
+ message: "retrieving supported setpoint types...",
234
+ direction: "outbound",
235
+ });
236
+ const resp = await api.getSupportedSetpointTypes();
237
+ if (!resp) {
238
+ applHost.controllerLog.logNode(node.id, {
239
+ endpoint: this.endpointIndex,
240
+ message: "Querying supported setpoint types timed out, skipping interview...",
241
+ level: "warn",
242
+ });
243
+ return;
244
+ }
245
+ setpointTypes = [...resp];
246
+ interpretation = undefined; // we don't know yet which interpretation the device uses
247
+ // If necessary, test which interpretation the device follows
248
+ // Assume interpretation B
249
+ // --> If setpoints 3,4,5 or 6 are supported, the assumption is wrong ==> A
250
+ function switchToInterpretationA() {
251
+ setpointTypes = setpointTypes.map((i) => thermostatSetpointTypeMap[i]);
252
+ interpretation = "A";
253
+ interpretationChanged = true;
254
+ }
255
+ if ([3, 4, 5, 6].some((type) => setpointTypes.includes(type))) {
256
+ applHost.controllerLog.logNode(node.id, {
257
+ endpoint: this.endpointIndex,
258
+ message: "uses Thermostat Setpoint bitmap interpretation A",
259
+ direction: "none",
260
+ });
261
+ switchToInterpretationA();
262
+ }
263
+ else {
264
+ applHost.controllerLog.logNode(node.id, {
265
+ endpoint: this.endpointIndex,
266
+ message: "Thermostat Setpoint bitmap interpretation is unknown, assuming B for now",
267
+ direction: "none",
268
+ });
269
+ }
270
+ // Now scan all endpoints. Each type we received a value for gets marked as supported
271
+ const supportedSetpointTypes = [];
272
+ for (let i = 0; i < setpointTypes.length; i++) {
273
+ const type = setpointTypes[i];
274
+ const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type);
275
+ // Every time, query the current value
276
+ applHost.controllerLog.logNode(node.id, {
277
+ endpoint: this.endpointIndex,
278
+ message: `querying current value of setpoint ${setpointName}...`,
279
+ direction: "outbound",
280
+ });
281
+ const setpoint = await api.get(type);
282
+ // If the node did not respond, assume the setpoint type is not supported
283
+ let logMessage;
284
+ if (setpoint) {
285
+ // Setpoint supported, remember the type
286
+ supportedSetpointTypes.push(type);
287
+ logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${(_c = setpoint.scale.unit) !== null && _c !== void 0 ? _c : ""}`;
288
+ }
289
+ else if (!interpretation) {
290
+ // The setpoint type is not supported, switch to interpretation A
291
+ applHost.controllerLog.logNode(node.id, {
292
+ endpoint: this.endpointIndex,
293
+ message: `the setpoint type ${type} is unsupported, switching to interpretation A`,
294
+ direction: "none",
295
+ });
296
+ switchToInterpretationA();
297
+ // retry the current type and scan the remaining types as A
298
+ i--;
299
+ continue;
300
+ }
301
+ else {
302
+ // We're sure about the interpretation - this should not happen
303
+ logMessage = `Setpoint ${setpointName} is not supported`;
304
+ }
305
+ applHost.controllerLog.logNode(node.id, {
306
+ endpoint: this.endpointIndex,
307
+ message: logMessage,
308
+ direction: "inbound",
309
+ });
310
+ }
311
+ // If we made an assumption and did not switch to interpretation A,
312
+ // the device adheres to interpretation B
313
+ if (!interpretation && !interpretationChanged) {
314
+ // our assumption about interpretation B was correct
315
+ interpretation = "B";
316
+ interpretationChanged = true;
317
+ }
318
+ // Remember which setpoint types are actually supported, so we don't
319
+ // need to do this guesswork again
320
+ valueDB.setValue(supportedSetpointTypesValueId, supportedSetpointTypes);
321
+ // Also save the bitmap interpretation if we know it now
322
+ if (interpretationChanged) {
323
+ valueDB.setValue(getSetpointTypesInterpretationValueID(this.endpointIndex), interpretation);
324
+ }
325
+ }
326
+ else {
327
+ // Versions >= 3 adhere to bitmap interpretation A, so we can rely on getSupportedSetpointTypes
328
+ // Query the supported setpoint types
329
+ let setpointTypes = [];
330
+ applHost.controllerLog.logNode(node.id, {
331
+ endpoint: this.endpointIndex,
332
+ message: "retrieving supported setpoint types...",
333
+ direction: "outbound",
334
+ });
335
+ const resp = await api.getSupportedSetpointTypes();
336
+ if (resp) {
337
+ setpointTypes = [...resp];
338
+ const logMessage = "received supported setpoint types:\n" +
339
+ setpointTypes
340
+ .map((type) => (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type))
341
+ .map((name) => `· ${name}`)
342
+ .join("\n");
343
+ applHost.controllerLog.logNode(node.id, {
344
+ endpoint: this.endpointIndex,
345
+ message: logMessage,
346
+ direction: "inbound",
347
+ });
348
+ }
349
+ else {
350
+ applHost.controllerLog.logNode(node.id, {
351
+ endpoint: this.endpointIndex,
352
+ message: "Querying supported setpoint types timed out, skipping interview...",
353
+ level: "warn",
354
+ });
355
+ return;
356
+ }
357
+ for (const type of setpointTypes) {
358
+ const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type);
359
+ // Find out the capabilities of this setpoint
360
+ applHost.controllerLog.logNode(node.id, {
361
+ endpoint: this.endpointIndex,
362
+ message: `retrieving capabilities for setpoint ${setpointName}...`,
363
+ direction: "outbound",
364
+ });
365
+ const setpointCaps = await api.getCapabilities(type);
366
+ if (setpointCaps) {
367
+ const minValueUnit = getSetpointUnit(applHost.configManager, setpointCaps.minValueScale);
368
+ const maxValueUnit = getSetpointUnit(applHost.configManager, setpointCaps.maxValueScale);
369
+ const logMessage = `received capabilities for setpoint ${setpointName}:
370
+ minimum value: ${setpointCaps.minValue} ${minValueUnit}
371
+ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
372
+ applHost.controllerLog.logNode(node.id, {
373
+ endpoint: this.endpointIndex,
374
+ message: logMessage,
375
+ direction: "inbound",
376
+ });
377
+ }
378
+ }
379
+ // Query the current value for all setpoint types
380
+ await this.refreshValues(applHost);
381
+ }
382
+ // Remember that the interview is complete
383
+ this.setInterviewComplete(applHost, true);
384
+ }
385
+ async refreshValues(applHost) {
386
+ var _c, _d;
387
+ const node = this.getNode(applHost);
388
+ const endpoint = this.getEndpoint(applHost);
389
+ const api = API_1.CCAPI.create(safe_1.CommandClasses["Thermostat Setpoint"], applHost, endpoint).withOptions({
390
+ priority: safe_1.MessagePriority.NodeQuery,
391
+ });
392
+ const valueDB = this.getValueDB(applHost);
393
+ const setpointTypes = (_c = valueDB.getValue(getSupportedSetpointTypesValueID(this.endpointIndex))) !== null && _c !== void 0 ? _c : [];
394
+ // Query each setpoint's current value
395
+ for (const type of setpointTypes) {
396
+ const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type);
397
+ // Every time, query the current value
398
+ applHost.controllerLog.logNode(node.id, {
399
+ endpoint: this.endpointIndex,
400
+ message: `querying current value of setpoint ${setpointName}...`,
401
+ direction: "outbound",
402
+ });
403
+ const setpoint = await api.get(type);
404
+ if (setpoint) {
405
+ const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${(_d = setpoint.scale.unit) !== null && _d !== void 0 ? _d : ""}`;
406
+ applHost.controllerLog.logNode(node.id, {
407
+ endpoint: this.endpointIndex,
408
+ message: logMessage,
409
+ direction: "inbound",
410
+ });
411
+ }
412
+ }
413
+ }
414
+ };
415
+ ThermostatSetpointCC = __decorate([
416
+ (0, CommandClass_1.commandClass)(safe_1.CommandClasses["Thermostat Setpoint"]),
417
+ (0, CommandClass_1.implementedVersion)(3)
418
+ ], ThermostatSetpointCC);
419
+ exports.ThermostatSetpointCC = ThermostatSetpointCC;
420
+ let ThermostatSetpointCCSet = class ThermostatSetpointCCSet extends ThermostatSetpointCC {
421
+ constructor(host, options) {
422
+ super(host, options);
423
+ if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
424
+ // TODO: Deserialize payload
425
+ throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
426
+ }
427
+ else {
428
+ this.setpointType = options.setpointType;
429
+ this.value = options.value;
430
+ this.scale = options.scale;
431
+ }
432
+ }
433
+ serialize() {
434
+ var _c, _d, _e, _f;
435
+ // If a config file overwrites how the float should be encoded, use that information
436
+ const override = (_f = (_e = (_d = (_c = this.host).getDeviceConfig) === null || _d === void 0 ? void 0 : _d.call(_c, this.nodeId)) === null || _e === void 0 ? void 0 : _e.compat) === null || _f === void 0 ? void 0 : _f.overrideFloatEncoding;
437
+ this.payload = Buffer.concat([
438
+ Buffer.from([this.setpointType & 0b1111]),
439
+ (0, safe_1.encodeFloatWithScale)(this.value, this.scale, override),
440
+ ]);
441
+ return super.serialize();
442
+ }
443
+ toLogEntry(applHost) {
444
+ const scale = getScale(applHost.configManager, this.scale);
445
+ return {
446
+ ...super.toLogEntry(applHost),
447
+ message: {
448
+ "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.setpointType),
449
+ value: `${this.value} ${scale.unit}`,
450
+ },
451
+ };
452
+ }
453
+ };
454
+ ThermostatSetpointCCSet = __decorate([
455
+ (0, CommandClass_1.CCCommand)(_Types_1.ThermostatSetpointCommand.Set)
456
+ ], ThermostatSetpointCCSet);
457
+ exports.ThermostatSetpointCCSet = ThermostatSetpointCCSet;
458
+ let ThermostatSetpointCCReport = class ThermostatSetpointCCReport extends ThermostatSetpointCC {
459
+ constructor(host, options) {
460
+ super(host, options);
461
+ (0, safe_1.validatePayload)(this.payload.length >= 1);
462
+ this._type = this.payload[0] & 0b1111;
463
+ if (this._type === 0) {
464
+ // Not supported
465
+ this._value = 0;
466
+ this.scale = 0;
467
+ return;
468
+ }
469
+ // parseFloatWithScale does its own validation
470
+ const { value, scale } = (0, safe_1.parseFloatWithScale)(this.payload.slice(1));
471
+ this._value = value;
472
+ this.scale = scale;
473
+ }
474
+ persistValues(applHost) {
475
+ var _c;
476
+ if (!super.persistValues(applHost))
477
+ return false;
478
+ const scale = getScale(applHost.configManager, this.scale);
479
+ const valueDB = this.getValueDB(applHost);
480
+ const setpointValueId = getSetpointValueID(this.endpointIndex, this._type);
481
+ // Update the metadata when it is missing or the unit has changed
482
+ if (((_c = valueDB.getMetadata(setpointValueId)) === null || _c === void 0 ? void 0 : _c.unit) !== scale.unit) {
483
+ valueDB.setMetadata(setpointValueId, {
484
+ ...safe_1.ValueMetadata.Number,
485
+ unit: scale.unit,
486
+ ccSpecific: {
487
+ setpointType: this._type,
488
+ },
489
+ });
490
+ }
491
+ valueDB.setValue(setpointValueId, this._value);
492
+ // Remember the device-preferred setpoint scale so it can be used in SET commands
493
+ const scaleValueId = getSetpointScaleValueID(this.endpointIndex, this._type);
494
+ valueDB.setValue(scaleValueId, scale.key);
495
+ return true;
496
+ }
497
+ get type() {
498
+ return this._type;
499
+ }
500
+ get value() {
501
+ return this._value;
502
+ }
503
+ toLogEntry(applHost) {
504
+ const scale = getScale(applHost.configManager, this.scale);
505
+ return {
506
+ ...super.toLogEntry(applHost),
507
+ message: {
508
+ "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.type),
509
+ value: `${this.value} ${scale.unit}`,
510
+ },
511
+ };
512
+ }
513
+ };
514
+ ThermostatSetpointCCReport = __decorate([
515
+ (0, CommandClass_1.CCCommand)(_Types_1.ThermostatSetpointCommand.Report)
516
+ ], ThermostatSetpointCCReport);
517
+ exports.ThermostatSetpointCCReport = ThermostatSetpointCCReport;
518
+ function testResponseForThermostatSetpointGet(sent, received) {
519
+ // We expect a Thermostat Setpoint Report that matches the requested setpoint type
520
+ return received.type === sent.setpointType;
521
+ }
522
+ let ThermostatSetpointCCGet = class ThermostatSetpointCCGet extends ThermostatSetpointCC {
523
+ constructor(host, options) {
524
+ super(host, options);
525
+ if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
526
+ // TODO: Deserialize payload
527
+ throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
528
+ }
529
+ else {
530
+ this.setpointType = options.setpointType;
531
+ }
532
+ }
533
+ serialize() {
534
+ this.payload = Buffer.from([this.setpointType & 0b1111]);
535
+ return super.serialize();
536
+ }
537
+ toLogEntry(applHost) {
538
+ return {
539
+ ...super.toLogEntry(applHost),
540
+ message: {
541
+ "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.setpointType),
542
+ },
543
+ };
544
+ }
545
+ };
546
+ ThermostatSetpointCCGet = __decorate([
547
+ (0, CommandClass_1.CCCommand)(_Types_1.ThermostatSetpointCommand.Get),
548
+ (0, CommandClass_1.expectedCCResponse)(ThermostatSetpointCCReport, testResponseForThermostatSetpointGet)
549
+ ], ThermostatSetpointCCGet);
550
+ exports.ThermostatSetpointCCGet = ThermostatSetpointCCGet;
551
+ let ThermostatSetpointCCCapabilitiesReport = class ThermostatSetpointCCCapabilitiesReport extends ThermostatSetpointCC {
552
+ constructor(host, options) {
553
+ super(host, options);
554
+ (0, safe_1.validatePayload)(this.payload.length >= 1);
555
+ this._type = this.payload[0];
556
+ let bytesRead;
557
+ // parseFloatWithScale does its own validation
558
+ ({
559
+ value: this._minValue,
560
+ scale: this._minValueScale,
561
+ bytesRead,
562
+ } = (0, safe_1.parseFloatWithScale)(this.payload.slice(1)));
563
+ ({ value: this._maxValue, scale: this._maxValueScale } =
564
+ (0, safe_1.parseFloatWithScale)(this.payload.slice(1 + bytesRead)));
565
+ }
566
+ persistValues(applHost) {
567
+ if (!super.persistValues(applHost))
568
+ return false;
569
+ // Predefine the metadata
570
+ const valueId = getSetpointValueID(this.endpointIndex, this._type);
571
+ this.getValueDB(applHost).setMetadata(valueId, {
572
+ ...safe_1.ValueMetadata.Number,
573
+ min: this._minValue,
574
+ max: this._maxValue,
575
+ unit: getSetpointUnit(applHost.configManager, this._minValueScale) ||
576
+ getSetpointUnit(applHost.configManager, this._maxValueScale),
577
+ ccSpecific: {
578
+ setpointType: this._type,
579
+ },
580
+ });
581
+ return true;
582
+ }
583
+ get type() {
584
+ return this._type;
585
+ }
586
+ get minValue() {
587
+ return this._minValue;
588
+ }
589
+ get maxValue() {
590
+ return this._maxValue;
591
+ }
592
+ get minValueScale() {
593
+ return this._minValueScale;
594
+ }
595
+ get maxValueScale() {
596
+ return this._maxValueScale;
597
+ }
598
+ toLogEntry(applHost) {
599
+ const minValueScale = getScale(applHost.configManager, this.minValueScale);
600
+ const maxValueScale = getScale(applHost.configManager, this.maxValueScale);
601
+ return {
602
+ ...super.toLogEntry(applHost),
603
+ message: {
604
+ "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this._type),
605
+ "min value": `${this.minValue} ${minValueScale.unit}`,
606
+ "max value": `${this.maxValue} ${maxValueScale.unit}`,
607
+ },
608
+ };
609
+ }
610
+ };
611
+ ThermostatSetpointCCCapabilitiesReport = __decorate([
612
+ (0, CommandClass_1.CCCommand)(_Types_1.ThermostatSetpointCommand.CapabilitiesReport)
613
+ ], ThermostatSetpointCCCapabilitiesReport);
614
+ exports.ThermostatSetpointCCCapabilitiesReport = ThermostatSetpointCCCapabilitiesReport;
615
+ let ThermostatSetpointCCCapabilitiesGet = class ThermostatSetpointCCCapabilitiesGet extends ThermostatSetpointCC {
616
+ constructor(host, options) {
617
+ super(host, options);
618
+ if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
619
+ // TODO: Deserialize payload
620
+ throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
621
+ }
622
+ else {
623
+ this.setpointType = options.setpointType;
624
+ }
625
+ }
626
+ serialize() {
627
+ this.payload = Buffer.from([this.setpointType & 0b1111]);
628
+ return super.serialize();
629
+ }
630
+ toLogEntry(applHost) {
631
+ return {
632
+ ...super.toLogEntry(applHost),
633
+ message: {
634
+ "setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.setpointType),
635
+ },
636
+ };
637
+ }
638
+ };
639
+ ThermostatSetpointCCCapabilitiesGet = __decorate([
640
+ (0, CommandClass_1.CCCommand)(_Types_1.ThermostatSetpointCommand.CapabilitiesGet),
641
+ (0, CommandClass_1.expectedCCResponse)(ThermostatSetpointCCCapabilitiesReport)
642
+ ], ThermostatSetpointCCCapabilitiesGet);
643
+ exports.ThermostatSetpointCCCapabilitiesGet = ThermostatSetpointCCCapabilitiesGet;
644
+ let ThermostatSetpointCCSupportedReport = class ThermostatSetpointCCSupportedReport extends ThermostatSetpointCC {
645
+ constructor(host, options) {
646
+ super(host, options);
647
+ (0, safe_1.validatePayload)(this.payload.length >= 1);
648
+ const bitMask = this.payload;
649
+ const supported = (0, safe_1.parseBitMask)(bitMask, _Types_1.ThermostatSetpointType["N/A"]);
650
+ if (this.version >= 3) {
651
+ // Interpretation A
652
+ this._supportedSetpointTypes = supported.map((i) => thermostatSetpointTypeMap[i]);
653
+ }
654
+ else {
655
+ // It is unknown which interpretation the device complies to.
656
+ // This must be tested during the interview
657
+ this._supportedSetpointTypes = supported;
658
+ }
659
+ // TODO:
660
+ // Some devices skip the gaps in the ThermostatSetpointType (Interpretation A), some don't (Interpretation B)
661
+ // Devices with V3+ must comply with Interpretation A
662
+ // It is RECOMMENDED that a controlling node determines supported Setpoint Types
663
+ // by sending one Thermostat Setpoint Get Command at a time while incrementing
664
+ // the requested Setpoint Type. If the same Setpoint Type is advertised in the
665
+ // resulting Thermostat Setpoint Report Command, the controlling node MAY conclude
666
+ // that the actual Setpoint Type is supported. If the Setpoint Type 0x00 (type N/A)
667
+ // is advertised in the resulting Thermostat Setpoint Report Command, the controlling
668
+ // node MUST conclude that the actual Setpoint Type is not supported.
669
+ }
670
+ get supportedSetpointTypes() {
671
+ return this._supportedSetpointTypes;
672
+ }
673
+ toLogEntry(applHost) {
674
+ return {
675
+ ...super.toLogEntry(applHost),
676
+ message: {
677
+ "supported setpoint types": this.supportedSetpointTypes
678
+ .map((t) => `\n· ${(0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, t)}`)
679
+ .join(""),
680
+ },
681
+ };
682
+ }
683
+ };
684
+ __decorate([
685
+ (0, CommandClass_1.ccValue)({ internal: true })
686
+ ], ThermostatSetpointCCSupportedReport.prototype, "supportedSetpointTypes", null);
687
+ ThermostatSetpointCCSupportedReport = __decorate([
688
+ (0, CommandClass_1.CCCommand)(_Types_1.ThermostatSetpointCommand.SupportedReport)
689
+ ], ThermostatSetpointCCSupportedReport);
690
+ exports.ThermostatSetpointCCSupportedReport = ThermostatSetpointCCSupportedReport;
691
+ let ThermostatSetpointCCSupportedGet =
692
+ /**
693
+ * Issues a SupportedGet command to the node. Due to inconsistencies in interpretation,
694
+ * this command should not be used for nodes with CC versions 1 or 2
695
+ */
696
+ class ThermostatSetpointCCSupportedGet extends ThermostatSetpointCC {
697
+ };
698
+ ThermostatSetpointCCSupportedGet = __decorate([
699
+ (0, CommandClass_1.CCCommand)(_Types_1.ThermostatSetpointCommand.SupportedGet),
700
+ (0, CommandClass_1.expectedCCResponse)(ThermostatSetpointCCSupportedReport)
701
+ /**
702
+ * Issues a SupportedGet command to the node. Due to inconsistencies in interpretation,
703
+ * this command should not be used for nodes with CC versions 1 or 2
704
+ */
705
+ ], ThermostatSetpointCCSupportedGet);
706
+ exports.ThermostatSetpointCCSupportedGet = ThermostatSetpointCCSupportedGet;
707
+ //# sourceMappingURL=ThermostatSetpointCC.js.map