@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,327 @@
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.BinarySwitchCCGet = exports.BinarySwitchCCReport = exports.BinarySwitchCCSet = exports.BinarySwitchCC = exports.BinarySwitchCCAPI = 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__boolean = $o => {
18
+ function _boolean($o) {
19
+ return typeof $o !== "boolean" ? {} : null;
20
+ }
21
+ return _boolean($o);
22
+ };
23
+ const __assertType__optional_su__string__2_eu = $o => {
24
+ function _string($o) {
25
+ return typeof $o !== "string" ? {} : null;
26
+ }
27
+ function _2($o) {
28
+ return !($o instanceof require("@zwave-js/core/safe").Duration) ? {} : null;
29
+ }
30
+ function su__string__2_eu($o) {
31
+ const conditions = [_string, _2];
32
+ for (const condition of conditions) {
33
+ const error = condition($o);
34
+ if (!error)
35
+ return null;
36
+ }
37
+ return {};
38
+ }
39
+ function optional_su__string__2_eu($o) {
40
+ if ($o !== undefined) {
41
+ const error = su__string__2_eu($o);
42
+ if (error)
43
+ return error;
44
+ }
45
+ return null;
46
+ }
47
+ return optional_su__string__2_eu($o);
48
+ };
49
+ const safe_1 = require("@zwave-js/core/safe");
50
+ const API_1 = require("../lib/API");
51
+ const CommandClass_1 = require("../lib/CommandClass");
52
+ const _Types_1 = require("../lib/_Types");
53
+ function getCurrentValueValueId(endpoint) {
54
+ return {
55
+ commandClass: safe_1.CommandClasses["Binary Switch"],
56
+ endpoint,
57
+ property: "currentValue",
58
+ };
59
+ }
60
+ let BinarySwitchCCAPI = class BinarySwitchCCAPI extends API_1.CCAPI {
61
+ constructor() {
62
+ super(...arguments);
63
+ this[_a] = async ({ property }, value, options) => {
64
+ var _c;
65
+ if (property !== "targetValue") {
66
+ (0, API_1.throwUnsupportedProperty)(this.ccId, property);
67
+ }
68
+ if (typeof value !== "boolean") {
69
+ (0, API_1.throwWrongValueType)(this.ccId, property, "boolean", typeof value);
70
+ }
71
+ const duration = safe_1.Duration.from(options === null || options === void 0 ? void 0 : options.transitionDuration);
72
+ await this.set(value, duration);
73
+ // If the command did not fail, assume that it succeeded and update the currentValue accordingly
74
+ // so UIs have immediate feedback
75
+ if (this.isSinglecast()) {
76
+ if (!this.applHost.options.disableOptimisticValueUpdate) {
77
+ this.getValueDB().setValue(getCurrentValueValueId(this.endpoint.index), value);
78
+ }
79
+ // Verify the current value after a delay
80
+ // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
81
+ if (property === "targetValue")
82
+ property = "currentValue";
83
+ this.schedulePoll({ property }, value, {
84
+ duration,
85
+ // on/off "transitions" are usually fast
86
+ transition: "fast",
87
+ });
88
+ }
89
+ else if (this.isMulticast()) {
90
+ if (!this.applHost.options.disableOptimisticValueUpdate) {
91
+ // Figure out which nodes were affected by this command
92
+ const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => {
93
+ var _c;
94
+ return (_c = node
95
+ .getEndpoint(this.endpoint.index)) === null || _c === void 0 ? void 0 : _c.supportsCC(this.ccId);
96
+ });
97
+ // and optimistically update the currentValue
98
+ for (const node of affectedNodes) {
99
+ (_c = this.applHost
100
+ .tryGetValueDB(node.id)) === null || _c === void 0 ? void 0 : _c.setValue(getCurrentValueValueId(this.endpoint.index), value);
101
+ }
102
+ }
103
+ // For multicasts, do not schedule a refresh - this could cause a LOT of traffic
104
+ }
105
+ };
106
+ this[_b] = async ({ property, }) => {
107
+ var _c;
108
+ switch (property) {
109
+ case "currentValue":
110
+ case "targetValue":
111
+ case "duration":
112
+ return (_c = (await this.get())) === null || _c === void 0 ? void 0 : _c[property];
113
+ default:
114
+ (0, API_1.throwUnsupportedProperty)(this.ccId, property);
115
+ }
116
+ };
117
+ }
118
+ supportsCommand(cmd) {
119
+ switch (cmd) {
120
+ case _Types_1.BinarySwitchCommand.Get:
121
+ return this.isSinglecast();
122
+ case _Types_1.BinarySwitchCommand.Set:
123
+ return true;
124
+ }
125
+ return super.supportsCommand(cmd);
126
+ }
127
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
128
+ async get() {
129
+ this.assertSupportsCommand(_Types_1.BinarySwitchCommand, _Types_1.BinarySwitchCommand.Get);
130
+ const cc = new BinarySwitchCCGet(this.applHost, {
131
+ nodeId: this.endpoint.nodeId,
132
+ endpoint: this.endpoint.index,
133
+ });
134
+ const response = await this.applHost.sendCommand(cc, this.commandOptions);
135
+ if (response) {
136
+ return {
137
+ // interpret unknown values as false
138
+ currentValue: response.currentValue || false,
139
+ targetValue: response.targetValue,
140
+ duration: response.duration,
141
+ };
142
+ }
143
+ }
144
+ /**
145
+ * Sets the switch to the given value
146
+ * @param targetValue The target value to set
147
+ * @param duration The duration after which the target value should be reached. Can be a Duration instance or a user-friendly duration string like `"1m17s"`. Only supported in V2 and above.
148
+ */
149
+ async set(targetValue, duration) {
150
+ __assertType("targetValue", "boolean", __assertType__boolean.bind(void 0, targetValue));
151
+ __assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
152
+ this.assertSupportsCommand(_Types_1.BinarySwitchCommand, _Types_1.BinarySwitchCommand.Set);
153
+ const cc = new BinarySwitchCCSet(this.applHost, {
154
+ nodeId: this.endpoint.nodeId,
155
+ endpoint: this.endpoint.index,
156
+ targetValue,
157
+ duration,
158
+ });
159
+ await this.applHost.sendCommand(cc, this.commandOptions);
160
+ }
161
+ };
162
+ _a = API_1.SET_VALUE, _b = API_1.POLL_VALUE;
163
+ BinarySwitchCCAPI = __decorate([
164
+ (0, CommandClass_1.API)(safe_1.CommandClasses["Binary Switch"])
165
+ ], BinarySwitchCCAPI);
166
+ exports.BinarySwitchCCAPI = BinarySwitchCCAPI;
167
+ let BinarySwitchCC = class BinarySwitchCC extends CommandClass_1.CommandClass {
168
+ async interview(applHost) {
169
+ const node = this.getNode(applHost);
170
+ applHost.controllerLog.logNode(node.id, {
171
+ endpoint: this.endpointIndex,
172
+ message: `Interviewing ${this.ccName}...`,
173
+ direction: "none",
174
+ });
175
+ await this.refreshValues(applHost);
176
+ // Remember that the interview is complete
177
+ this.setInterviewComplete(applHost, true);
178
+ }
179
+ async refreshValues(applHost) {
180
+ var _c, _d;
181
+ const node = this.getNode(applHost);
182
+ const endpoint = this.getEndpoint(applHost);
183
+ const api = API_1.CCAPI.create(safe_1.CommandClasses["Binary Switch"], applHost, endpoint).withOptions({
184
+ priority: safe_1.MessagePriority.NodeQuery,
185
+ });
186
+ // Query the current state
187
+ applHost.controllerLog.logNode(node.id, {
188
+ endpoint: this.endpointIndex,
189
+ message: "querying Binary Switch state...",
190
+ direction: "outbound",
191
+ });
192
+ const resp = await api.get();
193
+ if (resp) {
194
+ let logMessage = `received Binary Switch state:
195
+ current value: ${resp.currentValue}`;
196
+ if (resp.targetValue != undefined) {
197
+ logMessage += `
198
+ target value: ${resp.targetValue}
199
+ remaining duration: ${(_d = (_c = resp.duration) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : "undefined"}`;
200
+ }
201
+ applHost.controllerLog.logNode(node.id, {
202
+ endpoint: this.endpointIndex,
203
+ message: logMessage,
204
+ direction: "inbound",
205
+ });
206
+ }
207
+ }
208
+ setMappedBasicValue(applHost, value) {
209
+ this.getValueDB(applHost).setValue({
210
+ commandClass: this.ccId,
211
+ endpoint: this.endpointIndex,
212
+ property: "currentValue",
213
+ }, value > 0);
214
+ return true;
215
+ }
216
+ };
217
+ BinarySwitchCC = __decorate([
218
+ (0, CommandClass_1.commandClass)(safe_1.CommandClasses["Binary Switch"]),
219
+ (0, CommandClass_1.implementedVersion)(2)
220
+ ], BinarySwitchCC);
221
+ exports.BinarySwitchCC = BinarySwitchCC;
222
+ let BinarySwitchCCSet = class BinarySwitchCCSet extends BinarySwitchCC {
223
+ constructor(host, options) {
224
+ super(host, options);
225
+ if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
226
+ throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
227
+ }
228
+ else {
229
+ this.targetValue = options.targetValue;
230
+ this.duration = safe_1.Duration.from(options.duration);
231
+ }
232
+ }
233
+ serialize() {
234
+ const payload = [this.targetValue ? 0xff : 0x00];
235
+ if (this.version >= 2 && this.duration) {
236
+ payload.push(this.duration.serializeSet());
237
+ }
238
+ this.payload = Buffer.from(payload);
239
+ return super.serialize();
240
+ }
241
+ toLogEntry(applHost) {
242
+ const message = {
243
+ "target value": this.targetValue,
244
+ };
245
+ if (this.duration != undefined) {
246
+ message.duration = this.duration.toString();
247
+ }
248
+ return {
249
+ ...super.toLogEntry(applHost),
250
+ message,
251
+ };
252
+ }
253
+ };
254
+ BinarySwitchCCSet = __decorate([
255
+ (0, CommandClass_1.CCCommand)(_Types_1.BinarySwitchCommand.Set)
256
+ ], BinarySwitchCCSet);
257
+ exports.BinarySwitchCCSet = BinarySwitchCCSet;
258
+ let BinarySwitchCCReport = class BinarySwitchCCReport extends BinarySwitchCC {
259
+ constructor(host, options) {
260
+ super(host, options);
261
+ (0, safe_1.validatePayload)(this.payload.length >= 1);
262
+ this._currentValue = (0, safe_1.parseMaybeBoolean)(this.payload[0]);
263
+ if (this.version >= 2 && this.payload.length >= 3) {
264
+ // V2
265
+ this._targetValue = (0, safe_1.parseBoolean)(this.payload[1]);
266
+ this._duration = safe_1.Duration.parseReport(this.payload[2]);
267
+ }
268
+ }
269
+ get currentValue() {
270
+ return this._currentValue;
271
+ }
272
+ get targetValue() {
273
+ return this._targetValue;
274
+ }
275
+ get duration() {
276
+ return this._duration;
277
+ }
278
+ toLogEntry(applHost) {
279
+ const message = {
280
+ "current value": this.currentValue,
281
+ };
282
+ if (this.targetValue != undefined) {
283
+ message["target value"] = this.targetValue;
284
+ }
285
+ if (this.duration != undefined) {
286
+ message.duration = this.duration.toString();
287
+ }
288
+ return {
289
+ ...super.toLogEntry(applHost),
290
+ message,
291
+ };
292
+ }
293
+ };
294
+ __decorate([
295
+ (0, CommandClass_1.ccValue)(),
296
+ (0, CommandClass_1.ccValueMetadata)({
297
+ ...safe_1.ValueMetadata.ReadOnlyBoolean,
298
+ label: "Current value",
299
+ })
300
+ ], BinarySwitchCCReport.prototype, "currentValue", null);
301
+ __decorate([
302
+ (0, CommandClass_1.ccValue)({ forceCreation: true }),
303
+ (0, CommandClass_1.ccValueMetadata)({
304
+ ...safe_1.ValueMetadata.Boolean,
305
+ label: "Target value",
306
+ valueChangeOptions: ["transitionDuration"],
307
+ })
308
+ ], BinarySwitchCCReport.prototype, "targetValue", null);
309
+ __decorate([
310
+ (0, CommandClass_1.ccValue)({ minVersion: 2 }),
311
+ (0, CommandClass_1.ccValueMetadata)({
312
+ ...safe_1.ValueMetadata.ReadOnlyDuration,
313
+ label: "Remaining duration",
314
+ })
315
+ ], BinarySwitchCCReport.prototype, "duration", null);
316
+ BinarySwitchCCReport = __decorate([
317
+ (0, CommandClass_1.CCCommand)(_Types_1.BinarySwitchCommand.Report)
318
+ ], BinarySwitchCCReport);
319
+ exports.BinarySwitchCCReport = BinarySwitchCCReport;
320
+ let BinarySwitchCCGet = class BinarySwitchCCGet extends BinarySwitchCC {
321
+ };
322
+ BinarySwitchCCGet = __decorate([
323
+ (0, CommandClass_1.CCCommand)(_Types_1.BinarySwitchCommand.Get),
324
+ (0, CommandClass_1.expectedCCResponse)(BinarySwitchCCReport)
325
+ ], BinarySwitchCCGet);
326
+ exports.BinarySwitchCCGet = BinarySwitchCCGet;
327
+ //# sourceMappingURL=BinarySwitchCC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BinarySwitchCC.js","sourceRoot":"","sources":["../../src/cc/BinarySwitchCC.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAc6B;AAG7B,oCAQoB;AACpB,sDAY6B;AAC7B,0CAAoD;AAEpD,SAAS,sBAAsB,CAAC,QAAiB;IAChD,OAAO;QACN,YAAY,EAAE,qBAAc,CAAC,eAAe,CAAC;QAC7C,QAAQ;QACR,QAAQ,EAAE,cAAc;KACxB,CAAC;AACH,CAAC;AAGD,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,WAAK;IAA5C;;QA4DW,QAAW,GAA2B,KAAK,EACpD,EAAE,QAAQ,EAAE,EACZ,KAAK,EACL,OAAO,EACS,EAAE;;YAClB,IAAI,QAAQ,KAAK,aAAa,EAAE;gBAC/B,IAAA,8BAAwB,EAAC,IAAI,CAAC,IAAI,EAAE,Q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AAoB;AAmEjC,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,cAAc;CAAG,CAAA;AAA3C,iBAAiB;IAF7B,IAAA,wBAAS,EAAC,4BAAmB,CAAC,GAAG,CAAC;IAClC,IAAA,iCAAkB,EAAC,oBAAoB,CAAC;GAC5B,iBAAiB,CAA0B;AAA3C,8CAAiB"}
@@ -0,0 +1,28 @@
1
+ /// <reference types="node" />
2
+ import type { Maybe, MessageOrCCLogEntry } from "@zwave-js/core/safe";
3
+ import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
4
+ import { CCAPI } from "../lib/API";
5
+ import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
6
+ import { CRC16Command } from "../lib/_Types";
7
+ export declare class CRC16CCAPI extends CCAPI {
8
+ supportsCommand(_cmd: CRC16Command): Maybe<boolean>;
9
+ sendEncapsulated(encapsulatedCC: CommandClass): Promise<void>;
10
+ }
11
+ export declare class CRC16CC extends CommandClass {
12
+ ccCommand: CRC16Command;
13
+ /** Encapsulates a command in a CRC-16 CC */
14
+ static encapsulate(host: ZWaveHost, cc: CommandClass): CRC16CCCommandEncapsulation;
15
+ }
16
+ interface CRC16CCCommandEncapsulationOptions extends CCCommandOptions {
17
+ encapsulated: CommandClass;
18
+ }
19
+ export declare class CRC16CCCommandEncapsulation extends CRC16CC {
20
+ constructor(host: ZWaveHost, options: CommandClassDeserializationOptions | CRC16CCCommandEncapsulationOptions);
21
+ encapsulated: CommandClass;
22
+ private readonly headerBuffer;
23
+ serialize(): Buffer;
24
+ protected computeEncapsulationOverhead(): number;
25
+ toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry;
26
+ }
27
+ export {};
28
+ //# sourceMappingURL=CRC16CC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CRC16CC.d.ts","sourceRoot":"","sources":["../../src/cc/CRC16CC.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAMtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAGN,YAAY,EAKZ,KAAK,gBAAgB,EACrB,KAAK,kCAAkC,EACvC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAO7C,qBACa,UAAW,SAAQ,KAAK;IAC7B,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;IAQ7C,gBAAgB,CAAC,cAAc,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAa1E;AAED,qBAEa,OAAQ,SAAQ,YAAY;IAChC,SAAS,EAAE,YAAY,CAAC;IAEhC,4CAA4C;WAC9B,WAAW,CACxB,IAAI,EAAE,SAAS,EACf,EAAE,EAAE,YAAY,GACd,2BAA2B;CAM9B;AAED,UAAU,kCAAmC,SAAQ,gBAAgB;IACpE,YAAY,EAAE,YAAY,CAAC;CAC3B;AAOD,qBAEa,2BAA4B,SAAQ,OAAO;gBAEtD,IAAI,EAAE,SAAS,EACf,OAAO,EACJ,kCAAkC,GAClC,kCAAkC;IA2B/B,YAAY,EAAE,YAAY,CAAC;IAClC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4C;IAElE,SAAS,IAAI,MAAM;IAc1B,SAAS,CAAC,4BAA4B,IAAI,MAAM;IAKzC,UAAU,CAAC,QAAQ,EAAE,oBAAoB,GAAG,mBAAmB;CAOtE"}
@@ -0,0 +1,109 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.CRC16CCCommandEncapsulation = exports.CRC16CC = exports.CRC16CCAPI = void 0;
10
+ const safe_1 = require("@zwave-js/core/safe");
11
+ const API_1 = require("../lib/API");
12
+ const CommandClass_1 = require("../lib/CommandClass");
13
+ const _Types_1 = require("../lib/_Types");
14
+ // @noSetValueAPI
15
+ // @noInterview This CC only has a single encapsulation command
16
+ // @noValidateArgs - Encapsulation CCs are used internally and too frequently that we
17
+ // want to pay the cost of validating each call
18
+ let CRC16CCAPI = class CRC16CCAPI extends API_1.CCAPI {
19
+ supportsCommand(_cmd) {
20
+ // switch (cmd) {
21
+ // case CRC16Command.CommandEncapsulation:
22
+ return true; // This is mandatory
23
+ // }
24
+ // return super.supportsCommand(cmd);
25
+ }
26
+ async sendEncapsulated(encapsulatedCC) {
27
+ this.assertSupportsCommand(_Types_1.CRC16Command, _Types_1.CRC16Command.CommandEncapsulation);
28
+ const cc = new CRC16CCCommandEncapsulation(this.applHost, {
29
+ nodeId: this.endpoint.nodeId,
30
+ endpoint: this.endpoint.index,
31
+ encapsulated: encapsulatedCC,
32
+ });
33
+ await this.applHost.sendCommand(cc, this.commandOptions);
34
+ }
35
+ };
36
+ CRC16CCAPI = __decorate([
37
+ (0, CommandClass_1.API)(safe_1.CommandClasses["CRC-16 Encapsulation"])
38
+ ], CRC16CCAPI);
39
+ exports.CRC16CCAPI = CRC16CCAPI;
40
+ let CRC16CC = class CRC16CC extends CommandClass_1.CommandClass {
41
+ /** Encapsulates a command in a CRC-16 CC */
42
+ static encapsulate(host, cc) {
43
+ return new CRC16CCCommandEncapsulation(host, {
44
+ nodeId: cc.nodeId,
45
+ encapsulated: cc,
46
+ });
47
+ }
48
+ };
49
+ CRC16CC = __decorate([
50
+ (0, CommandClass_1.commandClass)(safe_1.CommandClasses["CRC-16 Encapsulation"]),
51
+ (0, CommandClass_1.implementedVersion)(1)
52
+ ], CRC16CC);
53
+ exports.CRC16CC = CRC16CC;
54
+ // This indirection is necessary to be able to define the same CC as the response
55
+ function getResponseForCommandEncapsulation() {
56
+ return CRC16CCCommandEncapsulation;
57
+ }
58
+ let CRC16CCCommandEncapsulation = class CRC16CCCommandEncapsulation extends CRC16CC {
59
+ constructor(host, options) {
60
+ super(host, options);
61
+ this.headerBuffer = Buffer.from([this.ccId, this.ccCommand]);
62
+ if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
63
+ (0, safe_1.validatePayload)(this.payload.length >= 3);
64
+ const ccBuffer = this.payload.slice(0, -2);
65
+ // Verify the CRC
66
+ let expectedCRC = (0, safe_1.CRC16_CCITT)(this.headerBuffer);
67
+ expectedCRC = (0, safe_1.CRC16_CCITT)(ccBuffer, expectedCRC);
68
+ const actualCRC = this.payload.readUInt16BE(this.payload.length - 2);
69
+ (0, safe_1.validatePayload)(expectedCRC === actualCRC);
70
+ this.encapsulated = CommandClass_1.CommandClass.from(this.host, {
71
+ data: ccBuffer,
72
+ fromEncapsulation: true,
73
+ encapCC: this,
74
+ });
75
+ }
76
+ else {
77
+ this.encapsulated = options.encapsulated;
78
+ options.encapsulated.encapsulatingCC = this;
79
+ }
80
+ }
81
+ serialize() {
82
+ const commandBuffer = this.encapsulated.serialize();
83
+ // Reserve 2 bytes for the CRC
84
+ this.payload = Buffer.concat([commandBuffer, Buffer.allocUnsafe(2)]);
85
+ // Compute and save the CRC16 in the payload
86
+ // The CC header is included in the CRC computation
87
+ let crc = (0, safe_1.CRC16_CCITT)(this.headerBuffer);
88
+ crc = (0, safe_1.CRC16_CCITT)(commandBuffer, crc);
89
+ this.payload.writeUInt16BE(crc, this.payload.length - 2);
90
+ return super.serialize();
91
+ }
92
+ computeEncapsulationOverhead() {
93
+ // CRC16 adds two bytes CRC to the default overhead
94
+ return super.computeEncapsulationOverhead() + 2;
95
+ }
96
+ toLogEntry(applHost) {
97
+ return {
98
+ ...super.toLogEntry(applHost),
99
+ // Hide the default payload line
100
+ message: undefined,
101
+ };
102
+ }
103
+ };
104
+ CRC16CCCommandEncapsulation = __decorate([
105
+ (0, CommandClass_1.CCCommand)(_Types_1.CRC16Command.CommandEncapsulation),
106
+ (0, CommandClass_1.expectedCCResponse)(getResponseForCommandEncapsulation)
107
+ ], CRC16CCCommandEncapsulation);
108
+ exports.CRC16CCCommandEncapsulation = CRC16CCCommandEncapsulation;
109
+ //# sourceMappingURL=CRC16CC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CRC16CC.js","sourceRoot":"","sources":["../../src/cc/CRC16CC.ts"],"names":[],"mappings":";;;;;;;;;AACA,8CAI6B;AAE7B,oCAAmC;AACnC,sDAU6B;AAC7B,0CAA6C;AAE7C,iBAAiB;AACjB,+DAA+D;AAE/D,qFAAqF;AACrF,+CAA+C;AAE/C,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,WAAK;IAC7B,eAAe,CAAC,IAAkB;QACxC,iBAAiB;QACjB,2CAA2C;QAC3C,OAAO,IAAI,CAAC,CAAC,oBAAoB;QACjC,IAAI;QACJ,qCAAqC;IACtC,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,cAA4B;QACzD,IAAI,CAAC,qBAAqB,CACzB,qBAAY,EACZ,qBAAY,CAAC,oBAAoB,CACjC,CAAC;QAEF,MAAM,EAAE,GAAG,IAAI,2BAA2B,CAAC,IAAI,CAAC,QAAQ,EAAE;YACzD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM;YAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK;YAC7B,YAAY,EAAE,cAAc;SAC5B,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC1D,CAAC;CACD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AChC,OAAO,EAAE,SAAS;SAClB,CAAC;IACH,CAAC;CACD,CAAA;AA7DY,2BAA2B;IAFvC,IAAA,wBAAS,EAAC,qBAAY,CAAC,oBAAoB,CAAC;IAC5C,IAAA,iCAAkB,EAAC,kCAAkC,CAAC;GAC1C,2BAA2B,CA6DvC;AA7DY,kEAA2B"}
@@ -0,0 +1,69 @@
1
+ /// <reference types="node" />
2
+ import type { MessageOrCCLogEntry, ValueID } from "@zwave-js/core/safe";
3
+ import { CommandClasses, Maybe } from "@zwave-js/core/safe";
4
+ import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
5
+ import { CCAPI, PollValueImplementation, POLL_VALUE, SetValueImplementation, SET_VALUE } from "../lib/API";
6
+ import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
7
+ import { CentralSceneCommand, CentralSceneKeys } from "../lib/_Types";
8
+ /** Returns the ValueID used to store the current value of a Central Scene */
9
+ export declare function getSceneValueId(sceneNumber: number): ValueID;
10
+ export declare function getSlowRefreshValueId(): ValueID;
11
+ export declare class CentralSceneCCAPI extends CCAPI {
12
+ supportsCommand(cmd: CentralSceneCommand): Maybe<boolean>;
13
+ getSupported(): Promise<Pick<CentralSceneCCSupportedReport, "sceneCount" | "supportsSlowRefresh" | "supportedKeyAttributes"> | undefined>;
14
+ getConfiguration(): Promise<Pick<CentralSceneCCConfigurationReport, "slowRefresh"> | undefined>;
15
+ setConfiguration(slowRefresh: boolean): Promise<void>;
16
+ protected [SET_VALUE]: SetValueImplementation;
17
+ protected [POLL_VALUE]: PollValueImplementation;
18
+ }
19
+ export declare class CentralSceneCC extends CommandClass {
20
+ ccCommand: CentralSceneCommand;
21
+ determineRequiredCCInterviews(): readonly CommandClasses[];
22
+ skipEndpointInterview(): boolean;
23
+ interview(applHost: ZWaveApplicationHost): Promise<void>;
24
+ }
25
+ export declare class CentralSceneCCNotification extends CentralSceneCC {
26
+ constructor(host: ZWaveHost, options: CommandClassDeserializationOptions);
27
+ persistValues(applHost: ZWaveApplicationHost): boolean;
28
+ private _sequenceNumber;
29
+ get sequenceNumber(): number;
30
+ private _keyAttribute;
31
+ get keyAttribute(): CentralSceneKeys;
32
+ private _sceneNumber;
33
+ get sceneNumber(): number;
34
+ private _slowRefresh;
35
+ get slowRefresh(): boolean | undefined;
36
+ toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry;
37
+ }
38
+ export declare class CentralSceneCCSupportedReport extends CentralSceneCC {
39
+ constructor(host: ZWaveHost, options: CommandClassDeserializationOptions);
40
+ persistValues(applHost: ZWaveApplicationHost): boolean;
41
+ private _sceneCount;
42
+ get sceneCount(): number;
43
+ private _supportsSlowRefresh;
44
+ get supportsSlowRefresh(): boolean | undefined;
45
+ private _supportedKeyAttributes;
46
+ get supportedKeyAttributes(): ReadonlyMap<number, readonly CentralSceneKeys[]>;
47
+ toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry;
48
+ }
49
+ export declare class CentralSceneCCSupportedGet extends CentralSceneCC {
50
+ }
51
+ export declare class CentralSceneCCConfigurationReport extends CentralSceneCC {
52
+ constructor(host: ZWaveHost, options: CommandClassDeserializationOptions);
53
+ private _slowRefresh;
54
+ get slowRefresh(): boolean;
55
+ toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry;
56
+ }
57
+ export declare class CentralSceneCCConfigurationGet extends CentralSceneCC {
58
+ }
59
+ interface CentralSceneCCConfigurationSetOptions extends CCCommandOptions {
60
+ slowRefresh: boolean;
61
+ }
62
+ export declare class CentralSceneCCConfigurationSet extends CentralSceneCC {
63
+ constructor(host: ZWaveHost, options: CommandClassDeserializationOptions | CentralSceneCCConfigurationSetOptions);
64
+ slowRefresh: boolean;
65
+ serialize(): Buffer;
66
+ toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry;
67
+ }
68
+ export {};
69
+ //# sourceMappingURL=CentralSceneCC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Central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