@zwave-js/cc 10.19.0 → 10.21.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.
- package/build/cc/BarrierOperatorCC.d.ts +2 -1
- package/build/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/cc/BarrierOperatorCC.js +76 -15
- package/build/cc/BarrierOperatorCC.js.map +1 -1
- package/build/cc/BasicCC.d.ts +5 -1
- package/build/cc/BasicCC.d.ts.map +1 -1
- package/build/cc/BasicCC.js +52 -48
- package/build/cc/BasicCC.js.map +1 -1
- package/build/cc/BinarySwitchCC.d.ts +2 -1
- package/build/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/cc/BinarySwitchCC.js +43 -46
- package/build/cc/BinarySwitchCC.js.map +1 -1
- package/build/cc/ColorSwitchCC.js +3 -3
- package/build/cc/ColorSwitchCC.js.map +1 -1
- package/build/cc/ConfigurationCC.d.ts +48 -37
- package/build/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/cc/ConfigurationCC.js +244 -165
- package/build/cc/ConfigurationCC.js.map +1 -1
- package/build/cc/EnergyProductionCC.d.ts +7 -1
- package/build/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/cc/EnergyProductionCC.js +19 -5
- package/build/cc/EnergyProductionCC.js.map +1 -1
- package/build/cc/IndicatorCC.d.ts +3 -0
- package/build/cc/IndicatorCC.d.ts.map +1 -1
- package/build/cc/IndicatorCC.js +3 -0
- package/build/cc/IndicatorCC.js.map +1 -1
- package/build/cc/IrrigationCC.d.ts +7 -0
- package/build/cc/IrrigationCC.d.ts.map +1 -1
- package/build/cc/IrrigationCC.js +7 -0
- package/build/cc/IrrigationCC.js.map +1 -1
- package/build/cc/MeterCC.d.ts +6 -0
- package/build/cc/MeterCC.d.ts.map +1 -1
- package/build/cc/MeterCC.js +6 -0
- package/build/cc/MeterCC.js.map +1 -1
- package/build/cc/MultilevelSwitchCC.d.ts +13 -1
- package/build/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/cc/MultilevelSwitchCC.js +83 -76
- package/build/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/cc/ScheduleEntryLockCC.d.ts +1 -0
- package/build/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cc/WindowCoveringCC.d.ts +28 -78
- package/build/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/cc/WindowCoveringCC.js +136 -188
- package/build/cc/WindowCoveringCC.js.map +1 -1
- package/build/cc/ZWavePlusCC.d.ts +1 -2
- package/build/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/cc/ZWavePlusCC.js +68 -15
- package/build/cc/ZWavePlusCC.js.map +1 -1
- package/build/lib/API.d.ts +18 -2
- package/build/lib/API.d.ts.map +1 -1
- package/build/lib/API.js +13 -4
- package/build/lib/API.js.map +1 -1
- package/build/lib/Values.d.ts +2 -0
- package/build/lib/Values.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1,96 +1,34 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { CommandClasses, Duration, Maybe, MessageOrCCLogEntry, SupervisionResult } from "@zwave-js/core";
|
|
3
3
|
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host";
|
|
4
|
-
import { CCAPI, PollValueImplementation, POLL_VALUE, SetValueImplementation, SET_VALUE } from "../lib/API";
|
|
4
|
+
import { CCAPI, PollValueImplementation, POLL_VALUE, SetValueImplementation, SetValueImplementationHooksFactory, SET_VALUE, SET_VALUE_HOOKS } from "../lib/API";
|
|
5
5
|
import { CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
|
|
6
6
|
import { LevelChangeDirection, WindowCoveringCommand, WindowCoveringParameter } from "../lib/_Types";
|
|
7
7
|
export declare const WindowCoveringCCValues: Readonly<{
|
|
8
|
-
|
|
8
|
+
levelChangeDown: ((parameter: WindowCoveringParameter) => {
|
|
9
9
|
readonly meta: {
|
|
10
|
-
readonly label:
|
|
11
|
-
readonly ccSpecific: {
|
|
12
|
-
readonly parameter: WindowCoveringParameter;
|
|
13
|
-
};
|
|
10
|
+
readonly label: `${string} - ${string}`;
|
|
14
11
|
readonly valueChangeOptions: readonly ["transitionDuration"];
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
readonly id: {
|
|
20
|
-
commandClass: (typeof CommandClasses)["Window Covering"];
|
|
21
|
-
property: "close99";
|
|
22
|
-
propertyKey: WindowCoveringParameter;
|
|
23
|
-
};
|
|
24
|
-
readonly endpoint: (endpoint?: number | undefined) => {
|
|
25
|
-
readonly commandClass: (typeof CommandClasses)["Window Covering"];
|
|
26
|
-
readonly endpoint: number;
|
|
27
|
-
readonly property: "close99";
|
|
28
|
-
readonly propertyKey: WindowCoveringParameter;
|
|
29
|
-
};
|
|
30
|
-
}) & {
|
|
31
|
-
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
32
|
-
readonly options: {
|
|
33
|
-
readonly internal: false;
|
|
34
|
-
readonly minVersion: 1;
|
|
35
|
-
readonly secret: false;
|
|
36
|
-
readonly stateful: true;
|
|
37
|
-
readonly supportsEndpoints: true;
|
|
38
|
-
readonly autoCreate: true;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
tiltClose0: ((parameter: WindowCoveringParameter) => {
|
|
42
|
-
readonly meta: {
|
|
43
|
-
readonly label: `Close Right - ${string}` | `Close Up - ${string}`;
|
|
44
|
-
readonly ccSpecific: {
|
|
45
|
-
readonly parameter: WindowCoveringParameter;
|
|
12
|
+
readonly states: {
|
|
13
|
+
readonly true: "Start";
|
|
14
|
+
readonly false: "Stop";
|
|
46
15
|
};
|
|
47
|
-
readonly valueChangeOptions: readonly ["transitionDuration"];
|
|
48
|
-
readonly readable: false;
|
|
49
|
-
readonly type: "boolean";
|
|
50
|
-
readonly writeable: true;
|
|
51
|
-
};
|
|
52
|
-
readonly id: {
|
|
53
|
-
commandClass: (typeof CommandClasses)["Window Covering"];
|
|
54
|
-
property: "close0";
|
|
55
|
-
propertyKey: WindowCoveringParameter;
|
|
56
|
-
};
|
|
57
|
-
readonly endpoint: (endpoint?: number | undefined) => {
|
|
58
|
-
readonly commandClass: (typeof CommandClasses)["Window Covering"];
|
|
59
|
-
readonly endpoint: number;
|
|
60
|
-
readonly property: "close0";
|
|
61
|
-
readonly propertyKey: WindowCoveringParameter;
|
|
62
|
-
};
|
|
63
|
-
}) & {
|
|
64
|
-
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
65
|
-
readonly options: {
|
|
66
|
-
readonly internal: false;
|
|
67
|
-
readonly minVersion: 1;
|
|
68
|
-
readonly secret: false;
|
|
69
|
-
readonly stateful: true;
|
|
70
|
-
readonly supportsEndpoints: true;
|
|
71
|
-
readonly autoCreate: true;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
positionClose: ((parameter: WindowCoveringParameter) => {
|
|
75
|
-
readonly meta: {
|
|
76
|
-
readonly label: `Close - ${string}`;
|
|
77
16
|
readonly ccSpecific: {
|
|
78
17
|
readonly parameter: WindowCoveringParameter;
|
|
79
18
|
};
|
|
80
|
-
readonly valueChangeOptions: readonly ["transitionDuration"];
|
|
81
19
|
readonly readable: false;
|
|
82
20
|
readonly type: "boolean";
|
|
83
21
|
readonly writeable: true;
|
|
84
22
|
};
|
|
85
23
|
readonly id: {
|
|
86
24
|
commandClass: (typeof CommandClasses)["Window Covering"];
|
|
87
|
-
property: "
|
|
25
|
+
property: "levelChangeDown";
|
|
88
26
|
propertyKey: WindowCoveringParameter;
|
|
89
27
|
};
|
|
90
28
|
readonly endpoint: (endpoint?: number | undefined) => {
|
|
91
29
|
readonly commandClass: (typeof CommandClasses)["Window Covering"];
|
|
92
30
|
readonly endpoint: number;
|
|
93
|
-
readonly property: "
|
|
31
|
+
readonly property: "levelChangeDown";
|
|
94
32
|
readonly propertyKey: WindowCoveringParameter;
|
|
95
33
|
};
|
|
96
34
|
}) & {
|
|
@@ -104,26 +42,30 @@ export declare const WindowCoveringCCValues: Readonly<{
|
|
|
104
42
|
readonly autoCreate: true;
|
|
105
43
|
};
|
|
106
44
|
};
|
|
107
|
-
|
|
45
|
+
levelChangeUp: ((parameter: WindowCoveringParameter) => {
|
|
108
46
|
readonly meta: {
|
|
109
|
-
readonly label:
|
|
47
|
+
readonly label: `${string} - ${string}`;
|
|
48
|
+
readonly valueChangeOptions: readonly ["transitionDuration"];
|
|
49
|
+
readonly states: {
|
|
50
|
+
readonly true: "Start";
|
|
51
|
+
readonly false: "Stop";
|
|
52
|
+
};
|
|
110
53
|
readonly ccSpecific: {
|
|
111
54
|
readonly parameter: WindowCoveringParameter;
|
|
112
55
|
};
|
|
113
|
-
readonly valueChangeOptions: readonly ["transitionDuration"];
|
|
114
56
|
readonly readable: false;
|
|
115
57
|
readonly type: "boolean";
|
|
116
58
|
readonly writeable: true;
|
|
117
59
|
};
|
|
118
60
|
readonly id: {
|
|
119
61
|
commandClass: (typeof CommandClasses)["Window Covering"];
|
|
120
|
-
property: "
|
|
62
|
+
property: "levelChangeUp";
|
|
121
63
|
propertyKey: WindowCoveringParameter;
|
|
122
64
|
};
|
|
123
65
|
readonly endpoint: (endpoint?: number | undefined) => {
|
|
124
66
|
readonly commandClass: (typeof CommandClasses)["Window Covering"];
|
|
125
67
|
readonly endpoint: number;
|
|
126
|
-
readonly property: "
|
|
68
|
+
readonly property: "levelChangeUp";
|
|
127
69
|
readonly propertyKey: WindowCoveringParameter;
|
|
128
70
|
};
|
|
129
71
|
}) & {
|
|
@@ -171,12 +113,16 @@ export declare const WindowCoveringCCValues: Readonly<{
|
|
|
171
113
|
};
|
|
172
114
|
targetValue: ((parameter: WindowCoveringParameter) => {
|
|
173
115
|
readonly meta: {
|
|
116
|
+
readonly label: `Target value - ${string}`;
|
|
117
|
+
readonly writeable: boolean;
|
|
118
|
+
readonly states: {
|
|
119
|
+
[x: number]: string;
|
|
120
|
+
};
|
|
121
|
+
readonly allowManualEntry: boolean;
|
|
174
122
|
readonly ccSpecific: {
|
|
175
123
|
readonly parameter: WindowCoveringParameter;
|
|
176
124
|
};
|
|
177
125
|
readonly valueChangeOptions: readonly ["transitionDuration"];
|
|
178
|
-
readonly label: `Target value - ${string}`;
|
|
179
|
-
readonly writeable: boolean;
|
|
180
126
|
readonly max: 99;
|
|
181
127
|
readonly min: 0;
|
|
182
128
|
readonly type: "number";
|
|
@@ -206,10 +152,13 @@ export declare const WindowCoveringCCValues: Readonly<{
|
|
|
206
152
|
};
|
|
207
153
|
currentValue: ((parameter: WindowCoveringParameter) => {
|
|
208
154
|
readonly meta: {
|
|
155
|
+
readonly label: `Current value - ${string}`;
|
|
156
|
+
readonly states: {
|
|
157
|
+
[x: number]: string;
|
|
158
|
+
};
|
|
209
159
|
readonly ccSpecific: {
|
|
210
160
|
readonly parameter: WindowCoveringParameter;
|
|
211
161
|
};
|
|
212
|
-
readonly label: `Current value - ${string}`;
|
|
213
162
|
readonly writeable: false;
|
|
214
163
|
readonly max: 99;
|
|
215
164
|
readonly min: 0;
|
|
@@ -267,6 +216,7 @@ export declare const WindowCoveringCCValues: Readonly<{
|
|
|
267
216
|
export declare class WindowCoveringCCAPI extends CCAPI {
|
|
268
217
|
supportsCommand(cmd: WindowCoveringCommand): Maybe<boolean>;
|
|
269
218
|
protected [SET_VALUE]: SetValueImplementation;
|
|
219
|
+
protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory;
|
|
270
220
|
protected [POLL_VALUE]: PollValueImplementation;
|
|
271
221
|
getSupported(): Promise<readonly WindowCoveringParameter[] | undefined>;
|
|
272
222
|
get(parameter: WindowCoveringParameter): Promise<Pick<WindowCoveringCCReport, "duration" | "currentValue" | "targetValue"> | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WindowCoveringCC.d.ts","sourceRoot":"","sources":["../../src/cc/WindowCoveringCC.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,cAAc,EAC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CAAiC,SAAQ,gBAAgB;gBAEpE,IAAI,EAAE,SAAS,EACf,OAAO,EACJ,kCAAkC,GAClC,uCAAuC;IAgBpC,SAAS,EAAE,uBAAuB,CAAC;IACnC,SAAS,EAAE,MAAM,OAAO,oBAAoB,CAAC;IAC7C,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAE/B,SAAS,IAAI,MAAM;IASnB,UAAU,CAAC,QAAQ,EAAE,oBAAoB,GAAG,mBAAmB;CAgBtE;AAED,UAAU,sCAAuC,SAAQ,gBAAgB;IACxE,SAAS,EAAE,uBAAuB,CAAC;CACnC;AAED,qBAEa,+BAAgC,SAAQ,gBAAgB;gBAEnE,IAAI,EAAE,SAAS,EACf,OAAO,EACJ,kCAAkC,GAClC,sCAAsC;IAcnC,SAAS,EAAE,uBAAuB,CAAC;IAEnC,SAAS,IAAI,MAAM;IAKnB,UAAU,CAAC,QAAQ,EAAE,oBAAoB,GAAG,mBAAmB;CAWtE"}
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var _a, _b;
|
|
8
|
+
var _a, _b, _c;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.WindowCoveringCCStopLevelChange = exports.WindowCoveringCCStartLevelChange = exports.WindowCoveringCCSet = exports.WindowCoveringCCGet = exports.WindowCoveringCCReport = exports.WindowCoveringCCSupportedGet = exports.WindowCoveringCCSupportedReport = exports.WindowCoveringCC = exports.WindowCoveringCCAPI = exports.WindowCoveringCCValues = void 0;
|
|
11
11
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -109,60 +109,42 @@ const CommandClass_1 = require("../lib/CommandClass");
|
|
|
109
109
|
const CommandClassDecorators_1 = require("../lib/CommandClassDecorators");
|
|
110
110
|
const Values_1 = require("../lib/Values");
|
|
111
111
|
const _Types_1 = require("../lib/_Types");
|
|
112
|
-
function parameterToMetadataStates(parameter
|
|
112
|
+
function parameterToMetadataStates(parameter) {
|
|
113
113
|
switch (parameter) {
|
|
114
114
|
case _Types_1.WindowCoveringParameter["Vertical Slats Angle (no position)"]:
|
|
115
|
-
if (isTargetValue)
|
|
116
|
-
return undefined;
|
|
117
|
-
return {
|
|
118
|
-
0: "Closing (right)",
|
|
119
|
-
50: "Opening",
|
|
120
|
-
99: "Closing (left)",
|
|
121
|
-
};
|
|
122
115
|
case _Types_1.WindowCoveringParameter["Vertical Slats Angle"]:
|
|
123
116
|
return {
|
|
124
|
-
0: "Closed (right)",
|
|
117
|
+
0: "Closed (right inside)",
|
|
125
118
|
50: "Open",
|
|
126
|
-
99: "Closed (left)",
|
|
119
|
+
99: "Closed (left inside)",
|
|
127
120
|
};
|
|
128
121
|
case _Types_1.WindowCoveringParameter["Horizontal Slats Angle (no position)"]:
|
|
129
|
-
if (isTargetValue)
|
|
130
|
-
return undefined;
|
|
131
|
-
return {
|
|
132
|
-
0: "Closing (up)",
|
|
133
|
-
50: "Opening",
|
|
134
|
-
99: "Closing (down)",
|
|
135
|
-
};
|
|
136
122
|
case _Types_1.WindowCoveringParameter["Horizontal Slats Angle"]:
|
|
137
123
|
return {
|
|
138
|
-
0: "Closed (up)",
|
|
124
|
+
0: "Closed (up inside)",
|
|
139
125
|
50: "Open",
|
|
140
|
-
99: "Closed (down)",
|
|
126
|
+
99: "Closed (down inside)",
|
|
141
127
|
};
|
|
142
128
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
99: "Open",
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
if (isTargetValue)
|
|
152
|
-
return undefined;
|
|
153
|
-
return {
|
|
154
|
-
0: "Closing",
|
|
155
|
-
99: "Opening",
|
|
156
|
-
};
|
|
157
|
-
}
|
|
129
|
+
return {
|
|
130
|
+
0: "Closed",
|
|
131
|
+
99: "Open",
|
|
132
|
+
};
|
|
158
133
|
}
|
|
159
|
-
function
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
134
|
+
function parameterToLevelChangeLabel(parameter, direction) {
|
|
135
|
+
switch (parameter) {
|
|
136
|
+
// For angle control, both directions are closed, so we specify it explicitly
|
|
137
|
+
case _Types_1.WindowCoveringParameter["Vertical Slats Angle (no position)"]:
|
|
138
|
+
case _Types_1.WindowCoveringParameter["Vertical Slats Angle"]:
|
|
139
|
+
return `Change tilt (${direction === "up" ? "left inside" : "right inside"})`;
|
|
140
|
+
case _Types_1.WindowCoveringParameter["Horizontal Slats Angle (no position)"]:
|
|
141
|
+
case _Types_1.WindowCoveringParameter["Horizontal Slats Angle"]:
|
|
142
|
+
// Horizontal slats refer to the position of the inner side of the slats
|
|
143
|
+
// where a high level (99) actually means they face down
|
|
144
|
+
return `Change tilt (${direction === "up" ? "down inside" : "up inside"})`;
|
|
145
|
+
}
|
|
146
|
+
// For all other parameters, refer to the amount of light that is let in
|
|
147
|
+
return direction === "up" ? "Open" : "Close";
|
|
166
148
|
}
|
|
167
149
|
exports.WindowCoveringCCValues = Object.freeze({
|
|
168
150
|
...Values_1.V.defineStaticCCValues(core_1.CommandClasses["Window Covering"], {
|
|
@@ -171,27 +153,24 @@ exports.WindowCoveringCCValues = Object.freeze({
|
|
|
171
153
|
}),
|
|
172
154
|
...Values_1.V.defineDynamicCCValues(core_1.CommandClasses["Window Covering"], {
|
|
173
155
|
...Values_1.V.dynamicPropertyAndKeyWithName("currentValue", "currentValue", (parameter) => parameter, ({ property, propertyKey }) => property === "currentValue" && typeof propertyKey === "number", (parameter) => {
|
|
174
|
-
const states = parameterToMetadataStates(parameter, false);
|
|
175
156
|
return {
|
|
176
157
|
...core_1.ValueMetadata.ReadOnlyLevel,
|
|
177
158
|
label: `Current value - ${(0, safe_1.getEnumMemberName)(_Types_1.WindowCoveringParameter, parameter)}`,
|
|
178
|
-
|
|
179
|
-
ccSpecific: {
|
|
180
|
-
parameter,
|
|
181
|
-
},
|
|
159
|
+
states: parameterToMetadataStates(parameter),
|
|
160
|
+
ccSpecific: { parameter },
|
|
182
161
|
};
|
|
183
162
|
}),
|
|
184
163
|
...Values_1.V.dynamicPropertyAndKeyWithName("targetValue", "targetValue", (parameter) => parameter, ({ property, propertyKey }) => property === "targetValue" && typeof propertyKey === "number", (parameter) => {
|
|
185
|
-
|
|
164
|
+
// Only odd-numbered parameters have position support and are writable
|
|
165
|
+
const writeable = parameter % 2 === 1;
|
|
186
166
|
return {
|
|
187
167
|
...core_1.ValueMetadata.Level,
|
|
188
168
|
label: `Target value - ${(0, safe_1.getEnumMemberName)(_Types_1.WindowCoveringParameter, parameter)}`,
|
|
189
169
|
// Only odd-numbered parameters have position support and are writable
|
|
190
170
|
writeable: parameter % 2 === 1,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
},
|
|
171
|
+
states: parameterToMetadataStates(parameter),
|
|
172
|
+
allowManualEntry: writeable,
|
|
173
|
+
ccSpecific: { parameter },
|
|
195
174
|
valueChangeOptions: ["transitionDuration"],
|
|
196
175
|
};
|
|
197
176
|
}),
|
|
@@ -202,63 +181,33 @@ exports.WindowCoveringCCValues = Object.freeze({
|
|
|
202
181
|
parameter,
|
|
203
182
|
},
|
|
204
183
|
})),
|
|
205
|
-
|
|
206
|
-
//
|
|
207
|
-
|
|
208
|
-
...core_1.ValueMetadata.WriteOnlyBoolean,
|
|
209
|
-
label: `Open - ${(0, safe_1.getEnumMemberName)(_Types_1.WindowCoveringParameter, parameter)}`,
|
|
210
|
-
ccSpecific: {
|
|
211
|
-
parameter,
|
|
212
|
-
},
|
|
213
|
-
valueChangeOptions: ["transitionDuration"],
|
|
214
|
-
})),
|
|
215
|
-
// Close positional parameters
|
|
216
|
-
...Values_1.V.dynamicPropertyAndKeyWithName("positionClose", "close", (parameter) => parameter, ({ property, propertyKey }) => property === "close" &&
|
|
217
|
-
typeof propertyKey === "number" &&
|
|
218
|
-
!isTiltParameter(propertyKey), (parameter) => ({
|
|
219
|
-
...core_1.ValueMetadata.WriteOnlyBoolean,
|
|
220
|
-
label: `Close - ${(0, safe_1.getEnumMemberName)(_Types_1.WindowCoveringParameter, parameter)}`,
|
|
221
|
-
ccSpecific: {
|
|
222
|
-
parameter,
|
|
223
|
-
},
|
|
224
|
-
valueChangeOptions: ["transitionDuration"],
|
|
225
|
-
})),
|
|
226
|
-
// Close vertical slats to the right, horizontal to the top
|
|
227
|
-
...Values_1.V.dynamicPropertyAndKeyWithName("tiltClose0", "close0", (parameter) => parameter, ({ property, propertyKey }) => property === "close0" &&
|
|
228
|
-
typeof propertyKey === "number" &&
|
|
229
|
-
isTiltParameter(propertyKey), (parameter) => {
|
|
230
|
-
const direction = parameter ===
|
|
231
|
-
_Types_1.WindowCoveringParameter["Vertical Slats Angle"] ||
|
|
232
|
-
parameter ===
|
|
233
|
-
_Types_1.WindowCoveringParameter["Vertical Slats Angle (no position)"]
|
|
234
|
-
? "Right"
|
|
235
|
-
: "Up";
|
|
184
|
+
...Values_1.V.dynamicPropertyAndKeyWithName("levelChangeUp",
|
|
185
|
+
// The direction refers to the change in level, not the physical location
|
|
186
|
+
"levelChangeUp", (parameter) => parameter, ({ property, propertyKey }) => property === "levelChangeUp" && typeof propertyKey === "number", (parameter) => {
|
|
236
187
|
return {
|
|
237
188
|
...core_1.ValueMetadata.WriteOnlyBoolean,
|
|
238
|
-
label:
|
|
239
|
-
ccSpecific: {
|
|
240
|
-
parameter,
|
|
241
|
-
},
|
|
189
|
+
label: `${parameterToLevelChangeLabel(parameter, "up")} - ${(0, safe_1.getEnumMemberName)(_Types_1.WindowCoveringParameter, parameter)}`,
|
|
242
190
|
valueChangeOptions: ["transitionDuration"],
|
|
191
|
+
states: {
|
|
192
|
+
true: "Start",
|
|
193
|
+
false: "Stop",
|
|
194
|
+
},
|
|
195
|
+
ccSpecific: { parameter },
|
|
243
196
|
};
|
|
244
197
|
}),
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const direction = parameter ===
|
|
250
|
-
_Types_1.WindowCoveringParameter["Vertical Slats Angle"] ||
|
|
251
|
-
parameter ===
|
|
252
|
-
_Types_1.WindowCoveringParameter["Vertical Slats Angle (no position)"]
|
|
253
|
-
? "Left"
|
|
254
|
-
: "Down";
|
|
198
|
+
...Values_1.V.dynamicPropertyAndKeyWithName("levelChangeDown",
|
|
199
|
+
// The direction refers to the change in level, not the physical location
|
|
200
|
+
"levelChangeDown", (parameter) => parameter, ({ property, propertyKey }) => property === "levelChangeDown" &&
|
|
201
|
+
typeof propertyKey === "number", (parameter) => {
|
|
255
202
|
return {
|
|
256
203
|
...core_1.ValueMetadata.WriteOnlyBoolean,
|
|
257
|
-
label:
|
|
258
|
-
ccSpecific: {
|
|
259
|
-
parameter,
|
|
260
|
-
},
|
|
204
|
+
label: `${parameterToLevelChangeLabel(parameter, "down")} - ${(0, safe_1.getEnumMemberName)(_Types_1.WindowCoveringParameter, parameter)}`,
|
|
261
205
|
valueChangeOptions: ["transitionDuration"],
|
|
206
|
+
states: {
|
|
207
|
+
true: "Start",
|
|
208
|
+
false: "Stop",
|
|
209
|
+
},
|
|
210
|
+
ccSpecific: { parameter },
|
|
262
211
|
};
|
|
263
212
|
}),
|
|
264
213
|
}),
|
|
@@ -272,7 +221,6 @@ let WindowCoveringCCAPI = class WindowCoveringCCAPI extends API_1.CCAPI {
|
|
|
272
221
|
property,
|
|
273
222
|
propertyKey,
|
|
274
223
|
};
|
|
275
|
-
let targetValue;
|
|
276
224
|
if (exports.WindowCoveringCCValues.targetValue.is(valueId)) {
|
|
277
225
|
if (typeof propertyKey !== "number" ||
|
|
278
226
|
// Only odd-numbered parameters have position support and are writable
|
|
@@ -282,92 +230,98 @@ let WindowCoveringCCAPI = class WindowCoveringCCAPI extends API_1.CCAPI {
|
|
|
282
230
|
if (typeof value !== "number") {
|
|
283
231
|
(0, API_1.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
284
232
|
}
|
|
285
|
-
|
|
233
|
+
const parameter = propertyKey;
|
|
234
|
+
const duration = core_1.Duration.from(options?.transitionDuration);
|
|
235
|
+
return this.set([{ parameter, value }], duration);
|
|
286
236
|
}
|
|
287
|
-
else if (
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
exports.WindowCoveringCCValues.tiltClose99.is(valueId)) {
|
|
292
|
-
if (!value) {
|
|
293
|
-
(0, API_1.throwWrongValueType)(this.ccId, property, "true", typeof value);
|
|
237
|
+
else if (exports.WindowCoveringCCValues.levelChangeUp.is(valueId) ||
|
|
238
|
+
exports.WindowCoveringCCValues.levelChangeDown.is(valueId)) {
|
|
239
|
+
if (typeof value !== "boolean") {
|
|
240
|
+
(0, API_1.throwWrongValueType)(this.ccId, property, "boolean", typeof value);
|
|
294
241
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
242
|
+
const parameter = propertyKey;
|
|
243
|
+
const direction = exports.WindowCoveringCCValues.levelChangeUp.is(valueId)
|
|
244
|
+
? "up"
|
|
245
|
+
: "down";
|
|
246
|
+
if (value) {
|
|
247
|
+
// Perform the level change
|
|
248
|
+
const duration = core_1.Duration.from(options?.transitionDuration);
|
|
249
|
+
return this.startLevelChange(parameter, direction, duration);
|
|
303
250
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
else if (exports.WindowCoveringCCValues.positionClose.is(valueId) ||
|
|
307
|
-
exports.WindowCoveringCCValues.tiltClose0.is(valueId)) {
|
|
308
|
-
if (!value) {
|
|
309
|
-
(0, API_1.throwWrongValueType)(this.ccId, property, "true", typeof value);
|
|
251
|
+
else {
|
|
252
|
+
return this.stopLevelChange(parameter);
|
|
310
253
|
}
|
|
311
|
-
// Closing a positional parameter is the same as closing a tilt parameter to the other side
|
|
312
|
-
targetValue = 0;
|
|
313
254
|
}
|
|
314
255
|
else {
|
|
315
256
|
(0, API_1.throwUnsupportedProperty)(this.ccId, property);
|
|
316
257
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
258
|
+
};
|
|
259
|
+
this[_b] = ({ property, propertyKey }, value, options) => {
|
|
260
|
+
const valueId = {
|
|
261
|
+
commandClass: this.ccId,
|
|
262
|
+
property,
|
|
263
|
+
propertyKey,
|
|
264
|
+
};
|
|
265
|
+
if (exports.WindowCoveringCCValues.targetValue.is(valueId)) {
|
|
266
|
+
if (typeof propertyKey !== "number")
|
|
267
|
+
return;
|
|
268
|
+
const parameter = propertyKey;
|
|
269
|
+
const duration = core_1.Duration.from(options?.transitionDuration);
|
|
270
|
+
const currentValueValueId = exports.WindowCoveringCCValues.currentValue(parameter).endpoint(this.endpoint.index);
|
|
271
|
+
return {
|
|
272
|
+
// Window Covering commands may take some time to be executed.
|
|
273
|
+
// Therefore we try to supervise the command execution and delay the
|
|
274
|
+
// optimistic update until the final result is received.
|
|
275
|
+
supervisionDelayedUpdates: true,
|
|
276
|
+
supervisionOnSuccess: () => {
|
|
277
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
278
|
+
},
|
|
279
|
+
supervisionOnFailure: async () => {
|
|
280
|
+
// The transition failed, so now we don't know the status - refresh the current value
|
|
281
|
+
try {
|
|
282
|
+
await this.get(parameter);
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
// ignore
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
optimisticallyUpdateRelatedValues: () => {
|
|
289
|
+
// Only update currentValue for valid target values
|
|
290
|
+
if (typeof value === "number" &&
|
|
291
|
+
value >= 0 &&
|
|
292
|
+
value <= 99) {
|
|
293
|
+
if (this.isSinglecast()) {
|
|
294
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
295
|
+
}
|
|
296
|
+
else if (this.isMulticast()) {
|
|
297
|
+
// Figure out which nodes were affected by this command
|
|
298
|
+
const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node
|
|
299
|
+
.getEndpoint(this.endpoint.index)
|
|
300
|
+
?.supportsCC(this.ccId));
|
|
301
|
+
// and optimistically update the currentValue
|
|
302
|
+
for (const node of affectedNodes) {
|
|
303
|
+
this.applHost
|
|
304
|
+
.tryGetValueDB(node.id)
|
|
305
|
+
?.setValue(currentValueValueId, value);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
verifyChanges: () => {
|
|
311
|
+
if (this.isSinglecast()) {
|
|
312
|
+
// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
|
|
313
|
+
this.schedulePoll(currentValueValueId, value, {
|
|
314
|
+
duration,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
// For multicasts, do not schedule a refresh - this could cause a LOT of traffic
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
};
|
|
367
322
|
}
|
|
368
|
-
return result;
|
|
369
323
|
};
|
|
370
|
-
this[
|
|
324
|
+
this[_c] = async ({ property, propertyKey, }) => {
|
|
371
325
|
switch (property) {
|
|
372
326
|
case "currentValue":
|
|
373
327
|
case "targetValue":
|
|
@@ -454,7 +408,7 @@ let WindowCoveringCCAPI = class WindowCoveringCCAPI extends API_1.CCAPI {
|
|
|
454
408
|
return this.applHost.sendCommand(cc, this.commandOptions);
|
|
455
409
|
}
|
|
456
410
|
};
|
|
457
|
-
_a = API_1.SET_VALUE, _b = API_1.POLL_VALUE;
|
|
411
|
+
_a = API_1.SET_VALUE, _b = API_1.SET_VALUE_HOOKS, _c = API_1.POLL_VALUE;
|
|
458
412
|
WindowCoveringCCAPI = __decorate([
|
|
459
413
|
(0, CommandClassDecorators_1.API)(core_1.CommandClasses["Window Covering"])
|
|
460
414
|
], WindowCoveringCCAPI);
|
|
@@ -493,15 +447,9 @@ ${supported
|
|
|
493
447
|
this.setMetadata(applHost, exports.WindowCoveringCCValues.currentValue(param));
|
|
494
448
|
this.setMetadata(applHost, exports.WindowCoveringCCValues.targetValue(param));
|
|
495
449
|
this.setMetadata(applHost, exports.WindowCoveringCCValues.duration(param));
|
|
496
|
-
//
|
|
497
|
-
this.setMetadata(applHost, exports.WindowCoveringCCValues.
|
|
498
|
-
|
|
499
|
-
this.setMetadata(applHost, exports.WindowCoveringCCValues.tiltClose0(param));
|
|
500
|
-
this.setMetadata(applHost, exports.WindowCoveringCCValues.tiltClose99(param));
|
|
501
|
-
}
|
|
502
|
-
else {
|
|
503
|
-
this.setMetadata(applHost, exports.WindowCoveringCCValues.positionClose(param));
|
|
504
|
-
}
|
|
450
|
+
// Level change values
|
|
451
|
+
this.setMetadata(applHost, exports.WindowCoveringCCValues.levelChangeUp(param));
|
|
452
|
+
this.setMetadata(applHost, exports.WindowCoveringCCValues.levelChangeDown(param));
|
|
505
453
|
// And for the odd parameters (with position support), query the position
|
|
506
454
|
if (param % 2 === 1) {
|
|
507
455
|
applHost.controllerLog.logNode(node.id, {
|