zigbee-clusters 2.8.0 → 2.8.1
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/index.d.ts +503 -177
- package/package.json +1 -1
- package/scripts/generate-types.js +54 -23
package/index.d.ts
CHANGED
|
@@ -14,27 +14,44 @@ type ConstructorOptions = {
|
|
|
14
14
|
sendFrame: (endpointId: number, clusterId: number, frame: Buffer) => Promise<void>;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
type ClusterCommandOptions = {
|
|
18
|
+
timeout?: number;
|
|
19
|
+
waitForResponse?: boolean;
|
|
20
|
+
disableDefaultResponse?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type ZCLNodeConstructorInput = {
|
|
24
|
+
endpointDescriptors?: EndpointDescriptor[];
|
|
25
|
+
sendFrame: (endpointId: number, clusterId: number, frame: Buffer) => Promise<void>;
|
|
26
|
+
handleFrame?: (
|
|
27
|
+
endpointId: number,
|
|
28
|
+
clusterId: number,
|
|
29
|
+
frame: Buffer,
|
|
30
|
+
meta?: unknown
|
|
31
|
+
) => Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
|
|
17
34
|
export interface ZCLNodeCluster extends EventEmitter {
|
|
18
|
-
discoverCommandsGenerated(
|
|
35
|
+
discoverCommandsGenerated(params?: {
|
|
19
36
|
startValue?: number;
|
|
20
37
|
maxResults?: number;
|
|
21
|
-
}): Promise<number[]>;
|
|
38
|
+
}, opts?: { timeout?: number }): Promise<(string | number)[]>;
|
|
22
39
|
|
|
23
|
-
discoverCommandsReceived(
|
|
40
|
+
discoverCommandsReceived(params?: {
|
|
24
41
|
startValue?: number;
|
|
25
42
|
maxResults?: number;
|
|
26
|
-
}): Promise<number[]>;
|
|
43
|
+
}, opts?: { timeout?: number }): Promise<(string | number)[]>;
|
|
27
44
|
|
|
28
45
|
readAttributes(
|
|
29
|
-
|
|
46
|
+
attributes: Array<string | number>,
|
|
30
47
|
opts?: { timeout?: number }
|
|
31
48
|
): Promise<{ [x: string]: unknown }>;
|
|
32
49
|
|
|
33
|
-
writeAttributes(attributes?: object): Promise<
|
|
50
|
+
writeAttributes(attributes?: object, opts?: { timeout?: number }): Promise<unknown>;
|
|
34
51
|
|
|
35
|
-
configureReporting(attributes?: object): Promise<void>;
|
|
52
|
+
configureReporting(attributes?: object, opts?: { timeout?: number }): Promise<void>;
|
|
36
53
|
|
|
37
|
-
readReportingConfiguration(attributes?: (string | number)[]): Promise<{
|
|
54
|
+
readReportingConfiguration(attributes?: (string | number)[], opts?: { timeout?: number }): Promise<{
|
|
38
55
|
status: string;
|
|
39
56
|
direction: 'reported' | 'received';
|
|
40
57
|
attributeId: number;
|
|
@@ -45,19 +62,20 @@ export interface ZCLNodeCluster extends EventEmitter {
|
|
|
45
62
|
timeoutPeriod?: number;
|
|
46
63
|
}[]>;
|
|
47
64
|
|
|
48
|
-
discoverAttributes(): Promise<(string | number)[]>;
|
|
65
|
+
discoverAttributes(opts?: { timeout?: number }): Promise<(string | number)[]>;
|
|
49
66
|
|
|
50
|
-
discoverAttributesExtended(): Promise<{
|
|
67
|
+
discoverAttributesExtended(opts?: { timeout?: number }): Promise<{
|
|
51
68
|
name?: string;
|
|
52
69
|
id: number;
|
|
70
|
+
dataTypeId: number;
|
|
53
71
|
acl: { readable: boolean; writable: boolean; reportable: boolean };
|
|
54
72
|
}[]>;
|
|
55
73
|
}
|
|
56
74
|
|
|
57
75
|
export interface AlarmsCluster extends ZCLNodeCluster {
|
|
58
|
-
resetAllAlarms(): Promise<void>;
|
|
59
|
-
getAlarm(): Promise<void>;
|
|
60
|
-
resetAlarmLog(): Promise<void>;
|
|
76
|
+
resetAllAlarms(opts?: ClusterCommandOptions): Promise<void>;
|
|
77
|
+
getAlarm(opts?: ClusterCommandOptions): Promise<void>;
|
|
78
|
+
resetAlarmLog(opts?: ClusterCommandOptions): Promise<void>;
|
|
61
79
|
}
|
|
62
80
|
|
|
63
81
|
export interface AnalogInputClusterAttributes {
|
|
@@ -74,7 +92,8 @@ export interface AnalogInputClusterAttributes {
|
|
|
74
92
|
|
|
75
93
|
export interface AnalogInputCluster extends ZCLNodeCluster {
|
|
76
94
|
readAttributes<K extends 'description' | 'maxPresentValue' | 'minPresentValue' | 'outOfService' | 'presentValue' | 'reliability' | 'resolution' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<AnalogInputClusterAttributes, K>>;
|
|
77
|
-
|
|
95
|
+
readAttributes(attributeNames: Array<keyof AnalogInputClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<AnalogInputClusterAttributes> & Record<number, unknown>>;
|
|
96
|
+
writeAttributes(attributes: Partial<AnalogInputClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
78
97
|
}
|
|
79
98
|
|
|
80
99
|
export interface AnalogOutputClusterAttributes {
|
|
@@ -92,7 +111,8 @@ export interface AnalogOutputClusterAttributes {
|
|
|
92
111
|
|
|
93
112
|
export interface AnalogOutputCluster extends ZCLNodeCluster {
|
|
94
113
|
readAttributes<K extends 'description' | 'maxPresentValue' | 'minPresentValue' | 'outOfService' | 'presentValue' | 'reliability' | 'relinquishDefault' | 'resolution' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<AnalogOutputClusterAttributes, K>>;
|
|
95
|
-
|
|
114
|
+
readAttributes(attributeNames: Array<keyof AnalogOutputClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<AnalogOutputClusterAttributes> & Record<number, unknown>>;
|
|
115
|
+
writeAttributes(attributes: Partial<AnalogOutputClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
96
116
|
}
|
|
97
117
|
|
|
98
118
|
export interface AnalogValueClusterAttributes {
|
|
@@ -107,7 +127,8 @@ export interface AnalogValueClusterAttributes {
|
|
|
107
127
|
|
|
108
128
|
export interface AnalogValueCluster extends ZCLNodeCluster {
|
|
109
129
|
readAttributes<K extends 'description' | 'outOfService' | 'presentValue' | 'reliability' | 'relinquishDefault' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<AnalogValueClusterAttributes, K>>;
|
|
110
|
-
|
|
130
|
+
readAttributes(attributeNames: Array<keyof AnalogValueClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<AnalogValueClusterAttributes> & Record<number, unknown>>;
|
|
131
|
+
writeAttributes(attributes: Partial<AnalogValueClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
111
132
|
}
|
|
112
133
|
|
|
113
134
|
export interface BallastConfigurationClusterAttributes {
|
|
@@ -131,7 +152,8 @@ export interface BallastConfigurationClusterAttributes {
|
|
|
131
152
|
|
|
132
153
|
export interface BallastConfigurationCluster extends ZCLNodeCluster {
|
|
133
154
|
readAttributes<K extends 'physicalMinLevel' | 'physicalMaxLevel' | 'ballastStatus' | 'minLevel' | 'maxLevel' | 'powerOnLevel' | 'powerOnFadeTime' | 'intrinsicBallastFactor' | 'ballastFactorAdjustment' | 'lampQuantity' | 'lampType' | 'lampManufacturer' | 'lampRatedHours' | 'lampBurnHours' | 'lampAlarmMode' | 'lampBurnHoursTripPoint'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<BallastConfigurationClusterAttributes, K>>;
|
|
134
|
-
|
|
155
|
+
readAttributes(attributeNames: Array<keyof BallastConfigurationClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<BallastConfigurationClusterAttributes> & Record<number, unknown>>;
|
|
156
|
+
writeAttributes(attributes: Partial<BallastConfigurationClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
135
157
|
}
|
|
136
158
|
|
|
137
159
|
export interface BasicClusterAttributes {
|
|
@@ -154,8 +176,9 @@ export interface BasicClusterAttributes {
|
|
|
154
176
|
|
|
155
177
|
export interface BasicCluster extends ZCLNodeCluster {
|
|
156
178
|
readAttributes<K extends 'zclVersion' | 'appVersion' | 'stackVersion' | 'hwVersion' | 'manufacturerName' | 'modelId' | 'dateCode' | 'powerSource' | 'appProfileVersion' | 'locationDesc' | 'physicalEnv' | 'deviceEnabled' | 'alarmMask' | 'disableLocalConfig' | 'swBuildId'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<BasicClusterAttributes, K>>;
|
|
157
|
-
|
|
158
|
-
|
|
179
|
+
readAttributes(attributeNames: Array<keyof BasicClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<BasicClusterAttributes> & Record<number, unknown>>;
|
|
180
|
+
writeAttributes(attributes: Partial<BasicClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
181
|
+
factoryReset(opts?: ClusterCommandOptions): Promise<void>;
|
|
159
182
|
}
|
|
160
183
|
|
|
161
184
|
export interface BinaryInputClusterAttributes {
|
|
@@ -172,7 +195,8 @@ export interface BinaryInputClusterAttributes {
|
|
|
172
195
|
|
|
173
196
|
export interface BinaryInputCluster extends ZCLNodeCluster {
|
|
174
197
|
readAttributes<K extends 'activeText' | 'description' | 'inactiveText' | 'outOfService' | 'polarity' | 'presentValue' | 'reliability' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<BinaryInputClusterAttributes, K>>;
|
|
175
|
-
|
|
198
|
+
readAttributes(attributeNames: Array<keyof BinaryInputClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<BinaryInputClusterAttributes> & Record<number, unknown>>;
|
|
199
|
+
writeAttributes(attributes: Partial<BinaryInputClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
176
200
|
}
|
|
177
201
|
|
|
178
202
|
export interface BinaryOutputClusterAttributes {
|
|
@@ -192,7 +216,8 @@ export interface BinaryOutputClusterAttributes {
|
|
|
192
216
|
|
|
193
217
|
export interface BinaryOutputCluster extends ZCLNodeCluster {
|
|
194
218
|
readAttributes<K extends 'activeText' | 'description' | 'inactiveText' | 'minimumOffTime' | 'minimumOnTime' | 'outOfService' | 'polarity' | 'presentValue' | 'reliability' | 'relinquishDefault' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<BinaryOutputClusterAttributes, K>>;
|
|
195
|
-
|
|
219
|
+
readAttributes(attributeNames: Array<keyof BinaryOutputClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<BinaryOutputClusterAttributes> & Record<number, unknown>>;
|
|
220
|
+
writeAttributes(attributes: Partial<BinaryOutputClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
196
221
|
}
|
|
197
222
|
|
|
198
223
|
export interface BinaryValueClusterAttributes {
|
|
@@ -212,7 +237,8 @@ export interface BinaryValueClusterAttributes {
|
|
|
212
237
|
|
|
213
238
|
export interface BinaryValueCluster extends ZCLNodeCluster {
|
|
214
239
|
readAttributes<K extends 'activeText' | 'description' | 'inactiveText' | 'minimumOffTime' | 'minimumOnTime' | 'outOfService' | 'polarity' | 'presentValue' | 'reliability' | 'relinquishDefault' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<BinaryValueClusterAttributes, K>>;
|
|
215
|
-
|
|
240
|
+
readAttributes(attributeNames: Array<keyof BinaryValueClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<BinaryValueClusterAttributes> & Record<number, unknown>>;
|
|
241
|
+
writeAttributes(attributes: Partial<BinaryValueClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
216
242
|
}
|
|
217
243
|
|
|
218
244
|
export interface ColorControlClusterAttributes {
|
|
@@ -229,12 +255,13 @@ export interface ColorControlClusterAttributes {
|
|
|
229
255
|
|
|
230
256
|
export interface ColorControlCluster extends ZCLNodeCluster {
|
|
231
257
|
readAttributes<K extends 'currentHue' | 'currentSaturation' | 'currentX' | 'currentY' | 'colorTemperatureMireds' | 'colorMode' | 'colorCapabilities' | 'colorTempPhysicalMinMireds' | 'colorTempPhysicalMaxMireds'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<ColorControlClusterAttributes, K>>;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
258
|
+
readAttributes(attributeNames: Array<keyof ColorControlClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<ColorControlClusterAttributes> & Record<number, unknown>>;
|
|
259
|
+
writeAttributes(attributes: Partial<ColorControlClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
260
|
+
moveToHue(args: { hue: number; direction: 'shortestDistance' | 'longestDistance' | 'up' | 'down'; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
261
|
+
moveToSaturation(args: { saturation: number; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
262
|
+
moveToHueAndSaturation(args: { hue: number; saturation: number; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
263
|
+
moveToColor(args: { colorX: number; colorY: number; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
264
|
+
moveToColorTemperature(args: { colorTemperature: number; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
238
265
|
}
|
|
239
266
|
|
|
240
267
|
export interface DehumidificationControlCluster extends ZCLNodeCluster {
|
|
@@ -254,7 +281,8 @@ export interface DeviceTemperatureClusterAttributes {
|
|
|
254
281
|
|
|
255
282
|
export interface DeviceTemperatureCluster extends ZCLNodeCluster {
|
|
256
283
|
readAttributes<K extends 'currentTemperature' | 'minTempExperienced' | 'maxTempExperienced' | 'overTempTotalDwell' | 'deviceTempAlarmMask' | 'lowTempThreshold' | 'highTempThreshold' | 'lowTempDwellTripPoint' | 'highTempDwellTripPoint'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<DeviceTemperatureClusterAttributes, K>>;
|
|
257
|
-
|
|
284
|
+
readAttributes(attributeNames: Array<keyof DeviceTemperatureClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<DeviceTemperatureClusterAttributes> & Record<number, unknown>>;
|
|
285
|
+
writeAttributes(attributes: Partial<DeviceTemperatureClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
258
286
|
}
|
|
259
287
|
|
|
260
288
|
export interface DiagnosticsCluster extends ZCLNodeCluster {
|
|
@@ -308,35 +336,36 @@ export interface DoorLockClusterAttributes {
|
|
|
308
336
|
|
|
309
337
|
export interface DoorLockCluster extends ZCLNodeCluster {
|
|
310
338
|
readAttributes<K extends 'lockState' | 'lockType' | 'actuatorEnabled' | 'doorState' | 'doorOpenEvents' | 'doorClosedEvents' | 'openPeriod' | 'numberOfLogRecordsSupported' | 'numberOfTotalUsersSupported' | 'numberOfPINUsersSupported' | 'numberOfRFIDUsersSupported' | 'numberOfWeekDaySchedulesSupportedPerUser' | 'numberOfYearDaySchedulesSupportedPerUser' | 'numberOfHolidaySchedulesSupported' | 'maxPINCodeLength' | 'minPINCodeLength' | 'maxRFIDCodeLength' | 'minRFIDCodeLength' | 'enableLogging' | 'language' | 'ledSettings' | 'autoRelockTime' | 'soundVolume' | 'operatingMode' | 'supportedOperatingModes' | 'defaultConfigurationRegister' | 'enableLocalProgramming' | 'enableOneTouchLocking' | 'enableInsideStatusLED' | 'enablePrivacyModeButton' | 'wrongCodeEntryLimit' | 'userCodeTemporaryDisableTime' | 'sendPINOverTheAir' | 'requirePINforRFOperation' | 'securityLevel' | 'alarmMask' | 'keypadOperationEventMask' | 'rfOperationEventMask' | 'manualOperationEventMask' | 'rfidOperationEventMask' | 'keypadProgrammingEventMask' | 'rfProgrammingEventMask' | 'rfidProgrammingEventMask'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<DoorLockClusterAttributes, K>>;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
339
|
+
readAttributes(attributeNames: Array<keyof DoorLockClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<DoorLockClusterAttributes> & Record<number, unknown>>;
|
|
340
|
+
writeAttributes(attributes: Partial<DoorLockClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
341
|
+
lockDoor(args?: { pinCode?: Buffer }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
342
|
+
unlockDoor(args?: { pinCode?: Buffer }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
343
|
+
toggle(args?: { pinCode?: Buffer }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
344
|
+
unlockWithTimeout(args: { timeout: number; pinCode?: Buffer }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
345
|
+
getLogRecord(args: { logIndex: number }, opts?: ClusterCommandOptions): Promise<{ logEntryId: number; timestamp: number; eventType: number; source: number; eventIdOrAlarmCode: number; userId: number; pin: Buffer }>;
|
|
346
|
+
setPINCode(args: { userId: number; userStatus: 'available' | 'occupiedEnabled' | 'occupiedDisabled' | 'notSupported'; userType: 'unrestricted' | 'yearDayScheduleUser' | 'weekDayScheduleUser' | 'masterUser' | 'nonAccessUser' | 'notSupported'; pinCode?: Buffer }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
347
|
+
getPINCode(args: { userId: number }, opts?: ClusterCommandOptions): Promise<{ userId: number; userStatus: 'available' | 'occupiedEnabled' | 'occupiedDisabled' | 'notSupported'; userType: 'unrestricted' | 'yearDayScheduleUser' | 'weekDayScheduleUser' | 'masterUser' | 'nonAccessUser' | 'notSupported'; pinCode: Buffer }>;
|
|
348
|
+
clearPINCode(args: { userId: number }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
349
|
+
clearAllPINCodes(opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
350
|
+
setUserStatus(args: { userId: number; userStatus: 'available' | 'occupiedEnabled' | 'occupiedDisabled' | 'notSupported' }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
351
|
+
getUserStatus(args: { userId: number }, opts?: ClusterCommandOptions): Promise<{ userId: number; userStatus: 'available' | 'occupiedEnabled' | 'occupiedDisabled' | 'notSupported' }>;
|
|
352
|
+
setWeekDaySchedule(args: { scheduleId: number; userId: number; daysMask: Partial<{ sunday: boolean; monday: boolean; tuesday: boolean; wednesday: boolean; thursday: boolean; friday: boolean; saturday: boolean }>; startHour: number; startMinute: number; endHour: number; endMinute: number }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
353
|
+
getWeekDaySchedule(args: { scheduleId: number; userId: number }, opts?: ClusterCommandOptions): Promise<{ scheduleId: number; userId: number; status: number; daysMask: Partial<{ sunday: boolean; monday: boolean; tuesday: boolean; wednesday: boolean; thursday: boolean; friday: boolean; saturday: boolean }>; startHour: number; startMinute: number; endHour: number; endMinute: number }>;
|
|
354
|
+
clearWeekDaySchedule(args: { scheduleId: number; userId: number }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
355
|
+
setYearDaySchedule(args: { scheduleId: number; userId: number; localStartTime: number; localEndTime: number }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
356
|
+
getYearDaySchedule(args: { scheduleId: number; userId: number }, opts?: ClusterCommandOptions): Promise<{ scheduleId: number; userId: number; status: number; localStartTime: number; localEndTime: number }>;
|
|
357
|
+
clearYearDaySchedule(args: { scheduleId: number; userId: number }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
358
|
+
setHolidaySchedule(args: { holidayScheduleId: number; localStartTime: number; localEndTime: number; operatingModeDuringHoliday: 'normal' | 'vacation' | 'privacy' | 'noRFLockOrUnlock' | 'passage' }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
359
|
+
getHolidaySchedule(args: { holidayScheduleId: number }, opts?: ClusterCommandOptions): Promise<{ holidayScheduleId: number; status: number; localStartTime: number; localEndTime: number; operatingMode: 'normal' | 'vacation' | 'privacy' | 'noRFLockOrUnlock' | 'passage' }>;
|
|
360
|
+
clearHolidaySchedule(args: { holidayScheduleId: number }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
361
|
+
setUserType(args: { userId: number; userType: 'unrestricted' | 'yearDayScheduleUser' | 'weekDayScheduleUser' | 'masterUser' | 'nonAccessUser' | 'notSupported' }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
362
|
+
getUserType(args: { userId: number }, opts?: ClusterCommandOptions): Promise<{ userId: number; userType: 'unrestricted' | 'yearDayScheduleUser' | 'weekDayScheduleUser' | 'masterUser' | 'nonAccessUser' | 'notSupported' }>;
|
|
363
|
+
setRFIDCode(args: { userId: number; userStatus: 'available' | 'occupiedEnabled' | 'occupiedDisabled' | 'notSupported'; userType: 'unrestricted' | 'yearDayScheduleUser' | 'weekDayScheduleUser' | 'masterUser' | 'nonAccessUser' | 'notSupported'; rfidCode?: Buffer }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
364
|
+
getRFIDCode(args: { userId: number }, opts?: ClusterCommandOptions): Promise<{ userId: number; userStatus: 'available' | 'occupiedEnabled' | 'occupiedDisabled' | 'notSupported'; userType: 'unrestricted' | 'yearDayScheduleUser' | 'weekDayScheduleUser' | 'masterUser' | 'nonAccessUser' | 'notSupported'; rfidCode: Buffer }>;
|
|
365
|
+
clearRFIDCode(args: { userId: number }, opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
366
|
+
clearAllRFIDCodes(opts?: ClusterCommandOptions): Promise<{ status: number }>;
|
|
367
|
+
operationEventNotification(args: { operationEventSource: number; operationEventCode: number; userId: number; pin?: Buffer; zigBeeLocalTime: number; data?: Buffer }, opts?: ClusterCommandOptions): Promise<void>;
|
|
368
|
+
programmingEventNotification(args: { programEventSource: number; programEventCode: number; userId: number; pin?: Buffer; userType: 'unrestricted' | 'yearDayScheduleUser' | 'weekDayScheduleUser' | 'masterUser' | 'nonAccessUser' | 'notSupported'; userStatus: 'available' | 'occupiedEnabled' | 'occupiedDisabled' | 'notSupported'; zigBeeLocalTime: number; data?: Buffer }, opts?: ClusterCommandOptions): Promise<void>;
|
|
340
369
|
}
|
|
341
370
|
|
|
342
371
|
export interface ElectricalMeasurementClusterAttributes {
|
|
@@ -364,7 +393,8 @@ export interface ElectricalMeasurementClusterAttributes {
|
|
|
364
393
|
|
|
365
394
|
export interface ElectricalMeasurementCluster extends ZCLNodeCluster {
|
|
366
395
|
readAttributes<K extends 'measurementType' | 'acFrequency' | 'measuredPhase1stHarmonicCurrent' | 'acFrequencyMultiplier' | 'acFrequencyDivisor' | 'phaseHarmonicCurrentMultiplier' | 'rmsVoltage' | 'rmsCurrent' | 'activePower' | 'reactivePower' | 'acVoltageMultiplier' | 'acVoltageDivisor' | 'acCurrentMultiplier' | 'acCurrentDivisor' | 'acPowerMultiplier' | 'acPowerDivisor' | 'acAlarmsMask' | 'acVoltageOverload' | 'acCurrentOverload' | 'acActivePowerOverload'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<ElectricalMeasurementClusterAttributes, K>>;
|
|
367
|
-
|
|
396
|
+
readAttributes(attributeNames: Array<keyof ElectricalMeasurementClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<ElectricalMeasurementClusterAttributes> & Record<number, unknown>>;
|
|
397
|
+
writeAttributes(attributes: Partial<ElectricalMeasurementClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
368
398
|
}
|
|
369
399
|
|
|
370
400
|
export interface FanControlCluster extends ZCLNodeCluster {
|
|
@@ -379,7 +409,8 @@ export interface FlowMeasurementClusterAttributes {
|
|
|
379
409
|
|
|
380
410
|
export interface FlowMeasurementCluster extends ZCLNodeCluster {
|
|
381
411
|
readAttributes<K extends 'measuredValue' | 'minMeasuredValue' | 'maxMeasuredValue' | 'tolerance'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<FlowMeasurementClusterAttributes, K>>;
|
|
382
|
-
|
|
412
|
+
readAttributes(attributeNames: Array<keyof FlowMeasurementClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<FlowMeasurementClusterAttributes> & Record<number, unknown>>;
|
|
413
|
+
writeAttributes(attributes: Partial<FlowMeasurementClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
383
414
|
}
|
|
384
415
|
|
|
385
416
|
export interface GroupsClusterAttributes {
|
|
@@ -388,22 +419,23 @@ export interface GroupsClusterAttributes {
|
|
|
388
419
|
|
|
389
420
|
export interface GroupsCluster extends ZCLNodeCluster {
|
|
390
421
|
readAttributes<K extends 'nameSupport'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<GroupsClusterAttributes, K>>;
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
422
|
+
readAttributes(attributeNames: Array<keyof GroupsClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<GroupsClusterAttributes> & Record<number, unknown>>;
|
|
423
|
+
writeAttributes(attributes: Partial<GroupsClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
424
|
+
addGroup(args: { groupId: number; groupName: string }, opts?: ClusterCommandOptions): Promise<{ status: 'SUCCESS' | 'FAILURE' | 'NOT_AUTHORIZED' | 'RESERVED_FIELD_NOT_ZERO' | 'MALFORMED_COMMAND' | 'UNSUP_CLUSTER_COMMAND' | 'UNSUP_GENERAL_COMMAND' | 'UNSUP_MANUF_CLUSTER_COMMAND' | 'UNSUP_MANUF_GENERAL_COMMAND' | 'INVALID_FIELD' | 'UNSUPPORTED_ATTRIBUTE' | 'INVALID_VALUE' | 'READ_ONLY' | 'INSUFFICIENT_SPACE' | 'DUPLICATE_EXISTS' | 'NOT_FOUND' | 'UNREPORTABLE_ATTRIBUTE' | 'INVALID_DATA_TYPE' | 'INVALID_SELECTOR' | 'WRITE_ONLY' | 'INCONSISTENT_STARTUP_STATE' | 'DEFINED_OUT_OF_BAND' | 'INCONSISTENT' | 'ACTION_DENIED' | 'TIMEOUT' | 'ABORT' | 'INVALID_IMAGE' | 'WAIT_FOR_DATA' | 'NO_IMAGE_AVAILABLE' | 'REQUIRE_MORE_IMAGE' | 'NOTIFICATION_PENDING' | 'HARDWARE_FAILURE' | 'SOFTWARE_FAILURE' | 'CALIBRATION_ERROR' | 'UNSUPPORTED_CLUSTER'; groupId: number }>;
|
|
425
|
+
viewGroup(args: { groupId: number }, opts?: ClusterCommandOptions): Promise<{ status: 'SUCCESS' | 'FAILURE' | 'NOT_AUTHORIZED' | 'RESERVED_FIELD_NOT_ZERO' | 'MALFORMED_COMMAND' | 'UNSUP_CLUSTER_COMMAND' | 'UNSUP_GENERAL_COMMAND' | 'UNSUP_MANUF_CLUSTER_COMMAND' | 'UNSUP_MANUF_GENERAL_COMMAND' | 'INVALID_FIELD' | 'UNSUPPORTED_ATTRIBUTE' | 'INVALID_VALUE' | 'READ_ONLY' | 'INSUFFICIENT_SPACE' | 'DUPLICATE_EXISTS' | 'NOT_FOUND' | 'UNREPORTABLE_ATTRIBUTE' | 'INVALID_DATA_TYPE' | 'INVALID_SELECTOR' | 'WRITE_ONLY' | 'INCONSISTENT_STARTUP_STATE' | 'DEFINED_OUT_OF_BAND' | 'INCONSISTENT' | 'ACTION_DENIED' | 'TIMEOUT' | 'ABORT' | 'INVALID_IMAGE' | 'WAIT_FOR_DATA' | 'NO_IMAGE_AVAILABLE' | 'REQUIRE_MORE_IMAGE' | 'NOTIFICATION_PENDING' | 'HARDWARE_FAILURE' | 'SOFTWARE_FAILURE' | 'CALIBRATION_ERROR' | 'UNSUPPORTED_CLUSTER'; groupId: number; groupNames: string }>;
|
|
426
|
+
getGroupMembership(args: { groupIds: number[] }, opts?: ClusterCommandOptions): Promise<{ capacity: number; groups: number[] }>;
|
|
427
|
+
removeGroup(args: { groupId: number }, opts?: ClusterCommandOptions): Promise<{ status: 'SUCCESS' | 'FAILURE' | 'NOT_AUTHORIZED' | 'RESERVED_FIELD_NOT_ZERO' | 'MALFORMED_COMMAND' | 'UNSUP_CLUSTER_COMMAND' | 'UNSUP_GENERAL_COMMAND' | 'UNSUP_MANUF_CLUSTER_COMMAND' | 'UNSUP_MANUF_GENERAL_COMMAND' | 'INVALID_FIELD' | 'UNSUPPORTED_ATTRIBUTE' | 'INVALID_VALUE' | 'READ_ONLY' | 'INSUFFICIENT_SPACE' | 'DUPLICATE_EXISTS' | 'NOT_FOUND' | 'UNREPORTABLE_ATTRIBUTE' | 'INVALID_DATA_TYPE' | 'INVALID_SELECTOR' | 'WRITE_ONLY' | 'INCONSISTENT_STARTUP_STATE' | 'DEFINED_OUT_OF_BAND' | 'INCONSISTENT' | 'ACTION_DENIED' | 'TIMEOUT' | 'ABORT' | 'INVALID_IMAGE' | 'WAIT_FOR_DATA' | 'NO_IMAGE_AVAILABLE' | 'REQUIRE_MORE_IMAGE' | 'NOTIFICATION_PENDING' | 'HARDWARE_FAILURE' | 'SOFTWARE_FAILURE' | 'CALIBRATION_ERROR' | 'UNSUPPORTED_CLUSTER'; groupId: number }>;
|
|
428
|
+
removeAllGroups(opts?: ClusterCommandOptions): Promise<void>;
|
|
429
|
+
addGroupIfIdentify(args: { groupId: number; groupName: string }, opts?: ClusterCommandOptions): Promise<void>;
|
|
398
430
|
}
|
|
399
431
|
|
|
400
|
-
export interface
|
|
432
|
+
export interface IASACECluster extends ZCLNodeCluster {
|
|
401
433
|
}
|
|
402
434
|
|
|
403
|
-
export interface
|
|
435
|
+
export interface IASWDCluster extends ZCLNodeCluster {
|
|
404
436
|
}
|
|
405
437
|
|
|
406
|
-
export interface
|
|
438
|
+
export interface IASZoneClusterAttributes {
|
|
407
439
|
zoneState?: 'notEnrolled' | 'enrolled';
|
|
408
440
|
zoneType?: 'standardCIE' | 'motionSensor' | 'contactSwitch' | 'fireSensor' | 'waterSensor' | 'cabonMonoxideSensor' | 'personalEmergencyDevice' | 'vibrationMovementSensor' | 'remoteControl' | 'keyfob' | 'keypad' | 'standardWarningDevice' | 'glassBreakSensor' | 'securityRepeater' | 'invalidZoneType';
|
|
409
441
|
zoneStatus?: Partial<{ alarm1: boolean; alarm2: boolean; tamper: boolean; battery: boolean; supervisionReports: boolean; restoreReports: boolean; trouble: boolean; acMains: boolean; test: boolean; batteryDefect: boolean }>;
|
|
@@ -411,13 +443,14 @@ export interface IasZoneClusterAttributes {
|
|
|
411
443
|
zoneId?: number;
|
|
412
444
|
}
|
|
413
445
|
|
|
414
|
-
export interface
|
|
415
|
-
readAttributes<K extends 'zoneState' | 'zoneType' | 'zoneStatus' | 'iasCIEAddress' | 'zoneId'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
446
|
+
export interface IASZoneCluster extends ZCLNodeCluster {
|
|
447
|
+
readAttributes<K extends 'zoneState' | 'zoneType' | 'zoneStatus' | 'iasCIEAddress' | 'zoneId'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<IASZoneClusterAttributes, K>>;
|
|
448
|
+
readAttributes(attributeNames: Array<keyof IASZoneClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<IASZoneClusterAttributes> & Record<number, unknown>>;
|
|
449
|
+
writeAttributes(attributes: Partial<IASZoneClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
450
|
+
zoneStatusChangeNotification(args: { zoneStatus: Partial<{ alarm1: boolean; alarm2: boolean; tamper: boolean; battery: boolean; supervisionReports: boolean; restoreReports: boolean; trouble: boolean; acMains: boolean; test: boolean; batteryDefect: boolean }>; extendedStatus: number; zoneId: number; delay: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
451
|
+
zoneEnrollResponse(args: { enrollResponseCode: 'success' | 'notSupported' | 'noEnrollPermit' | 'tooManyZones'; zoneId: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
452
|
+
zoneEnrollRequest(args: { zoneType: 'standard' | 'motionSensor' | 'contactSwitch' | 'fireSensor' | 'waterSensor' | 'carbonMonoxideSensor' | 'personalEmergencyDevice' | 'vibrationMovementSensor' | 'remoteControl' | 'keyFob' | 'keyPad' | 'standardWarningDevice' | 'glassBreakSensor' | 'securityRepeater' | 'invalid'; manufacturerCode: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
453
|
+
initiateNormalOperationMode(opts?: ClusterCommandOptions): Promise<void>;
|
|
421
454
|
}
|
|
422
455
|
|
|
423
456
|
export interface IdentifyClusterAttributes {
|
|
@@ -426,10 +459,11 @@ export interface IdentifyClusterAttributes {
|
|
|
426
459
|
|
|
427
460
|
export interface IdentifyCluster extends ZCLNodeCluster {
|
|
428
461
|
readAttributes<K extends 'identifyTime'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<IdentifyClusterAttributes, K>>;
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
462
|
+
readAttributes(attributeNames: Array<keyof IdentifyClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<IdentifyClusterAttributes> & Record<number, unknown>>;
|
|
463
|
+
writeAttributes(attributes: Partial<IdentifyClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
464
|
+
identify(args: { identifyTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
465
|
+
identifyQuery(opts?: ClusterCommandOptions): Promise<{ timeout: number }>;
|
|
466
|
+
triggerEffect(args: { effectIdentifier: 'blink' | 'breathe' | 'okay' | 'channelChange' | 'finish' | 'stop'; effectVariant: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
433
467
|
}
|
|
434
468
|
|
|
435
469
|
export interface IlluminanceLevelSensingClusterAttributes {
|
|
@@ -440,7 +474,8 @@ export interface IlluminanceLevelSensingClusterAttributes {
|
|
|
440
474
|
|
|
441
475
|
export interface IlluminanceLevelSensingCluster extends ZCLNodeCluster {
|
|
442
476
|
readAttributes<K extends 'levelStatus' | 'lightSensorType' | 'illuminanceTargetLevel'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<IlluminanceLevelSensingClusterAttributes, K>>;
|
|
443
|
-
|
|
477
|
+
readAttributes(attributeNames: Array<keyof IlluminanceLevelSensingClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<IlluminanceLevelSensingClusterAttributes> & Record<number, unknown>>;
|
|
478
|
+
writeAttributes(attributes: Partial<IlluminanceLevelSensingClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
444
479
|
}
|
|
445
480
|
|
|
446
481
|
export interface IlluminanceMeasurementClusterAttributes {
|
|
@@ -453,7 +488,8 @@ export interface IlluminanceMeasurementClusterAttributes {
|
|
|
453
488
|
|
|
454
489
|
export interface IlluminanceMeasurementCluster extends ZCLNodeCluster {
|
|
455
490
|
readAttributes<K extends 'measuredValue' | 'minMeasuredValue' | 'maxMeasuredValue' | 'tolerance' | 'lightSensorType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<IlluminanceMeasurementClusterAttributes, K>>;
|
|
456
|
-
|
|
491
|
+
readAttributes(attributeNames: Array<keyof IlluminanceMeasurementClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<IlluminanceMeasurementClusterAttributes> & Record<number, unknown>>;
|
|
492
|
+
writeAttributes(attributes: Partial<IlluminanceMeasurementClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
457
493
|
}
|
|
458
494
|
|
|
459
495
|
export interface LevelControlClusterAttributes {
|
|
@@ -468,15 +504,16 @@ export interface LevelControlClusterAttributes {
|
|
|
468
504
|
|
|
469
505
|
export interface LevelControlCluster extends ZCLNodeCluster {
|
|
470
506
|
readAttributes<K extends 'currentLevel' | 'remainingTime' | 'onOffTransitionTime' | 'onLevel' | 'onTransitionTime' | 'offTransitionTime' | 'defaultMoveRate'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<LevelControlClusterAttributes, K>>;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
507
|
+
readAttributes(attributeNames: Array<keyof LevelControlClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<LevelControlClusterAttributes> & Record<number, unknown>>;
|
|
508
|
+
writeAttributes(attributes: Partial<LevelControlClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
509
|
+
moveToLevel(args: { level: number; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
510
|
+
move(args: { moveMode: 'up' | 'down'; rate: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
511
|
+
step(args: { mode: 'up' | 'down'; stepSize: number; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
512
|
+
stop(opts?: ClusterCommandOptions): Promise<void>;
|
|
513
|
+
moveToLevelWithOnOff(args: { level: number; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
514
|
+
moveWithOnOff(args: { moveMode: 'up' | 'down'; rate: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
515
|
+
stepWithOnOff(args: { mode: 'up' | 'down'; stepSize: number; transitionTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
516
|
+
stopWithOnOff(opts?: ClusterCommandOptions): Promise<void>;
|
|
480
517
|
}
|
|
481
518
|
|
|
482
519
|
export interface MeteringClusterAttributes {
|
|
@@ -685,7 +722,8 @@ export interface MeteringClusterAttributes {
|
|
|
685
722
|
|
|
686
723
|
export interface MeteringCluster extends ZCLNodeCluster {
|
|
687
724
|
readAttributes<K extends 'currentSummationDelivered' | 'currentSummationReceived' | 'currentMaxDemandDelivered' | 'currentMaxDemandReceived' | 'dftSummation' | 'dailyFreezeTime' | 'powerFactor' | 'readingSnapShotTime' | 'currentMaxDemandDeliveredTime' | 'currentMaxDemandReceivedTime' | 'defaultUpdatePeriod' | 'fastPollUpdatePeriod' | 'currentBlockPeriodConsumptionDelivered' | 'dailyConsumptionTarget' | 'currentBlock' | 'profileIntervalPeriod' | 'currentTier1SummationDelivered' | 'currentTier1SummationReceived' | 'currentTier2SummationDelivered' | 'currentTier2SummationReceived' | 'currentTier3SummationDelivered' | 'currentTier3SummationReceived' | 'currentTier4SummationDelivered' | 'currentTier4SummationReceived' | 'status' | 'remainingBatteryLife' | 'hoursInOperation' | 'hoursInFault' | 'extendedStatus' | 'unitOfMeasure' | 'multiplier' | 'divisor' | 'summationFormatting' | 'demandFormatting' | 'historicalConsumptionFormatting' | 'meteringDeviceType' | 'siteId' | 'meterSerialNumber' | 'energyCarrierUnitOfMeasure' | 'energyCarrierSummationFormatting' | 'energyCarrierDemandFormatting' | 'temperatureUnitOfMeasure' | 'temperatureFormatting' | 'moduleSerialNumber' | 'operatingTariffLabelDelivered' | 'operatingTariffLabelReceived' | 'customerIdNumber' | 'alternativeUnitOfMeasure' | 'alternativeDemandFormatting' | 'alternativeConsumptionFormatting' | 'instantaneousDemand' | 'currentDayConsumptionDelivered' | 'currentDayConsumptionReceived' | 'previousDayConsumptionDelivered' | 'previousDayConsumptionReceived' | 'currentPartialProfileIntervalStartTimeDelivered' | 'currentPartialProfileIntervalStartTimeReceived' | 'currentPartialProfileIntervalValueDelivered' | 'currentPartialProfileIntervalValueReceived' | 'currentDayMaxPressure' | 'currentDayMinPressure' | 'previousDayMaxPressure' | 'previousDayMinPressure' | 'currentDayMaxDemand' | 'previousDayMaxDemand' | 'currentMonthMaxDemand' | 'currentYearMaxDemand' | 'currentDayMaxEnergyCarrierDemand' | 'previousDayMaxEnergyCarrierDemand' | 'currentMonthMaxEnergyCarrierDemand' | 'currentMonthMinEnergyCarrierDemand' | 'currentYearMaxEnergyCarrierDemand' | 'currentYearMinEnergyCarrierDemand' | 'maxNumberOfPeriodsDelivered' | 'currentDemandDelivered' | 'demandLimit' | 'demandIntegrationPeriod' | 'numberOfDemandSubintervals' | 'demandLimitArmDuration' | 'currentNoTierBlock1SummationDelivered' | 'currentNoTierBlock2SummationDelivered' | 'currentNoTierBlock3SummationDelivered' | 'currentNoTierBlock4SummationDelivered' | 'currentNoTierBlock5SummationDelivered' | 'currentNoTierBlock6SummationDelivered' | 'currentNoTierBlock7SummationDelivered' | 'currentNoTierBlock8SummationDelivered' | 'currentNoTierBlock9SummationDelivered' | 'currentNoTierBlock10SummationDelivered' | 'currentNoTierBlock11SummationDelivered' | 'currentNoTierBlock12SummationDelivered' | 'currentNoTierBlock13SummationDelivered' | 'currentNoTierBlock14SummationDelivered' | 'currentNoTierBlock15SummationDelivered' | 'currentNoTierBlock16SummationDelivered' | 'currentTier1Block1SummationDelivered' | 'currentTier1Block2SummationDelivered' | 'currentTier1Block3SummationDelivered' | 'currentTier1Block4SummationDelivered' | 'currentTier1Block5SummationDelivered' | 'currentTier1Block6SummationDelivered' | 'currentTier1Block7SummationDelivered' | 'currentTier1Block8SummationDelivered' | 'currentTier1Block9SummationDelivered' | 'currentTier1Block10SummationDelivered' | 'currentTier1Block11SummationDelivered' | 'currentTier1Block12SummationDelivered' | 'currentTier1Block13SummationDelivered' | 'currentTier1Block14SummationDelivered' | 'currentTier1Block15SummationDelivered' | 'currentTier1Block16SummationDelivered' | 'currentTier2Block1SummationDelivered' | 'currentTier2Block2SummationDelivered' | 'currentTier2Block3SummationDelivered' | 'currentTier2Block4SummationDelivered' | 'currentTier2Block5SummationDelivered' | 'currentTier2Block6SummationDelivered' | 'currentTier2Block7SummationDelivered' | 'currentTier2Block8SummationDelivered' | 'currentTier2Block9SummationDelivered' | 'currentTier2Block10SummationDelivered' | 'currentTier2Block11SummationDelivered' | 'currentTier2Block12SummationDelivered' | 'currentTier2Block13SummationDelivered' | 'currentTier2Block14SummationDelivered' | 'currentTier2Block15SummationDelivered' | 'currentTier2Block16SummationDelivered' | 'currentTier3Block1SummationDelivered' | 'currentTier3Block2SummationDelivered' | 'currentTier3Block3SummationDelivered' | 'currentTier3Block4SummationDelivered' | 'currentTier3Block5SummationDelivered' | 'currentTier3Block6SummationDelivered' | 'currentTier3Block7SummationDelivered' | 'currentTier3Block8SummationDelivered' | 'currentTier3Block9SummationDelivered' | 'currentTier3Block10SummationDelivered' | 'currentTier3Block11SummationDelivered' | 'currentTier3Block12SummationDelivered' | 'currentTier3Block13SummationDelivered' | 'currentTier3Block14SummationDelivered' | 'currentTier3Block15SummationDelivered' | 'currentTier3Block16SummationDelivered' | 'currentTier4Block1SummationDelivered' | 'currentTier4Block2SummationDelivered' | 'currentTier4Block3SummationDelivered' | 'currentTier4Block4SummationDelivered' | 'currentTier4Block5SummationDelivered' | 'currentTier4Block6SummationDelivered' | 'currentTier4Block7SummationDelivered' | 'currentTier4Block8SummationDelivered' | 'currentTier4Block9SummationDelivered' | 'currentTier4Block10SummationDelivered' | 'currentTier4Block11SummationDelivered' | 'currentTier4Block12SummationDelivered' | 'currentTier4Block13SummationDelivered' | 'currentTier4Block14SummationDelivered' | 'currentTier4Block15SummationDelivered' | 'currentTier4Block16SummationDelivered' | 'genericAlarmMask' | 'electricityAlarmMask' | 'genericFlowPressureAlarmMask' | 'waterSpecificAlarmMask' | 'heatAndCoolingSpecificAlarmMask' | 'gasSpecificAlarmMask' | 'extendedGenericAlarmMask' | 'manufacturerAlarmMask' | 'currentNoTierBlock1SummationReceived' | 'currentNoTierBlock2SummationReceived' | 'currentNoTierBlock3SummationReceived' | 'currentNoTierBlock4SummationReceived' | 'currentNoTierBlock5SummationReceived' | 'currentNoTierBlock6SummationReceived' | 'currentNoTierBlock7SummationReceived' | 'currentNoTierBlock8SummationReceived' | 'currentNoTierBlock9SummationReceived' | 'currentNoTierBlock10SummationReceived' | 'currentNoTierBlock11SummationReceived' | 'currentNoTierBlock12SummationReceived' | 'currentNoTierBlock13SummationReceived' | 'currentNoTierBlock14SummationReceived' | 'currentNoTierBlock15SummationReceived' | 'currentNoTierBlock16SummationReceived' | 'billToDateDelivered' | 'billToDateTimeStampDelivered' | 'projectedBillDelivered' | 'projectedBillTimeStampDelivered' | 'billDeliveredTrailingDigit' | 'billToDateReceived' | 'billToDateTimeStampReceived' | 'projectedBillReceived' | 'projectedBillTimeStampReceived' | 'billReceivedTrailingDigit' | 'proposedChangeSupplyImplementationTime' | 'proposedChangeSupplyStatus' | 'uncontrolledFlowThreshold' | 'uncontrolledFlowThresholdUnitOfMeasure' | 'uncontrolledFlowMultiplier' | 'uncontrolledFlowDivisor' | 'flowStabilisationPeriod' | 'flowMeasurementPeriod'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<MeteringClusterAttributes, K>>;
|
|
688
|
-
|
|
725
|
+
readAttributes(attributeNames: Array<keyof MeteringClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<MeteringClusterAttributes> & Record<number, unknown>>;
|
|
726
|
+
writeAttributes(attributes: Partial<MeteringClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
689
727
|
}
|
|
690
728
|
|
|
691
729
|
export interface MultistateInputClusterAttributes {
|
|
@@ -700,7 +738,8 @@ export interface MultistateInputClusterAttributes {
|
|
|
700
738
|
|
|
701
739
|
export interface MultistateInputCluster extends ZCLNodeCluster {
|
|
702
740
|
readAttributes<K extends 'description' | 'numberOfStates' | 'outOfService' | 'presentValue' | 'reliability' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<MultistateInputClusterAttributes, K>>;
|
|
703
|
-
|
|
741
|
+
readAttributes(attributeNames: Array<keyof MultistateInputClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<MultistateInputClusterAttributes> & Record<number, unknown>>;
|
|
742
|
+
writeAttributes(attributes: Partial<MultistateInputClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
704
743
|
}
|
|
705
744
|
|
|
706
745
|
export interface MultistateOutputClusterAttributes {
|
|
@@ -716,7 +755,8 @@ export interface MultistateOutputClusterAttributes {
|
|
|
716
755
|
|
|
717
756
|
export interface MultistateOutputCluster extends ZCLNodeCluster {
|
|
718
757
|
readAttributes<K extends 'description' | 'numberOfStates' | 'outOfService' | 'presentValue' | 'reliability' | 'relinquishDefault' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<MultistateOutputClusterAttributes, K>>;
|
|
719
|
-
|
|
758
|
+
readAttributes(attributeNames: Array<keyof MultistateOutputClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<MultistateOutputClusterAttributes> & Record<number, unknown>>;
|
|
759
|
+
writeAttributes(attributes: Partial<MultistateOutputClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
720
760
|
}
|
|
721
761
|
|
|
722
762
|
export interface MultistateValueClusterAttributes {
|
|
@@ -732,7 +772,8 @@ export interface MultistateValueClusterAttributes {
|
|
|
732
772
|
|
|
733
773
|
export interface MultistateValueCluster extends ZCLNodeCluster {
|
|
734
774
|
readAttributes<K extends 'description' | 'numberOfStates' | 'outOfService' | 'presentValue' | 'reliability' | 'relinquishDefault' | 'statusFlags' | 'applicationType'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<MultistateValueClusterAttributes, K>>;
|
|
735
|
-
|
|
775
|
+
readAttributes(attributeNames: Array<keyof MultistateValueClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<MultistateValueClusterAttributes> & Record<number, unknown>>;
|
|
776
|
+
writeAttributes(attributes: Partial<MultistateValueClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
736
777
|
}
|
|
737
778
|
|
|
738
779
|
export interface OccupancySensingClusterAttributes {
|
|
@@ -752,7 +793,8 @@ export interface OccupancySensingClusterAttributes {
|
|
|
752
793
|
|
|
753
794
|
export interface OccupancySensingCluster extends ZCLNodeCluster {
|
|
754
795
|
readAttributes<K extends 'occupancy' | 'occupancySensorType' | 'occupancySensorTypeBitmap' | 'pirOccupiedToUnoccupiedDelay' | 'pirUnoccupiedToOccupiedDelay' | 'pirUnoccupiedToOccupiedThreshold' | 'ultrasonicOccupiedToUnoccupiedDelay' | 'ultrasonicUnoccupiedToOccupiedDelay' | 'ultrasonicUnoccupiedToOccupiedThreshold' | 'physicalContactOccupiedToUnoccupiedDelay' | 'physicalContactUnoccupiedToOccupiedDelay' | 'physicalContactUnoccupiedToOccupiedThreshold'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<OccupancySensingClusterAttributes, K>>;
|
|
755
|
-
|
|
796
|
+
readAttributes(attributeNames: Array<keyof OccupancySensingClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<OccupancySensingClusterAttributes> & Record<number, unknown>>;
|
|
797
|
+
writeAttributes(attributes: Partial<OccupancySensingClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
756
798
|
}
|
|
757
799
|
|
|
758
800
|
export interface OnOffClusterAttributes {
|
|
@@ -763,19 +805,20 @@ export interface OnOffClusterAttributes {
|
|
|
763
805
|
|
|
764
806
|
export interface OnOffCluster extends ZCLNodeCluster {
|
|
765
807
|
readAttributes<K extends 'onOff' | 'onTime' | 'offWaitTime'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<OnOffClusterAttributes, K>>;
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
808
|
+
readAttributes(attributeNames: Array<keyof OnOffClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<OnOffClusterAttributes> & Record<number, unknown>>;
|
|
809
|
+
writeAttributes(attributes: Partial<OnOffClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
810
|
+
setOff(opts?: ClusterCommandOptions): Promise<void>;
|
|
811
|
+
setOn(opts?: ClusterCommandOptions): Promise<void>;
|
|
812
|
+
toggle(opts?: ClusterCommandOptions): Promise<void>;
|
|
813
|
+
offWithEffect(args: { effectIdentifier: number; effectVariant: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
814
|
+
onWithRecallGlobalScene(opts?: ClusterCommandOptions): Promise<void>;
|
|
815
|
+
onWithTimedOff(args: { onOffControl: number; onTime: number; offWaitTime: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
773
816
|
}
|
|
774
817
|
|
|
775
818
|
export interface OnOffSwitchCluster extends ZCLNodeCluster {
|
|
776
819
|
}
|
|
777
820
|
|
|
778
|
-
export interface
|
|
821
|
+
export interface OTACluster extends ZCLNodeCluster {
|
|
779
822
|
}
|
|
780
823
|
|
|
781
824
|
export interface PollControlClusterAttributes {
|
|
@@ -790,10 +833,11 @@ export interface PollControlClusterAttributes {
|
|
|
790
833
|
|
|
791
834
|
export interface PollControlCluster extends ZCLNodeCluster {
|
|
792
835
|
readAttributes<K extends 'checkInInterval' | 'longPollInterval' | 'shortPollInterval' | 'fastPollTimeout' | 'checkInIntervalMin' | 'longPollIntervalMin' | 'fastPollTimeoutMax'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<PollControlClusterAttributes, K>>;
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
836
|
+
readAttributes(attributeNames: Array<keyof PollControlClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<PollControlClusterAttributes> & Record<number, unknown>>;
|
|
837
|
+
writeAttributes(attributes: Partial<PollControlClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
838
|
+
fastPollStop(opts?: ClusterCommandOptions): Promise<void>;
|
|
839
|
+
setLongPollInterval(args: { newLongPollInterval: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
840
|
+
setShortPollInterval(args: { newShortPollInterval: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
797
841
|
}
|
|
798
842
|
|
|
799
843
|
export interface PowerConfigurationClusterAttributes {
|
|
@@ -808,7 +852,8 @@ export interface PowerConfigurationClusterAttributes {
|
|
|
808
852
|
|
|
809
853
|
export interface PowerConfigurationCluster extends ZCLNodeCluster {
|
|
810
854
|
readAttributes<K extends 'batteryVoltage' | 'batteryPercentageRemaining' | 'batterySize' | 'batteryQuantity' | 'batteryRatedVoltage' | 'batteryVoltageMinThreshold' | 'batteryAlarmState'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<PowerConfigurationClusterAttributes, K>>;
|
|
811
|
-
|
|
855
|
+
readAttributes(attributeNames: Array<keyof PowerConfigurationClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<PowerConfigurationClusterAttributes> & Record<number, unknown>>;
|
|
856
|
+
writeAttributes(attributes: Partial<PowerConfigurationClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
812
857
|
}
|
|
813
858
|
|
|
814
859
|
export interface PowerProfileCluster extends ZCLNodeCluster {
|
|
@@ -828,7 +873,8 @@ export interface PressureMeasurementClusterAttributes {
|
|
|
828
873
|
|
|
829
874
|
export interface PressureMeasurementCluster extends ZCLNodeCluster {
|
|
830
875
|
readAttributes<K extends 'measuredValue' | 'minMeasuredValue' | 'maxMeasuredValue' | 'tolerance' | 'scaledValue' | 'minScaledValue' | 'maxScaledValue' | 'scaledTolerance' | 'scale'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<PressureMeasurementClusterAttributes, K>>;
|
|
831
|
-
|
|
876
|
+
readAttributes(attributeNames: Array<keyof PressureMeasurementClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<PressureMeasurementClusterAttributes> & Record<number, unknown>>;
|
|
877
|
+
writeAttributes(attributes: Partial<PressureMeasurementClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
832
878
|
}
|
|
833
879
|
|
|
834
880
|
export interface PumpConfigurationAndControlCluster extends ZCLNodeCluster {
|
|
@@ -843,7 +889,8 @@ export interface RelativeHumidityClusterAttributes {
|
|
|
843
889
|
|
|
844
890
|
export interface RelativeHumidityCluster extends ZCLNodeCluster {
|
|
845
891
|
readAttributes<K extends 'measuredValue' | 'minMeasuredValue' | 'maxMeasuredValue' | 'tolerance'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<RelativeHumidityClusterAttributes, K>>;
|
|
846
|
-
|
|
892
|
+
readAttributes(attributeNames: Array<keyof RelativeHumidityClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<RelativeHumidityClusterAttributes> & Record<number, unknown>>;
|
|
893
|
+
writeAttributes(attributes: Partial<RelativeHumidityClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
847
894
|
}
|
|
848
895
|
|
|
849
896
|
export interface ScenesCluster extends ZCLNodeCluster {
|
|
@@ -860,7 +907,8 @@ export interface TemperatureMeasurementClusterAttributes {
|
|
|
860
907
|
|
|
861
908
|
export interface TemperatureMeasurementCluster extends ZCLNodeCluster {
|
|
862
909
|
readAttributes<K extends 'measuredValue' | 'minMeasuredValue' | 'maxMeasuredValue'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<TemperatureMeasurementClusterAttributes, K>>;
|
|
863
|
-
|
|
910
|
+
readAttributes(attributeNames: Array<keyof TemperatureMeasurementClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<TemperatureMeasurementClusterAttributes> & Record<number, unknown>>;
|
|
911
|
+
writeAttributes(attributes: Partial<TemperatureMeasurementClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
864
912
|
}
|
|
865
913
|
|
|
866
914
|
export interface ThermostatClusterAttributes {
|
|
@@ -891,15 +939,16 @@ export interface ThermostatClusterAttributes {
|
|
|
891
939
|
|
|
892
940
|
export interface ThermostatCluster extends ZCLNodeCluster {
|
|
893
941
|
readAttributes<K extends 'localTemperature' | 'outdoorTemperature' | 'occupancy' | 'absMinHeatSetpointLimit' | 'absMaxHeatSetpointLimit' | 'absMinCoolSetpointLimit' | 'absMaxCoolSetpointLimit' | 'pICoolingDemand' | 'pIHeatingDemand' | 'localTemperatureCalibration' | 'occupiedCoolingSetpoint' | 'occupiedHeatingSetpoint' | 'unoccupiedCoolingSetpoint' | 'unoccupiedHeatingSetpoint' | 'minHeatSetpointLimit' | 'maxHeatSetpointLimit' | 'minCoolSetpointLimit' | 'maxCoolSetpointLimit' | 'minSetpointDeadBand' | 'remoteSensing' | 'controlSequenceOfOperation' | 'systemMode' | 'alarmMask'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<ThermostatClusterAttributes, K>>;
|
|
894
|
-
|
|
895
|
-
|
|
942
|
+
readAttributes(attributeNames: Array<keyof ThermostatClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<ThermostatClusterAttributes> & Record<number, unknown>>;
|
|
943
|
+
writeAttributes(attributes: Partial<ThermostatClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
944
|
+
setSetpoint(args: { mode: 'heat' | 'cool' | 'both'; amount: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
896
945
|
}
|
|
897
946
|
|
|
898
947
|
export interface TimeCluster extends ZCLNodeCluster {
|
|
899
948
|
}
|
|
900
949
|
|
|
901
|
-
export interface
|
|
902
|
-
getGroups(args: { startIdx: number }): Promise<{ total: number; startIndex: number; groups: unknown[] }>;
|
|
950
|
+
export interface TouchLinkCluster extends ZCLNodeCluster {
|
|
951
|
+
getGroups(args: { startIdx: number }, opts?: ClusterCommandOptions): Promise<{ total: number; startIndex: number; groups: unknown[] }>;
|
|
903
952
|
}
|
|
904
953
|
|
|
905
954
|
export interface WindowCoveringClusterAttributes {
|
|
@@ -927,14 +976,15 @@ export interface WindowCoveringClusterAttributes {
|
|
|
927
976
|
|
|
928
977
|
export interface WindowCoveringCluster extends ZCLNodeCluster {
|
|
929
978
|
readAttributes<K extends 'windowCoveringType' | 'physicalClosedLimitLift' | 'physicalClosedLimitTilt' | 'currentPositionLift' | 'currentPositionTilt' | 'numberofActuationsLift' | 'numberofActuationsTilt' | 'configStatus' | 'currentPositionLiftPercentage' | 'currentPositionTiltPercentage' | 'installedOpenLimitLift' | 'installedClosedLimitLift' | 'installedOpenLimitTilt' | 'installedClosedLimitTilt' | 'velocityLift' | 'accelerationTimeLift' | 'decelerationTimeLift' | 'mode' | 'intermediateSetpointsLift' | 'intermediateSetpointsTilt'>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<WindowCoveringClusterAttributes, K>>;
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
979
|
+
readAttributes(attributeNames: Array<keyof WindowCoveringClusterAttributes | number>, opts?: { timeout?: number }): Promise<Partial<WindowCoveringClusterAttributes> & Record<number, unknown>>;
|
|
980
|
+
writeAttributes(attributes: Partial<WindowCoveringClusterAttributes>, opts?: { timeout?: number }): Promise<unknown>;
|
|
981
|
+
upOpen(opts?: ClusterCommandOptions): Promise<void>;
|
|
982
|
+
downClose(opts?: ClusterCommandOptions): Promise<void>;
|
|
983
|
+
stop(opts?: ClusterCommandOptions): Promise<void>;
|
|
984
|
+
goToLiftValue(args: { liftValue: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
985
|
+
goToLiftPercentage(args: { percentageLiftValue: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
986
|
+
goToTiltValue(args: { tiltValue: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
987
|
+
goToTiltPercentage(args: { percentageTiltValue: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
938
988
|
}
|
|
939
989
|
|
|
940
990
|
/** Type-safe cluster registry */
|
|
@@ -957,9 +1007,9 @@ export interface ClusterRegistry {
|
|
|
957
1007
|
fanControl?: FanControlCluster;
|
|
958
1008
|
flowMeasurement?: FlowMeasurementCluster;
|
|
959
1009
|
groups?: GroupsCluster;
|
|
960
|
-
iasACE?:
|
|
961
|
-
iasWD?:
|
|
962
|
-
iasZone?:
|
|
1010
|
+
iasACE?: IASACECluster;
|
|
1011
|
+
iasWD?: IASWDCluster;
|
|
1012
|
+
iasZone?: IASZoneCluster;
|
|
963
1013
|
identify?: IdentifyCluster;
|
|
964
1014
|
illuminanceLevelSensing?: IlluminanceLevelSensingCluster;
|
|
965
1015
|
illuminanceMeasurement?: IlluminanceMeasurementCluster;
|
|
@@ -971,7 +1021,7 @@ export interface ClusterRegistry {
|
|
|
971
1021
|
occupancySensing?: OccupancySensingCluster;
|
|
972
1022
|
onOff?: OnOffCluster;
|
|
973
1023
|
onOffSwitch?: OnOffSwitchCluster;
|
|
974
|
-
ota?:
|
|
1024
|
+
ota?: OTACluster;
|
|
975
1025
|
pollControl?: PollControlCluster;
|
|
976
1026
|
powerConfiguration?: PowerConfigurationCluster;
|
|
977
1027
|
powerProfile?: PowerProfileCluster;
|
|
@@ -983,7 +1033,7 @@ export interface ClusterRegistry {
|
|
|
983
1033
|
temperatureMeasurement?: TemperatureMeasurementCluster;
|
|
984
1034
|
thermostat?: ThermostatCluster;
|
|
985
1035
|
time?: TimeCluster;
|
|
986
|
-
touchlink?:
|
|
1036
|
+
touchlink?: TouchLinkCluster;
|
|
987
1037
|
windowCovering?: WindowCoveringCluster;
|
|
988
1038
|
}
|
|
989
1039
|
|
|
@@ -1005,56 +1055,332 @@ export interface ZCLNode {
|
|
|
1005
1055
|
|
|
1006
1056
|
declare module "zigbee-clusters" {
|
|
1007
1057
|
export const ZCLNode: {
|
|
1008
|
-
new (
|
|
1058
|
+
new (node: ZCLNodeConstructorInput): ZCLNode;
|
|
1009
1059
|
};
|
|
1010
1060
|
export const CLUSTER: {
|
|
1011
1061
|
[key: string]: { ID: number; NAME: string; ATTRIBUTES: unknown; COMMANDS: unknown };
|
|
1012
1062
|
};
|
|
1013
1063
|
export { ZCLNodeCluster };
|
|
1014
|
-
export const AlarmsCluster:
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
export const
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
export const
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
export const
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
export const
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
export const
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
export const
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1064
|
+
export const AlarmsCluster: {
|
|
1065
|
+
new (...args: any[]): AlarmsCluster;
|
|
1066
|
+
ID: number;
|
|
1067
|
+
NAME: string;
|
|
1068
|
+
ATTRIBUTES: unknown;
|
|
1069
|
+
COMMANDS: unknown;
|
|
1070
|
+
};
|
|
1071
|
+
export const AnalogInputCluster: {
|
|
1072
|
+
new (...args: any[]): AnalogInputCluster;
|
|
1073
|
+
ID: number;
|
|
1074
|
+
NAME: string;
|
|
1075
|
+
ATTRIBUTES: unknown;
|
|
1076
|
+
COMMANDS: unknown;
|
|
1077
|
+
};
|
|
1078
|
+
export const AnalogOutputCluster: {
|
|
1079
|
+
new (...args: any[]): AnalogOutputCluster;
|
|
1080
|
+
ID: number;
|
|
1081
|
+
NAME: string;
|
|
1082
|
+
ATTRIBUTES: unknown;
|
|
1083
|
+
COMMANDS: unknown;
|
|
1084
|
+
};
|
|
1085
|
+
export const AnalogValueCluster: {
|
|
1086
|
+
new (...args: any[]): AnalogValueCluster;
|
|
1087
|
+
ID: number;
|
|
1088
|
+
NAME: string;
|
|
1089
|
+
ATTRIBUTES: unknown;
|
|
1090
|
+
COMMANDS: unknown;
|
|
1091
|
+
};
|
|
1092
|
+
export const BallastConfigurationCluster: {
|
|
1093
|
+
new (...args: any[]): BallastConfigurationCluster;
|
|
1094
|
+
ID: number;
|
|
1095
|
+
NAME: string;
|
|
1096
|
+
ATTRIBUTES: unknown;
|
|
1097
|
+
COMMANDS: unknown;
|
|
1098
|
+
};
|
|
1099
|
+
export const BasicCluster: {
|
|
1100
|
+
new (...args: any[]): BasicCluster;
|
|
1101
|
+
ID: number;
|
|
1102
|
+
NAME: string;
|
|
1103
|
+
ATTRIBUTES: unknown;
|
|
1104
|
+
COMMANDS: unknown;
|
|
1105
|
+
};
|
|
1106
|
+
export const BinaryInputCluster: {
|
|
1107
|
+
new (...args: any[]): BinaryInputCluster;
|
|
1108
|
+
ID: number;
|
|
1109
|
+
NAME: string;
|
|
1110
|
+
ATTRIBUTES: unknown;
|
|
1111
|
+
COMMANDS: unknown;
|
|
1112
|
+
};
|
|
1113
|
+
export const BinaryOutputCluster: {
|
|
1114
|
+
new (...args: any[]): BinaryOutputCluster;
|
|
1115
|
+
ID: number;
|
|
1116
|
+
NAME: string;
|
|
1117
|
+
ATTRIBUTES: unknown;
|
|
1118
|
+
COMMANDS: unknown;
|
|
1119
|
+
};
|
|
1120
|
+
export const BinaryValueCluster: {
|
|
1121
|
+
new (...args: any[]): BinaryValueCluster;
|
|
1122
|
+
ID: number;
|
|
1123
|
+
NAME: string;
|
|
1124
|
+
ATTRIBUTES: unknown;
|
|
1125
|
+
COMMANDS: unknown;
|
|
1126
|
+
};
|
|
1127
|
+
export const ColorControlCluster: {
|
|
1128
|
+
new (...args: any[]): ColorControlCluster;
|
|
1129
|
+
ID: number;
|
|
1130
|
+
NAME: string;
|
|
1131
|
+
ATTRIBUTES: unknown;
|
|
1132
|
+
COMMANDS: unknown;
|
|
1133
|
+
};
|
|
1134
|
+
export const DehumidificationControlCluster: {
|
|
1135
|
+
new (...args: any[]): DehumidificationControlCluster;
|
|
1136
|
+
ID: number;
|
|
1137
|
+
NAME: string;
|
|
1138
|
+
ATTRIBUTES: unknown;
|
|
1139
|
+
COMMANDS: unknown;
|
|
1140
|
+
};
|
|
1141
|
+
export const DeviceTemperatureCluster: {
|
|
1142
|
+
new (...args: any[]): DeviceTemperatureCluster;
|
|
1143
|
+
ID: number;
|
|
1144
|
+
NAME: string;
|
|
1145
|
+
ATTRIBUTES: unknown;
|
|
1146
|
+
COMMANDS: unknown;
|
|
1147
|
+
};
|
|
1148
|
+
export const DiagnosticsCluster: {
|
|
1149
|
+
new (...args: any[]): DiagnosticsCluster;
|
|
1150
|
+
ID: number;
|
|
1151
|
+
NAME: string;
|
|
1152
|
+
ATTRIBUTES: unknown;
|
|
1153
|
+
COMMANDS: unknown;
|
|
1154
|
+
};
|
|
1155
|
+
export const DoorLockCluster: {
|
|
1156
|
+
new (...args: any[]): DoorLockCluster;
|
|
1157
|
+
ID: number;
|
|
1158
|
+
NAME: string;
|
|
1159
|
+
ATTRIBUTES: unknown;
|
|
1160
|
+
COMMANDS: unknown;
|
|
1161
|
+
};
|
|
1162
|
+
export const ElectricalMeasurementCluster: {
|
|
1163
|
+
new (...args: any[]): ElectricalMeasurementCluster;
|
|
1164
|
+
ID: number;
|
|
1165
|
+
NAME: string;
|
|
1166
|
+
ATTRIBUTES: unknown;
|
|
1167
|
+
COMMANDS: unknown;
|
|
1168
|
+
};
|
|
1169
|
+
export const FanControlCluster: {
|
|
1170
|
+
new (...args: any[]): FanControlCluster;
|
|
1171
|
+
ID: number;
|
|
1172
|
+
NAME: string;
|
|
1173
|
+
ATTRIBUTES: unknown;
|
|
1174
|
+
COMMANDS: unknown;
|
|
1175
|
+
};
|
|
1176
|
+
export const FlowMeasurementCluster: {
|
|
1177
|
+
new (...args: any[]): FlowMeasurementCluster;
|
|
1178
|
+
ID: number;
|
|
1179
|
+
NAME: string;
|
|
1180
|
+
ATTRIBUTES: unknown;
|
|
1181
|
+
COMMANDS: unknown;
|
|
1182
|
+
};
|
|
1183
|
+
export const GroupsCluster: {
|
|
1184
|
+
new (...args: any[]): GroupsCluster;
|
|
1185
|
+
ID: number;
|
|
1186
|
+
NAME: string;
|
|
1187
|
+
ATTRIBUTES: unknown;
|
|
1188
|
+
COMMANDS: unknown;
|
|
1189
|
+
};
|
|
1190
|
+
export const IASACECluster: {
|
|
1191
|
+
new (...args: any[]): IASACECluster;
|
|
1192
|
+
ID: number;
|
|
1193
|
+
NAME: string;
|
|
1194
|
+
ATTRIBUTES: unknown;
|
|
1195
|
+
COMMANDS: unknown;
|
|
1196
|
+
};
|
|
1197
|
+
export const IASWDCluster: {
|
|
1198
|
+
new (...args: any[]): IASWDCluster;
|
|
1199
|
+
ID: number;
|
|
1200
|
+
NAME: string;
|
|
1201
|
+
ATTRIBUTES: unknown;
|
|
1202
|
+
COMMANDS: unknown;
|
|
1203
|
+
};
|
|
1204
|
+
export const IASZoneCluster: {
|
|
1205
|
+
new (...args: any[]): IASZoneCluster;
|
|
1206
|
+
ID: number;
|
|
1207
|
+
NAME: string;
|
|
1208
|
+
ATTRIBUTES: unknown;
|
|
1209
|
+
COMMANDS: unknown;
|
|
1210
|
+
};
|
|
1211
|
+
export const IdentifyCluster: {
|
|
1212
|
+
new (...args: any[]): IdentifyCluster;
|
|
1213
|
+
ID: number;
|
|
1214
|
+
NAME: string;
|
|
1215
|
+
ATTRIBUTES: unknown;
|
|
1216
|
+
COMMANDS: unknown;
|
|
1217
|
+
};
|
|
1218
|
+
export const IlluminanceLevelSensingCluster: {
|
|
1219
|
+
new (...args: any[]): IlluminanceLevelSensingCluster;
|
|
1220
|
+
ID: number;
|
|
1221
|
+
NAME: string;
|
|
1222
|
+
ATTRIBUTES: unknown;
|
|
1223
|
+
COMMANDS: unknown;
|
|
1224
|
+
};
|
|
1225
|
+
export const IlluminanceMeasurementCluster: {
|
|
1226
|
+
new (...args: any[]): IlluminanceMeasurementCluster;
|
|
1227
|
+
ID: number;
|
|
1228
|
+
NAME: string;
|
|
1229
|
+
ATTRIBUTES: unknown;
|
|
1230
|
+
COMMANDS: unknown;
|
|
1231
|
+
};
|
|
1232
|
+
export const LevelControlCluster: {
|
|
1233
|
+
new (...args: any[]): LevelControlCluster;
|
|
1234
|
+
ID: number;
|
|
1235
|
+
NAME: string;
|
|
1236
|
+
ATTRIBUTES: unknown;
|
|
1237
|
+
COMMANDS: unknown;
|
|
1238
|
+
};
|
|
1239
|
+
export const MeteringCluster: {
|
|
1240
|
+
new (...args: any[]): MeteringCluster;
|
|
1241
|
+
ID: number;
|
|
1242
|
+
NAME: string;
|
|
1243
|
+
ATTRIBUTES: unknown;
|
|
1244
|
+
COMMANDS: unknown;
|
|
1245
|
+
};
|
|
1246
|
+
export const MultistateInputCluster: {
|
|
1247
|
+
new (...args: any[]): MultistateInputCluster;
|
|
1248
|
+
ID: number;
|
|
1249
|
+
NAME: string;
|
|
1250
|
+
ATTRIBUTES: unknown;
|
|
1251
|
+
COMMANDS: unknown;
|
|
1252
|
+
};
|
|
1253
|
+
export const MultistateOutputCluster: {
|
|
1254
|
+
new (...args: any[]): MultistateOutputCluster;
|
|
1255
|
+
ID: number;
|
|
1256
|
+
NAME: string;
|
|
1257
|
+
ATTRIBUTES: unknown;
|
|
1258
|
+
COMMANDS: unknown;
|
|
1259
|
+
};
|
|
1260
|
+
export const MultistateValueCluster: {
|
|
1261
|
+
new (...args: any[]): MultistateValueCluster;
|
|
1262
|
+
ID: number;
|
|
1263
|
+
NAME: string;
|
|
1264
|
+
ATTRIBUTES: unknown;
|
|
1265
|
+
COMMANDS: unknown;
|
|
1266
|
+
};
|
|
1267
|
+
export const OccupancySensingCluster: {
|
|
1268
|
+
new (...args: any[]): OccupancySensingCluster;
|
|
1269
|
+
ID: number;
|
|
1270
|
+
NAME: string;
|
|
1271
|
+
ATTRIBUTES: unknown;
|
|
1272
|
+
COMMANDS: unknown;
|
|
1273
|
+
};
|
|
1274
|
+
export const OnOffCluster: {
|
|
1275
|
+
new (...args: any[]): OnOffCluster;
|
|
1276
|
+
ID: number;
|
|
1277
|
+
NAME: string;
|
|
1278
|
+
ATTRIBUTES: unknown;
|
|
1279
|
+
COMMANDS: unknown;
|
|
1280
|
+
};
|
|
1281
|
+
export const OnOffSwitchCluster: {
|
|
1282
|
+
new (...args: any[]): OnOffSwitchCluster;
|
|
1283
|
+
ID: number;
|
|
1284
|
+
NAME: string;
|
|
1285
|
+
ATTRIBUTES: unknown;
|
|
1286
|
+
COMMANDS: unknown;
|
|
1287
|
+
};
|
|
1288
|
+
export const OTACluster: {
|
|
1289
|
+
new (...args: any[]): OTACluster;
|
|
1290
|
+
ID: number;
|
|
1291
|
+
NAME: string;
|
|
1292
|
+
ATTRIBUTES: unknown;
|
|
1293
|
+
COMMANDS: unknown;
|
|
1294
|
+
};
|
|
1295
|
+
export const PollControlCluster: {
|
|
1296
|
+
new (...args: any[]): PollControlCluster;
|
|
1297
|
+
ID: number;
|
|
1298
|
+
NAME: string;
|
|
1299
|
+
ATTRIBUTES: unknown;
|
|
1300
|
+
COMMANDS: unknown;
|
|
1301
|
+
};
|
|
1302
|
+
export const PowerConfigurationCluster: {
|
|
1303
|
+
new (...args: any[]): PowerConfigurationCluster;
|
|
1304
|
+
ID: number;
|
|
1305
|
+
NAME: string;
|
|
1306
|
+
ATTRIBUTES: unknown;
|
|
1307
|
+
COMMANDS: unknown;
|
|
1308
|
+
};
|
|
1309
|
+
export const PowerProfileCluster: {
|
|
1310
|
+
new (...args: any[]): PowerProfileCluster;
|
|
1311
|
+
ID: number;
|
|
1312
|
+
NAME: string;
|
|
1313
|
+
ATTRIBUTES: unknown;
|
|
1314
|
+
COMMANDS: unknown;
|
|
1315
|
+
};
|
|
1316
|
+
export const PressureMeasurementCluster: {
|
|
1317
|
+
new (...args: any[]): PressureMeasurementCluster;
|
|
1318
|
+
ID: number;
|
|
1319
|
+
NAME: string;
|
|
1320
|
+
ATTRIBUTES: unknown;
|
|
1321
|
+
COMMANDS: unknown;
|
|
1322
|
+
};
|
|
1323
|
+
export const PumpConfigurationAndControlCluster: {
|
|
1324
|
+
new (...args: any[]): PumpConfigurationAndControlCluster;
|
|
1325
|
+
ID: number;
|
|
1326
|
+
NAME: string;
|
|
1327
|
+
ATTRIBUTES: unknown;
|
|
1328
|
+
COMMANDS: unknown;
|
|
1329
|
+
};
|
|
1330
|
+
export const RelativeHumidityCluster: {
|
|
1331
|
+
new (...args: any[]): RelativeHumidityCluster;
|
|
1332
|
+
ID: number;
|
|
1333
|
+
NAME: string;
|
|
1334
|
+
ATTRIBUTES: unknown;
|
|
1335
|
+
COMMANDS: unknown;
|
|
1336
|
+
};
|
|
1337
|
+
export const ScenesCluster: {
|
|
1338
|
+
new (...args: any[]): ScenesCluster;
|
|
1339
|
+
ID: number;
|
|
1340
|
+
NAME: string;
|
|
1341
|
+
ATTRIBUTES: unknown;
|
|
1342
|
+
COMMANDS: unknown;
|
|
1343
|
+
};
|
|
1344
|
+
export const ShadeConfigurationCluster: {
|
|
1345
|
+
new (...args: any[]): ShadeConfigurationCluster;
|
|
1346
|
+
ID: number;
|
|
1347
|
+
NAME: string;
|
|
1348
|
+
ATTRIBUTES: unknown;
|
|
1349
|
+
COMMANDS: unknown;
|
|
1350
|
+
};
|
|
1351
|
+
export const TemperatureMeasurementCluster: {
|
|
1352
|
+
new (...args: any[]): TemperatureMeasurementCluster;
|
|
1353
|
+
ID: number;
|
|
1354
|
+
NAME: string;
|
|
1355
|
+
ATTRIBUTES: unknown;
|
|
1356
|
+
COMMANDS: unknown;
|
|
1357
|
+
};
|
|
1358
|
+
export const ThermostatCluster: {
|
|
1359
|
+
new (...args: any[]): ThermostatCluster;
|
|
1360
|
+
ID: number;
|
|
1361
|
+
NAME: string;
|
|
1362
|
+
ATTRIBUTES: unknown;
|
|
1363
|
+
COMMANDS: unknown;
|
|
1364
|
+
};
|
|
1365
|
+
export const TimeCluster: {
|
|
1366
|
+
new (...args: any[]): TimeCluster;
|
|
1367
|
+
ID: number;
|
|
1368
|
+
NAME: string;
|
|
1369
|
+
ATTRIBUTES: unknown;
|
|
1370
|
+
COMMANDS: unknown;
|
|
1371
|
+
};
|
|
1372
|
+
export const TouchLinkCluster: {
|
|
1373
|
+
new (...args: any[]): TouchLinkCluster;
|
|
1374
|
+
ID: number;
|
|
1375
|
+
NAME: string;
|
|
1376
|
+
ATTRIBUTES: unknown;
|
|
1377
|
+
COMMANDS: unknown;
|
|
1378
|
+
};
|
|
1379
|
+
export const WindowCoveringCluster: {
|
|
1380
|
+
new (...args: any[]): WindowCoveringCluster;
|
|
1381
|
+
ID: number;
|
|
1382
|
+
NAME: string;
|
|
1383
|
+
ATTRIBUTES: unknown;
|
|
1384
|
+
COMMANDS: unknown;
|
|
1385
|
+
};
|
|
1060
1386
|
}
|
package/package.json
CHANGED
|
@@ -89,7 +89,7 @@ function zclTypeToTS(dataType) {
|
|
|
89
89
|
* @param {Function} ClusterClass - Cluster class with static ATTRIBUTES/COMMANDS
|
|
90
90
|
* @returns {object} Cluster definition
|
|
91
91
|
*/
|
|
92
|
-
function parseCluster(ClusterClass) {
|
|
92
|
+
function parseCluster(ClusterClass, exportName) {
|
|
93
93
|
const clusterName = ClusterClass.NAME;
|
|
94
94
|
const clusterId = ClusterClass.ID;
|
|
95
95
|
const attributes = [];
|
|
@@ -132,7 +132,11 @@ function parseCluster(ClusterClass) {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
return {
|
|
135
|
-
|
|
135
|
+
exportName,
|
|
136
|
+
clusterName,
|
|
137
|
+
clusterId,
|
|
138
|
+
attributes,
|
|
139
|
+
commands,
|
|
136
140
|
};
|
|
137
141
|
}
|
|
138
142
|
|
|
@@ -141,8 +145,9 @@ function parseCluster(ClusterClass) {
|
|
|
141
145
|
* @param {string} clusterName
|
|
142
146
|
* @returns {string}
|
|
143
147
|
*/
|
|
144
|
-
function toInterfaceName(
|
|
145
|
-
|
|
148
|
+
function toInterfaceName(cluster) {
|
|
149
|
+
if (cluster.exportName) return cluster.exportName;
|
|
150
|
+
const name = cluster.clusterName.charAt(0).toUpperCase() + cluster.clusterName.slice(1);
|
|
146
151
|
return `${name}Cluster`;
|
|
147
152
|
}
|
|
148
153
|
|
|
@@ -152,7 +157,7 @@ function toInterfaceName(clusterName) {
|
|
|
152
157
|
* @returns {string} TypeScript interface code
|
|
153
158
|
*/
|
|
154
159
|
function generateClusterInterface(cluster) {
|
|
155
|
-
const interfaceName = toInterfaceName(cluster
|
|
160
|
+
const interfaceName = toInterfaceName(cluster);
|
|
156
161
|
const lines = [];
|
|
157
162
|
|
|
158
163
|
// Generate attributes interface
|
|
@@ -172,7 +177,8 @@ function generateClusterInterface(cluster) {
|
|
|
172
177
|
if (cluster.attributes.length > 0) {
|
|
173
178
|
const attrNames = cluster.attributes.map(a => `'${a.name}'`).join(' | ');
|
|
174
179
|
lines.push(` readAttributes<K extends ${attrNames}>(attributeNames: K[], opts?: { timeout?: number }): Promise<Pick<${interfaceName}Attributes, K>>;`);
|
|
175
|
-
lines.push(`
|
|
180
|
+
lines.push(` readAttributes(attributeNames: Array<keyof ${interfaceName}Attributes | number>, opts?: { timeout?: number }): Promise<Partial<${interfaceName}Attributes> & Record<number, unknown>>;`);
|
|
181
|
+
lines.push(` writeAttributes(attributes: Partial<${interfaceName}Attributes>, opts?: { timeout?: number }): Promise<unknown>;`);
|
|
176
182
|
}
|
|
177
183
|
|
|
178
184
|
// Add command methods
|
|
@@ -188,9 +194,9 @@ function generateClusterInterface(cluster) {
|
|
|
188
194
|
const allArgsOptional = cmd.args.every(a => a.tsType === 'Buffer');
|
|
189
195
|
const argsType = `{ ${cmd.args.map(a => `${a.name}${a.tsType === 'Buffer' ? '?' : ''}: ${a.tsType}`).join('; ')} }`;
|
|
190
196
|
// If all args are optional, make the entire args object optional
|
|
191
|
-
lines.push(` ${cmd.name}(args${allArgsOptional ? '?' : ''}: ${argsType}): Promise<${returnType}>;`);
|
|
197
|
+
lines.push(` ${cmd.name}(args${allArgsOptional ? '?' : ''}: ${argsType}, opts?: ClusterCommandOptions): Promise<${returnType}>;`);
|
|
192
198
|
} else {
|
|
193
|
-
lines.push(` ${cmd.name}(): Promise<${returnType}>;`);
|
|
199
|
+
lines.push(` ${cmd.name}(opts?: ClusterCommandOptions): Promise<${returnType}>;`);
|
|
194
200
|
}
|
|
195
201
|
}
|
|
196
202
|
|
|
@@ -225,30 +231,47 @@ type ConstructorOptions = {
|
|
|
225
231
|
endpointDescriptors: EndpointDescriptor[];
|
|
226
232
|
sendFrame: (endpointId: number, clusterId: number, frame: Buffer) => Promise<void>;
|
|
227
233
|
};
|
|
234
|
+
|
|
235
|
+
type ClusterCommandOptions = {
|
|
236
|
+
timeout?: number;
|
|
237
|
+
waitForResponse?: boolean;
|
|
238
|
+
disableDefaultResponse?: boolean;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
type ZCLNodeConstructorInput = {
|
|
242
|
+
endpointDescriptors?: EndpointDescriptor[];
|
|
243
|
+
sendFrame: (endpointId: number, clusterId: number, frame: Buffer) => Promise<void>;
|
|
244
|
+
handleFrame?: (
|
|
245
|
+
endpointId: number,
|
|
246
|
+
clusterId: number,
|
|
247
|
+
frame: Buffer,
|
|
248
|
+
meta?: unknown
|
|
249
|
+
) => Promise<void>;
|
|
250
|
+
};
|
|
228
251
|
`);
|
|
229
252
|
|
|
230
253
|
// Base ZCLNodeCluster interface
|
|
231
254
|
lines.push(`export interface ZCLNodeCluster extends EventEmitter {
|
|
232
|
-
discoverCommandsGenerated(
|
|
255
|
+
discoverCommandsGenerated(params?: {
|
|
233
256
|
startValue?: number;
|
|
234
257
|
maxResults?: number;
|
|
235
|
-
}): Promise<number[]>;
|
|
258
|
+
}, opts?: { timeout?: number }): Promise<(string | number)[]>;
|
|
236
259
|
|
|
237
|
-
discoverCommandsReceived(
|
|
260
|
+
discoverCommandsReceived(params?: {
|
|
238
261
|
startValue?: number;
|
|
239
262
|
maxResults?: number;
|
|
240
|
-
}): Promise<number[]>;
|
|
263
|
+
}, opts?: { timeout?: number }): Promise<(string | number)[]>;
|
|
241
264
|
|
|
242
265
|
readAttributes(
|
|
243
|
-
|
|
266
|
+
attributes: Array<string | number>,
|
|
244
267
|
opts?: { timeout?: number }
|
|
245
268
|
): Promise<{ [x: string]: unknown }>;
|
|
246
269
|
|
|
247
|
-
writeAttributes(attributes?: object): Promise<
|
|
270
|
+
writeAttributes(attributes?: object, opts?: { timeout?: number }): Promise<unknown>;
|
|
248
271
|
|
|
249
|
-
configureReporting(attributes?: object): Promise<void>;
|
|
272
|
+
configureReporting(attributes?: object, opts?: { timeout?: number }): Promise<void>;
|
|
250
273
|
|
|
251
|
-
readReportingConfiguration(attributes?: (string | number)[]): Promise<{
|
|
274
|
+
readReportingConfiguration(attributes?: (string | number)[], opts?: { timeout?: number }): Promise<{
|
|
252
275
|
status: string;
|
|
253
276
|
direction: 'reported' | 'received';
|
|
254
277
|
attributeId: number;
|
|
@@ -259,11 +282,12 @@ type ConstructorOptions = {
|
|
|
259
282
|
timeoutPeriod?: number;
|
|
260
283
|
}[]>;
|
|
261
284
|
|
|
262
|
-
discoverAttributes(): Promise<(string | number)[]>;
|
|
285
|
+
discoverAttributes(opts?: { timeout?: number }): Promise<(string | number)[]>;
|
|
263
286
|
|
|
264
|
-
discoverAttributesExtended(): Promise<{
|
|
287
|
+
discoverAttributesExtended(opts?: { timeout?: number }): Promise<{
|
|
265
288
|
name?: string;
|
|
266
289
|
id: number;
|
|
290
|
+
dataTypeId: number;
|
|
267
291
|
acl: { readable: boolean; writable: boolean; reportable: boolean };
|
|
268
292
|
}[]>;
|
|
269
293
|
}
|
|
@@ -279,7 +303,7 @@ type ConstructorOptions = {
|
|
|
279
303
|
lines.push('/** Type-safe cluster registry */');
|
|
280
304
|
lines.push('export interface ClusterRegistry {');
|
|
281
305
|
for (const cluster of clusters) {
|
|
282
|
-
const interfaceName = toInterfaceName(cluster
|
|
306
|
+
const interfaceName = toInterfaceName(cluster);
|
|
283
307
|
lines.push(` ${cluster.clusterName}?: ${interfaceName};`);
|
|
284
308
|
}
|
|
285
309
|
lines.push('}');
|
|
@@ -306,7 +330,7 @@ export interface ZCLNode {
|
|
|
306
330
|
// Module declaration for CommonJS compatibility
|
|
307
331
|
lines.push(`declare module "zigbee-clusters" {
|
|
308
332
|
export const ZCLNode: {
|
|
309
|
-
new (
|
|
333
|
+
new (node: ZCLNodeConstructorInput): ZCLNode;
|
|
310
334
|
};
|
|
311
335
|
export const CLUSTER: {
|
|
312
336
|
[key: string]: { ID: number; NAME: string; ATTRIBUTES: unknown; COMMANDS: unknown };
|
|
@@ -315,8 +339,15 @@ export interface ZCLNode {
|
|
|
315
339
|
|
|
316
340
|
// Export all cluster classes
|
|
317
341
|
for (const cluster of clusters) {
|
|
318
|
-
const interfaceName = toInterfaceName(cluster
|
|
319
|
-
|
|
342
|
+
const interfaceName = toInterfaceName(cluster);
|
|
343
|
+
const exportName = cluster.exportName || interfaceName;
|
|
344
|
+
lines.push(` export const ${exportName}: {`);
|
|
345
|
+
lines.push(` new (...args: any[]): ${interfaceName};`);
|
|
346
|
+
lines.push(' ID: number;');
|
|
347
|
+
lines.push(' NAME: string;');
|
|
348
|
+
lines.push(' ATTRIBUTES: unknown;');
|
|
349
|
+
lines.push(' COMMANDS: unknown;');
|
|
350
|
+
lines.push(' };');
|
|
320
351
|
}
|
|
321
352
|
|
|
322
353
|
lines.push('}');
|
|
@@ -338,7 +369,7 @@ function main() {
|
|
|
338
369
|
for (const [name, value] of Object.entries(clustersModule)) {
|
|
339
370
|
if (name.endsWith('Cluster') && typeof value === 'function' && value.NAME) {
|
|
340
371
|
try {
|
|
341
|
-
const cluster = parseCluster(value);
|
|
372
|
+
const cluster = parseCluster(value, name);
|
|
342
373
|
clusters.push(cluster);
|
|
343
374
|
console.log(` ✓ ${cluster.clusterName} (${cluster.attributes.length} attrs, ${cluster.commands.length} cmds)`);
|
|
344
375
|
} catch (err) {
|