homebridge 2.0.0-beta.39 → 2.0.0-beta.40
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/dist/childBridgeFork.d.ts +0 -5
- package/dist/childBridgeFork.d.ts.map +1 -1
- package/dist/childBridgeFork.js +4 -9
- package/dist/childBridgeFork.js.map +1 -1
- package/dist/childBridgeService.d.ts +7 -0
- package/dist/childBridgeService.d.ts.map +1 -1
- package/dist/childBridgeService.js.map +1 -1
- package/dist/index.d.ts +24 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -4
- package/dist/index.js.map +1 -1
- package/dist/ipcService.d.ts +2 -4
- package/dist/ipcService.d.ts.map +1 -1
- package/dist/ipcService.js +0 -2
- package/dist/ipcService.js.map +1 -1
- package/dist/matter/ChildBridgeMatterManager.d.ts +2 -2
- package/dist/matter/ChildBridgeMatterManager.d.ts.map +1 -1
- package/dist/matter/ChildBridgeMatterManager.js +10 -8
- package/dist/matter/ChildBridgeMatterManager.js.map +1 -1
- package/dist/matter/MatterBridgeManager.d.ts +0 -4
- package/dist/matter/MatterBridgeManager.d.ts.map +1 -1
- package/dist/matter/MatterBridgeManager.js +0 -13
- package/dist/matter/MatterBridgeManager.js.map +1 -1
- package/dist/matter/behaviors/ColorControlBehavior.d.ts +6 -7
- package/dist/matter/behaviors/ColorControlBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/ColorControlBehavior.js +146 -83
- package/dist/matter/behaviors/ColorControlBehavior.js.map +1 -1
- package/dist/matter/behaviors/DoorLockBehavior.d.ts +2 -3
- package/dist/matter/behaviors/DoorLockBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/DoorLockBehavior.js +46 -24
- package/dist/matter/behaviors/DoorLockBehavior.js.map +1 -1
- package/dist/matter/behaviors/DoorLockBehavior.spec.js +24 -12
- package/dist/matter/behaviors/DoorLockBehavior.spec.js.map +1 -1
- package/dist/matter/behaviors/FanControlBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/FanControlBehavior.js +41 -15
- package/dist/matter/behaviors/FanControlBehavior.js.map +1 -1
- package/dist/matter/behaviors/IdentifyBehavior.d.ts +1 -2
- package/dist/matter/behaviors/IdentifyBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/IdentifyBehavior.js +20 -6
- package/dist/matter/behaviors/IdentifyBehavior.js.map +1 -1
- package/dist/matter/behaviors/IdentifyBehavior.spec.js +3 -3
- package/dist/matter/behaviors/IdentifyBehavior.spec.js.map +1 -1
- package/dist/matter/behaviors/LevelControlBehavior.d.ts +5 -6
- package/dist/matter/behaviors/LevelControlBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/LevelControlBehavior.js +100 -37
- package/dist/matter/behaviors/LevelControlBehavior.js.map +1 -1
- package/dist/matter/behaviors/LevelControlBehavior.spec.js +15 -10
- package/dist/matter/behaviors/LevelControlBehavior.spec.js.map +1 -1
- package/dist/matter/behaviors/OnOffBehavior.d.ts +3 -4
- package/dist/matter/behaviors/OnOffBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/OnOffBehavior.js +64 -32
- package/dist/matter/behaviors/OnOffBehavior.js.map +1 -1
- package/dist/matter/behaviors/OnOffBehavior.spec.js +27 -15
- package/dist/matter/behaviors/OnOffBehavior.spec.js.map +1 -1
- package/dist/matter/behaviors/RvcCleanModeBehavior.d.ts +1 -1
- package/dist/matter/behaviors/RvcCleanModeBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/RvcCleanModeBehavior.js +20 -6
- package/dist/matter/behaviors/RvcCleanModeBehavior.js.map +1 -1
- package/dist/matter/behaviors/RvcCleanModeBehavior.spec.js +3 -2
- package/dist/matter/behaviors/RvcCleanModeBehavior.spec.js.map +1 -1
- package/dist/matter/behaviors/RvcOperationalStateBehavior.d.ts +3 -4
- package/dist/matter/behaviors/RvcOperationalStateBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/RvcOperationalStateBehavior.js +60 -23
- package/dist/matter/behaviors/RvcOperationalStateBehavior.js.map +1 -1
- package/dist/matter/behaviors/RvcRunModeBehavior.d.ts +1 -1
- package/dist/matter/behaviors/RvcRunModeBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/RvcRunModeBehavior.js +20 -6
- package/dist/matter/behaviors/RvcRunModeBehavior.js.map +1 -1
- package/dist/matter/behaviors/RvcRunModeBehavior.spec.js +3 -2
- package/dist/matter/behaviors/RvcRunModeBehavior.spec.js.map +1 -1
- package/dist/matter/behaviors/ServiceAreaBehavior.d.ts +2 -3
- package/dist/matter/behaviors/ServiceAreaBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/ServiceAreaBehavior.js +38 -12
- package/dist/matter/behaviors/ServiceAreaBehavior.js.map +1 -1
- package/dist/matter/behaviors/ServiceAreaBehavior.spec.js +3 -2
- package/dist/matter/behaviors/ServiceAreaBehavior.spec.js.map +1 -1
- package/dist/matter/behaviors/ThermostatBehavior.d.ts +1 -2
- package/dist/matter/behaviors/ThermostatBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/ThermostatBehavior.js +82 -34
- package/dist/matter/behaviors/ThermostatBehavior.js.map +1 -1
- package/dist/matter/behaviors/WindowCoveringBehavior.d.ts +5 -6
- package/dist/matter/behaviors/WindowCoveringBehavior.d.ts.map +1 -1
- package/dist/matter/behaviors/WindowCoveringBehavior.js +102 -50
- package/dist/matter/behaviors/WindowCoveringBehavior.js.map +1 -1
- package/dist/matter/errors.d.ts +178 -0
- package/dist/matter/errors.d.ts.map +1 -0
- package/dist/matter/errors.js +200 -0
- package/dist/matter/errors.js.map +1 -0
- package/dist/matter/index.d.ts +1 -0
- package/dist/matter/index.d.ts.map +1 -1
- package/dist/matter/index.js +1 -0
- package/dist/matter/index.js.map +1 -1
- package/dist/matter/server.d.ts +9 -16
- package/dist/matter/server.d.ts.map +1 -1
- package/dist/matter/server.js +60 -142
- package/dist/matter/server.js.map +1 -1
- package/dist/matter/types.d.ts +11 -50
- package/dist/matter/types.d.ts.map +1 -1
- package/dist/matter/types.js +0 -17
- package/dist/matter/types.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +0 -7
- package/dist/server.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matter Protocol Errors
|
|
3
|
+
*
|
|
4
|
+
* This module provides error classes that plugin developers can throw
|
|
5
|
+
* to send specific Matter protocol status codes to controllers.
|
|
6
|
+
*
|
|
7
|
+
* When a handler throws one of these errors, the Matter server will send
|
|
8
|
+
* the appropriate status code to the controller (e.g., Home app) instead
|
|
9
|
+
* of crashing the endpoint.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { MatterStatus } from 'homebridge'
|
|
14
|
+
*
|
|
15
|
+
* handlers: {
|
|
16
|
+
* onOff: {
|
|
17
|
+
* on: async () => {
|
|
18
|
+
* if (deviceIsBusy) {
|
|
19
|
+
* throw new MatterStatus.Busy('Device is processing another command')
|
|
20
|
+
* }
|
|
21
|
+
* if (requestTimedOut) {
|
|
22
|
+
* throw new MatterStatus.Timeout('Device did not respond in time')
|
|
23
|
+
* }
|
|
24
|
+
* // ... control device
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
import { Status, StatusResponseError } from '@matter/main/types';
|
|
31
|
+
/**
|
|
32
|
+
* Base class for all Matter protocol errors
|
|
33
|
+
* Plugins can throw this directly or use specific error classes below
|
|
34
|
+
*/
|
|
35
|
+
export declare class MatterProtocolError extends StatusResponseError {
|
|
36
|
+
constructor(message: string, code: Status, clusterCode?: number);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Device is busy processing another action (Status.Busy = 156)
|
|
40
|
+
*
|
|
41
|
+
* Use when the device cannot handle the request because it's processing another operation.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* throw new MatterStatus.Busy('Device is currently processing another command')
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare class Busy extends MatterProtocolError {
|
|
49
|
+
constructor(message?: string);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Operation timed out (Status.Timeout = 148)
|
|
53
|
+
*
|
|
54
|
+
* Use when the device or operation times out.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* throw new MatterStatus.Timeout('Device did not respond within 5 seconds')
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare class Timeout extends MatterProtocolError {
|
|
62
|
+
constructor(message?: string);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Value out of range or invalid (Status.ConstraintError = 135)
|
|
66
|
+
*
|
|
67
|
+
* Use when a value is out of bounds or doesn't meet constraints.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* throw new MatterStatus.ConstraintError('Brightness must be between 0-254')
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare class ConstraintError extends MatterProtocolError {
|
|
75
|
+
constructor(message?: string);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Malformed action or invalid values (Status.InvalidAction = 128)
|
|
79
|
+
*
|
|
80
|
+
* Use when the command or action is malformed or has invalid field values.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* throw new MatterStatus.InvalidAction('Invalid color value provided')
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare class InvalidAction extends MatterProtocolError {
|
|
88
|
+
constructor(message?: string);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Current operational state prevents the action (Status.InvalidInState = 203)
|
|
92
|
+
*
|
|
93
|
+
* Use when the device state prevents the requested operation.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* throw new MatterStatus.InvalidInState('Cannot unlock door while security system is armed')
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare class InvalidInState extends MatterProtocolError {
|
|
101
|
+
constructor(message?: string);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Generic failure (Status.Failure = 1)
|
|
105
|
+
*
|
|
106
|
+
* Use as a fallback when no specific error applies.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* throw new MatterStatus.Failure('Device returned an error')
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export declare class Failure extends MatterProtocolError {
|
|
114
|
+
constructor(message?: string);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Insufficient resources to process the request (Status.ResourceExhausted = 137)
|
|
118
|
+
*
|
|
119
|
+
* Use when the device has insufficient resources to handle the request.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* throw new MatterStatus.ResourceExhausted('Maximum number of scenes reached')
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare class ResourceExhausted extends MatterProtocolError {
|
|
127
|
+
constructor(message?: string);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The sender does not have sufficient permissions (Status.PermissionDenied = 15)
|
|
131
|
+
*
|
|
132
|
+
* Use when access control prevents the operation.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* throw new MatterStatus.PermissionDenied('User does not have permission to unlock')
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export declare class PermissionDenied extends MatterProtocolError {
|
|
140
|
+
constructor(message?: string);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The requested entity was not found (Status.NotFound = 139)
|
|
144
|
+
*
|
|
145
|
+
* Use when a requested resource or entity doesn't exist.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* throw new MatterStatus.NotFound('Scene not found')
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
export declare class NotFound extends MatterProtocolError {
|
|
153
|
+
constructor(message?: string);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Helper to check if an error is a Matter protocol error
|
|
157
|
+
*/
|
|
158
|
+
export declare function isMatterProtocolError(error: unknown): error is MatterProtocolError;
|
|
159
|
+
/**
|
|
160
|
+
* Matter protocol status codes and error classes
|
|
161
|
+
*
|
|
162
|
+
* Use these error classes to signal specific error conditions to Matter controllers.
|
|
163
|
+
* Each error class corresponds to a Matter protocol status code.
|
|
164
|
+
*/
|
|
165
|
+
export declare const MatterStatus: {
|
|
166
|
+
MatterProtocolError: typeof MatterProtocolError;
|
|
167
|
+
Busy: typeof Busy;
|
|
168
|
+
Timeout: typeof Timeout;
|
|
169
|
+
ConstraintError: typeof ConstraintError;
|
|
170
|
+
InvalidAction: typeof InvalidAction;
|
|
171
|
+
InvalidInState: typeof InvalidInState;
|
|
172
|
+
Failure: typeof Failure;
|
|
173
|
+
ResourceExhausted: typeof ResourceExhausted;
|
|
174
|
+
PermissionDenied: typeof PermissionDenied;
|
|
175
|
+
NotFound: typeof NotFound;
|
|
176
|
+
isMatterProtocolError: typeof isMatterProtocolError;
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/matter/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEhE;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,mBAAmB;gBAC9C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;CAGhE;AAED;;;;;;;;;GASG;AACH,qBAAa,IAAK,SAAQ,mBAAmB;gBAC/B,OAAO,SAAmB;CAGvC;AAED;;;;;;;;;GASG;AACH,qBAAa,OAAQ,SAAQ,mBAAmB;gBAClC,OAAO,SAAwB;CAG5C;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,mBAAmB;gBAC1C,OAAO,SAAkC;CAGtD;AAED;;;;;;;;;GASG;AACH,qBAAa,aAAc,SAAQ,mBAAmB;gBACxC,OAAO,SAA6B;CAGjD;AAED;;;;;;;;;GASG;AACH,qBAAa,cAAe,SAAQ,mBAAmB;gBACzC,OAAO,SAA2C;CAG/D;AAED;;;;;;;;;GASG;AACH,qBAAa,OAAQ,SAAQ,mBAAmB;gBAClC,OAAO,SAAqB;CAGzC;AAED;;;;;;;;;GASG;AACH,qBAAa,iBAAkB,SAAQ,mBAAmB;gBAC5C,OAAO,SAA2B;CAG/C;AAED;;;;;;;;;GASG;AACH,qBAAa,gBAAiB,SAAQ,mBAAmB;gBAC3C,OAAO,SAAsB;CAG1C;AAED;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,mBAAmB;gBACnC,OAAO,SAAqB;CAGzC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAElF;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;CAYxB,CAAA"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matter Protocol Errors
|
|
3
|
+
*
|
|
4
|
+
* This module provides error classes that plugin developers can throw
|
|
5
|
+
* to send specific Matter protocol status codes to controllers.
|
|
6
|
+
*
|
|
7
|
+
* When a handler throws one of these errors, the Matter server will send
|
|
8
|
+
* the appropriate status code to the controller (e.g., Home app) instead
|
|
9
|
+
* of crashing the endpoint.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { MatterStatus } from 'homebridge'
|
|
14
|
+
*
|
|
15
|
+
* handlers: {
|
|
16
|
+
* onOff: {
|
|
17
|
+
* on: async () => {
|
|
18
|
+
* if (deviceIsBusy) {
|
|
19
|
+
* throw new MatterStatus.Busy('Device is processing another command')
|
|
20
|
+
* }
|
|
21
|
+
* if (requestTimedOut) {
|
|
22
|
+
* throw new MatterStatus.Timeout('Device did not respond in time')
|
|
23
|
+
* }
|
|
24
|
+
* // ... control device
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
import { Status, StatusResponseError } from '@matter/main/types';
|
|
31
|
+
/**
|
|
32
|
+
* Base class for all Matter protocol errors
|
|
33
|
+
* Plugins can throw this directly or use specific error classes below
|
|
34
|
+
*/
|
|
35
|
+
export class MatterProtocolError extends StatusResponseError {
|
|
36
|
+
constructor(message, code, clusterCode) {
|
|
37
|
+
super(message, code, clusterCode);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Device is busy processing another action (Status.Busy = 156)
|
|
42
|
+
*
|
|
43
|
+
* Use when the device cannot handle the request because it's processing another operation.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* throw new MatterStatus.Busy('Device is currently processing another command')
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export class Busy extends MatterProtocolError {
|
|
51
|
+
constructor(message = 'Device is busy') {
|
|
52
|
+
super(message, Status.Busy);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Operation timed out (Status.Timeout = 148)
|
|
57
|
+
*
|
|
58
|
+
* Use when the device or operation times out.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* throw new MatterStatus.Timeout('Device did not respond within 5 seconds')
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export class Timeout extends MatterProtocolError {
|
|
66
|
+
constructor(message = 'Operation timed out') {
|
|
67
|
+
super(message, Status.Timeout);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Value out of range or invalid (Status.ConstraintError = 135)
|
|
72
|
+
*
|
|
73
|
+
* Use when a value is out of bounds or doesn't meet constraints.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* throw new MatterStatus.ConstraintError('Brightness must be between 0-254')
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export class ConstraintError extends MatterProtocolError {
|
|
81
|
+
constructor(message = 'Value out of range or invalid') {
|
|
82
|
+
super(message, Status.ConstraintError);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Malformed action or invalid values (Status.InvalidAction = 128)
|
|
87
|
+
*
|
|
88
|
+
* Use when the command or action is malformed or has invalid field values.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* throw new MatterStatus.InvalidAction('Invalid color value provided')
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export class InvalidAction extends MatterProtocolError {
|
|
96
|
+
constructor(message = 'Invalid action or values') {
|
|
97
|
+
super(message, Status.InvalidAction);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Current operational state prevents the action (Status.InvalidInState = 203)
|
|
102
|
+
*
|
|
103
|
+
* Use when the device state prevents the requested operation.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* throw new MatterStatus.InvalidInState('Cannot unlock door while security system is armed')
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export class InvalidInState extends MatterProtocolError {
|
|
111
|
+
constructor(message = 'Operation not allowed in current state') {
|
|
112
|
+
super(message, Status.InvalidInState);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Generic failure (Status.Failure = 1)
|
|
117
|
+
*
|
|
118
|
+
* Use as a fallback when no specific error applies.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* throw new MatterStatus.Failure('Device returned an error')
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export class Failure extends MatterProtocolError {
|
|
126
|
+
constructor(message = 'Operation failed') {
|
|
127
|
+
super(message, Status.Failure);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Insufficient resources to process the request (Status.ResourceExhausted = 137)
|
|
132
|
+
*
|
|
133
|
+
* Use when the device has insufficient resources to handle the request.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* throw new MatterStatus.ResourceExhausted('Maximum number of scenes reached')
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export class ResourceExhausted extends MatterProtocolError {
|
|
141
|
+
constructor(message = 'Insufficient resources') {
|
|
142
|
+
super(message, Status.ResourceExhausted);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The sender does not have sufficient permissions (Status.PermissionDenied = 15)
|
|
147
|
+
*
|
|
148
|
+
* Use when access control prevents the operation.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* throw new MatterStatus.PermissionDenied('User does not have permission to unlock')
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
export class PermissionDenied extends MatterProtocolError {
|
|
156
|
+
constructor(message = 'Permission denied') {
|
|
157
|
+
super(message, Status.UnsupportedAccess);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The requested entity was not found (Status.NotFound = 139)
|
|
162
|
+
*
|
|
163
|
+
* Use when a requested resource or entity doesn't exist.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* throw new MatterStatus.NotFound('Scene not found')
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
export class NotFound extends MatterProtocolError {
|
|
171
|
+
constructor(message = 'Entity not found') {
|
|
172
|
+
super(message, Status.NotFound);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Helper to check if an error is a Matter protocol error
|
|
177
|
+
*/
|
|
178
|
+
export function isMatterProtocolError(error) {
|
|
179
|
+
return error instanceof StatusResponseError;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Matter protocol status codes and error classes
|
|
183
|
+
*
|
|
184
|
+
* Use these error classes to signal specific error conditions to Matter controllers.
|
|
185
|
+
* Each error class corresponds to a Matter protocol status code.
|
|
186
|
+
*/
|
|
187
|
+
export const MatterStatus = {
|
|
188
|
+
MatterProtocolError,
|
|
189
|
+
Busy,
|
|
190
|
+
Timeout,
|
|
191
|
+
ConstraintError,
|
|
192
|
+
InvalidAction,
|
|
193
|
+
InvalidInState,
|
|
194
|
+
Failure,
|
|
195
|
+
ResourceExhausted,
|
|
196
|
+
PermissionDenied,
|
|
197
|
+
NotFound,
|
|
198
|
+
isMatterProtocolError,
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/matter/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEhE;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,mBAAmB;IAC1D,YAAY,OAAe,EAAE,IAAY,EAAE,WAAoB;QAC7D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;IACnC,CAAC;CACF;AAED;;;;;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BAAmB;IACvD,YAAY,OAAO,GAAG,mBAAmB;QACvC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAC1C,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,QAAS,SAAQ,mBAAmB;IAC/C,YAAY,OAAO,GAAG,kBAAkB;QACtC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,OAAO,KAAK,YAAY,mBAAmB,CAAA;AAC7C,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,mBAAmB;IACnB,IAAI;IACJ,OAAO;IACP,eAAe;IACf,aAAa;IACb,cAAc;IACd,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,QAAQ;IACR,qBAAqB;CACtB,CAAA"}
|
package/dist/matter/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type { ColorControl, DoorLock, FanControl, Groups, Identify, LevelControl, ModeBase, OnOff, ScenesManagement, ServiceArea, Thermostat, WindowCovering } from '@matter/main/clusters';
|
|
8
8
|
export { ChildBridgeMatterManager } from './ChildBridgeMatterManager.js';
|
|
9
9
|
export { type MatterConfigValidationResult, MatterConfigValidator } from './configValidator.js';
|
|
10
|
+
export { MatterStatus } from './errors.js';
|
|
10
11
|
export { MatterBridgeManager } from './MatterBridgeManager.js';
|
|
11
12
|
export { MatterConfigCollector } from './MatterConfigCollector.js';
|
|
12
13
|
export { MatterServer } from './server.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/matter/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,QAAQ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ACvE,KAAY,kBAAkB,GAAG,QAAQ,CAAC,yBAAyB,CAAA;IACnE,KAAY,kBAAkB,GAAG,QAAQ,CAAC,yBAAyB,CAAA;IACnE,KAAY,oBAAoB,GAAG,QAAQ,CAAC,2BAA2B,CAAA;IACvE,KAAY,oBAAoB,GAAG,QAAQ,CAAC,2BAA2B,CAAA;IAKvE,KAAY,kBAAkB,GAAG,cAAc,CAAC,yBAAyB,CAAA;IACzE,KAAY,kBAAkB,GAAG,cAAc,CAAC,yBAAyB,CAAA;IACzE,KAAY,aAAa,GAAG,cAAc,CAAC,oBAAoB,CAAA;IAC/D,KAAY,aAAa,GAAG,cAAc,CAAC,oBAAoB,CAAA;IAK/D,KAAY,kBAAkB,GAAG,UAAU,CAAC,yBAAyB,CAAA;IACrE,KAAY,eAAe,GAAG,UAAU,CAAC,sBAAsB,CAAA;IAC/D,KAAY,iBAAiB,GAAG,UAAU,CAAC,wBAAwB,CAAA;IACnE,KAAY,iBAAiB,GAAG,UAAU,CAAC,wBAAwB,CAAA;IACnE,KAAY,iBAAiB,GAAG,UAAU,CAAC,wBAAwB,CAAA;IAKnE,KAAY,OAAO,GAAG,UAAU,CAAC,WAAW,CAAA;IAK5C,KAAY,YAAY,GAAG,QAAQ,CAAC,mBAAmB,CAAA;IAKvD,KAAY,WAAW,GAAG,WAAW,CAAC,kBAAkB,CAAA;IACxD,KAAY,QAAQ,GAAG,WAAW,CAAC,eAAe,CAAA;CACnD;AAED;;;;;;GAMG;AACH,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA"}
|
package/dist/matter/index.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export { ChildBridgeMatterManager } from './ChildBridgeMatterManager.js';
|
|
8
8
|
export { MatterConfigValidator } from './configValidator.js';
|
|
9
|
+
export { MatterStatus } from './errors.js';
|
|
9
10
|
export { MatterBridgeManager } from './MatterBridgeManager.js';
|
|
10
11
|
export { MatterConfigCollector } from './MatterConfigCollector.js';
|
|
11
12
|
export { MatterServer } from './server.js';
|
package/dist/matter/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/matter/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAqC,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,WAAW,EAIX,yBAAyB,EAIzB,wBAAwB,EAExB,iBAAiB,EACjB,WAAW,EAEX,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAA;AA0JnB;;;;;;GAMG;AACH,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/matter/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAqC,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,WAAW,EAIX,yBAAyB,EAIzB,wBAAwB,EAExB,iBAAiB,EACjB,WAAW,EAEX,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAA;AA0JnB;;;;;;GAMG;AACH,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA"}
|
package/dist/matter/server.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matter.js Server Implementation for Homebridge Plugin API
|
|
3
|
+
*
|
|
4
|
+
* This provides a Matter bridge that plugins can use to register
|
|
5
|
+
* Matter accessories via the Homebridge API.
|
|
6
|
+
*/
|
|
1
7
|
import type { SerializedMatterAccessory } from './accessoryCache.js';
|
|
2
8
|
import { EventEmitter } from 'node:events';
|
|
3
9
|
import * as clusters from '@matter/main/clusters';
|
|
@@ -6,8 +12,6 @@ import { deviceTypes, MatterAccessory, MatterServerEvents } from './types.js';
|
|
|
6
12
|
/**
|
|
7
13
|
* Matter Server for Homebridge Plugin API
|
|
8
14
|
* Allows plugins to register Matter accessories explicitly
|
|
9
|
-
*
|
|
10
|
-
* Extends EventEmitter to provide commissioning lifecycle events
|
|
11
15
|
*/
|
|
12
16
|
export declare class MatterServer extends EventEmitter {
|
|
13
17
|
on: <K extends keyof MatterServerEvents>(event: K, listener: MatterServerEvents[K]) => this;
|
|
@@ -33,9 +37,6 @@ export declare class MatterServer extends EventEmitter {
|
|
|
33
37
|
private storageManager;
|
|
34
38
|
private matterStoragePath?;
|
|
35
39
|
private accessoryCache;
|
|
36
|
-
private fabricMonitorInterval;
|
|
37
|
-
private fabricCheckTimeout;
|
|
38
|
-
private previousFabrics;
|
|
39
40
|
constructor(config: MatterServerConfig);
|
|
40
41
|
/**
|
|
41
42
|
* Validate and sanitize Matter server configuration
|
|
@@ -117,18 +118,10 @@ export declare class MatterServer extends EventEmitter {
|
|
|
117
118
|
*/
|
|
118
119
|
private waitForServerReady;
|
|
119
120
|
/**
|
|
120
|
-
*
|
|
121
|
-
* Uses
|
|
122
|
-
*/
|
|
123
|
-
private startFabricMonitoring;
|
|
124
|
-
/**
|
|
125
|
-
* Stop fabric monitoring and clean up watchers/timers
|
|
126
|
-
*/
|
|
127
|
-
private stopFabricMonitoring;
|
|
128
|
-
/**
|
|
129
|
-
* Check for fabric changes and emit appropriate events
|
|
121
|
+
* Set up Matter.js commissioning event listeners
|
|
122
|
+
* Uses native Matter.js events instead of file watching for reliability
|
|
130
123
|
*/
|
|
131
|
-
private
|
|
124
|
+
private setupCommissioningEventListeners;
|
|
132
125
|
/**
|
|
133
126
|
* Update commissioning info file when commissioning state changes
|
|
134
127
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/matter/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/matter/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAGpE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAiB1C,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAA;AAuCjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAGrD,OAAO,EACL,WAAW,EAGX,eAAe,EAGf,kBAAkB,EACnB,MAAM,YAAY,CAAA;AAqBnB;;;GAGG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAE7B,EAAE,EAAE,CAAC,CAAC,SAAS,MAAM,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;IAC3F,IAAI,EAAE,CAAC,CAAC,SAAS,MAAM,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,kBAAkB,CAAC,C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