zigbee-clusters 2.10.1 → 3.0.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/README.md +10 -0
- package/index.d.ts +5 -2
- package/lib/clusters/iasZone.js +21 -34
- package/package.json +1 -1
- package/scripts/generate-types.js +3 -0
package/README.md
CHANGED
|
@@ -15,6 +15,16 @@ Make sure to take a look at the API documentation: [https://athombv.github.io/no
|
|
|
15
15
|
|
|
16
16
|
## Breaking changes
|
|
17
17
|
|
|
18
|
+
v3.0.0
|
|
19
|
+
|
|
20
|
+
- **iasZone**: Unified `zoneType` enum keys between attribute and `zoneEnrollRequest` command to match ZCL spec (Table 8-5). See [#176](https://github.com/athombv/node-zigbee-clusters/pull/176) for full impact analysis.
|
|
21
|
+
- `cabonMonoxideSensor` -> `carbonMonoxideSensor` (typo fix)
|
|
22
|
+
- `keyfob` -> `keyFob` (spec says "Key fob" - two words)
|
|
23
|
+
- `standard` -> `standardCIE` (in `zoneEnrollRequest`)
|
|
24
|
+
- `invalid` -> `invalidZoneType` (in `zoneEnrollRequest`)
|
|
25
|
+
- `keyPad` -> `keypad` (in `zoneEnrollRequest`, spec says "Keypad" - one word)
|
|
26
|
+
- Added missing `doorWindowHandle` (0x0016) zone type from spec
|
|
27
|
+
|
|
18
28
|
v2.0.0
|
|
19
29
|
|
|
20
30
|
- Changed `Cluster.readAttributes` signature, attributes must now be specified as an array of strings.
|
package/index.d.ts
CHANGED
|
@@ -34,6 +34,9 @@ type ZCLNodeConstructorInput = {
|
|
|
34
34
|
type ZCLEnum8Status = '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';
|
|
35
35
|
|
|
36
36
|
export interface ZCLNodeCluster extends EventEmitter {
|
|
37
|
+
/** Dynamic command handler methods (e.g. `onZoneStatusChangeNotification`). */
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
|
|
37
40
|
discoverCommandsGenerated(params?: {
|
|
38
41
|
startValue?: number;
|
|
39
42
|
maxResults?: number;
|
|
@@ -467,7 +470,7 @@ export interface IASWDCluster extends ZCLNodeCluster {
|
|
|
467
470
|
|
|
468
471
|
export interface IASZoneClusterAttributes {
|
|
469
472
|
zoneState?: 'notEnrolled' | 'enrolled';
|
|
470
|
-
zoneType?: 'standardCIE' | 'motionSensor' | 'contactSwitch' | 'fireSensor' | 'waterSensor' | '
|
|
473
|
+
zoneType?: 'standardCIE' | 'motionSensor' | 'contactSwitch' | 'doorWindowHandle' | 'fireSensor' | 'waterSensor' | 'carbonMonoxideSensor' | 'personalEmergencyDevice' | 'vibrationMovementSensor' | 'remoteControl' | 'keyFob' | 'keypad' | 'standardWarningDevice' | 'glassBreakSensor' | 'securityRepeater' | 'invalidZoneType';
|
|
471
474
|
zoneStatus?: Partial<{ alarm1: boolean; alarm2: boolean; tamper: boolean; battery: boolean; supervisionReports: boolean; restoreReports: boolean; trouble: boolean; acMains: boolean; test: boolean; batteryDefect: boolean }>;
|
|
472
475
|
iasCIEAddress?: string;
|
|
473
476
|
zoneId?: number;
|
|
@@ -481,7 +484,7 @@ export interface IASZoneCluster extends ZCLNodeCluster {
|
|
|
481
484
|
once<K extends keyof IASZoneClusterAttributes & string>(eventName: `attr.${K}`, listener: (value: IASZoneClusterAttributes[K]) => void): this;
|
|
482
485
|
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>;
|
|
483
486
|
zoneEnrollResponse(args: { enrollResponseCode: 'success' | 'notSupported' | 'noEnrollPermit' | 'tooManyZones'; zoneId: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
484
|
-
zoneEnrollRequest(args: { zoneType: '
|
|
487
|
+
zoneEnrollRequest(args: { zoneType: 'standardCIE' | 'motionSensor' | 'contactSwitch' | 'doorWindowHandle' | 'fireSensor' | 'waterSensor' | 'carbonMonoxideSensor' | 'personalEmergencyDevice' | 'vibrationMovementSensor' | 'remoteControl' | 'keyFob' | 'keypad' | 'standardWarningDevice' | 'glassBreakSensor' | 'securityRepeater' | 'invalidZoneType'; manufacturerCode: number }, opts?: ClusterCommandOptions): Promise<void>;
|
|
485
488
|
initiateNormalOperationMode(opts?: ClusterCommandOptions): Promise<void>;
|
|
486
489
|
}
|
|
487
490
|
|
package/lib/clusters/iasZone.js
CHANGED
|
@@ -5,6 +5,25 @@ const { ZCLDataTypes } = require('../zclTypes');
|
|
|
5
5
|
|
|
6
6
|
const ZONE_STATUS_DATA_TYPE = ZCLDataTypes.map16('alarm1', 'alarm2', 'tamper', 'battery', 'supervisionReports', 'restoreReports', 'trouble', 'acMains', 'test', 'batteryDefect');
|
|
7
7
|
|
|
8
|
+
const ZONE_TYPE_VALUES = {
|
|
9
|
+
standardCIE: 0x0000,
|
|
10
|
+
motionSensor: 0x000d,
|
|
11
|
+
contactSwitch: 0x0015,
|
|
12
|
+
doorWindowHandle: 0x0016,
|
|
13
|
+
fireSensor: 0x0028,
|
|
14
|
+
waterSensor: 0x002a,
|
|
15
|
+
carbonMonoxideSensor: 0x002b,
|
|
16
|
+
personalEmergencyDevice: 0x002c,
|
|
17
|
+
vibrationMovementSensor: 0x002d,
|
|
18
|
+
remoteControl: 0x010f,
|
|
19
|
+
keyFob: 0x0115,
|
|
20
|
+
keypad: 0x021d,
|
|
21
|
+
standardWarningDevice: 0x0225,
|
|
22
|
+
glassBreakSensor: 0x0226,
|
|
23
|
+
securityRepeater: 0x0229,
|
|
24
|
+
invalidZoneType: 0xffff,
|
|
25
|
+
};
|
|
26
|
+
|
|
8
27
|
const ATTRIBUTES = {
|
|
9
28
|
zoneState: {
|
|
10
29
|
id: 0,
|
|
@@ -15,23 +34,7 @@ const ATTRIBUTES = {
|
|
|
15
34
|
},
|
|
16
35
|
zoneType: {
|
|
17
36
|
id: 1,
|
|
18
|
-
type: ZCLDataTypes.enum16(
|
|
19
|
-
standardCIE: 0,
|
|
20
|
-
motionSensor: 13,
|
|
21
|
-
contactSwitch: 21,
|
|
22
|
-
fireSensor: 40,
|
|
23
|
-
waterSensor: 42,
|
|
24
|
-
cabonMonoxideSensor: 43,
|
|
25
|
-
personalEmergencyDevice: 44,
|
|
26
|
-
vibrationMovementSensor: 45,
|
|
27
|
-
remoteControl: 271,
|
|
28
|
-
keyfob: 277,
|
|
29
|
-
keypad: 541,
|
|
30
|
-
standardWarningDevice: 549,
|
|
31
|
-
glassBreakSensor: 550,
|
|
32
|
-
securityRepeater: 553,
|
|
33
|
-
invalidZoneType: 65535,
|
|
34
|
-
}),
|
|
37
|
+
type: ZCLDataTypes.enum16(ZONE_TYPE_VALUES),
|
|
35
38
|
},
|
|
36
39
|
zoneStatus: {
|
|
37
40
|
id: 2,
|
|
@@ -78,23 +81,7 @@ const COMMANDS = {
|
|
|
78
81
|
// Add direction property as "initiateNormalOperationMode" has same command id.
|
|
79
82
|
direction: Cluster.DIRECTION_SERVER_TO_CLIENT,
|
|
80
83
|
args: {
|
|
81
|
-
zoneType: ZCLDataTypes.enum16(
|
|
82
|
-
standard: 0x0000,
|
|
83
|
-
motionSensor: 0x000d,
|
|
84
|
-
contactSwitch: 0x0015,
|
|
85
|
-
fireSensor: 0x0028,
|
|
86
|
-
waterSensor: 0x002a,
|
|
87
|
-
carbonMonoxideSensor: 0x002b,
|
|
88
|
-
personalEmergencyDevice: 0x002c,
|
|
89
|
-
vibrationMovementSensor: 0x002d,
|
|
90
|
-
remoteControl: 0x010f,
|
|
91
|
-
keyFob: 0x0115,
|
|
92
|
-
keyPad: 0x021d,
|
|
93
|
-
standardWarningDevice: 0x0225,
|
|
94
|
-
glassBreakSensor: 0x0226,
|
|
95
|
-
securityRepeater: 0x0229,
|
|
96
|
-
invalid: 0xffff,
|
|
97
|
-
}),
|
|
84
|
+
zoneType: ZCLDataTypes.enum16(ZONE_TYPE_VALUES),
|
|
98
85
|
manufacturerCode: ZCLDataTypes.uint16,
|
|
99
86
|
},
|
|
100
87
|
},
|
package/package.json
CHANGED
|
@@ -286,6 +286,9 @@ type ZCLEnum8Status = ${zclTypeToTS(ZCLDataTypes.enum8Status, false)};
|
|
|
286
286
|
|
|
287
287
|
// Base ZCLNodeCluster interface
|
|
288
288
|
lines.push(`export interface ZCLNodeCluster extends EventEmitter {
|
|
289
|
+
/** Dynamic command handler methods (e.g. \`onZoneStatusChangeNotification\`). */
|
|
290
|
+
[key: string]: unknown;
|
|
291
|
+
|
|
289
292
|
discoverCommandsGenerated(params?: {
|
|
290
293
|
startValue?: number;
|
|
291
294
|
maxResults?: number;
|