@matterbridge/core 3.7.10 → 3.8.0-dev-20260524-eed6b4a
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/behaviors/activatedCarbonFilterMonitoringServer.d.ts +5 -2
- package/dist/behaviors/bindingServer.js +0 -2
- package/dist/behaviors/booleanStateConfigurationServer.d.ts +6 -1
- package/dist/behaviors/colorControlServer.d.ts +20 -774
- package/dist/behaviors/deviceEnergyManagementServer.d.ts +9 -299
- package/dist/behaviors/doorLockServer.d.ts +29 -47
- package/dist/behaviors/doorLockServer.js +11 -299
- package/dist/behaviors/fanControlServer.d.ts +8 -1
- package/dist/behaviors/hepaFilterMonitoringServer.d.ts +5 -2
- package/dist/behaviors/smokeCoAlarmServer.d.ts +4 -77
- package/dist/behaviors/thermostatServer.d.ts +20 -722
- package/dist/behaviors/valveConfigurationAndControlServer.d.ts +4 -1
- package/dist/behaviors/windowCoveringServer.d.ts +28 -564
- package/dist/clusters/closure-control.d.ts +130 -620
- package/dist/clusters/closure-control.js +15 -170
- package/dist/clusters/closure-dimension.d.ts +148 -814
- package/dist/clusters/closure-dimension.js +15 -202
- package/dist/clusters/export.d.ts +1 -3
- package/dist/clusters/export.js +1 -3
- package/dist/clusters/soil-measurement.d.ts +31 -31
- package/dist/clusters/soil-measurement.js +29 -19
- package/dist/devices/closure.d.ts +14 -291
- package/dist/devices/closure.js +6 -13
- package/dist/devices/closurePanel.d.ts +13 -370
- package/dist/devices/closurePanel.js +9 -15
- package/dist/devices/evse.d.ts +7 -1
- package/dist/devices/heatPump.js +5 -5
- package/dist/devices/irrigationSystem.js +2 -2
- package/dist/devices/microwaveOven.d.ts +5 -76
- package/dist/devices/roboticVacuumCleaner.js +5 -5
- package/dist/devices/soilSensor.d.ts +0 -15
- package/dist/devices/soilSensor.js +4 -20
- package/dist/devices/temperatureControl.d.ts +10 -130
- package/dist/frontend.js +9 -9
- package/dist/helpers.js +0 -8
- package/dist/jestutils/jestBroadcastServerSpy.d.ts +2 -2
- package/dist/jestutils/jestMatterTest.js +4 -4
- package/dist/jestutils/jestMatterbridgeEndpointSpy.d.ts +34 -37
- package/dist/jestutils/jestMatterbridgePlatformSpy.d.ts +4 -4
- package/dist/jestutils/jestMatterbridgeTest.js +1 -1
- package/dist/matter/export.d.ts +11 -0
- package/dist/matter/export.js +11 -0
- package/dist/matterbridge.d.ts +3 -0
- package/dist/matterbridge.js +10 -4
- package/dist/matterbridgeDeviceTypes.d.ts +15 -0
- package/dist/matterbridgeDeviceTypes.js +305 -162
- package/dist/matterbridgeEndpoint.d.ts +35 -25
- package/dist/matterbridgeEndpoint.js +6 -7
- package/dist/matterbridgeEndpointCommandHandler.d.ts +3 -59
- package/dist/matterbridgeEndpointHelpers.d.ts +83 -1382
- package/dist/matterbridgeEndpointHelpers.js +20 -5
- package/package.json +8 -8
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { DoorLockServer } from '@matter/node/behaviors/door-lock';
|
|
2
|
-
import { hasRemoteActor } from '@matter/protocol';
|
|
3
2
|
import { DoorLock } from '@matter/types/clusters/door-lock';
|
|
4
|
-
import { StatusResponse } from '@matter/types/common';
|
|
5
|
-
import { FabricIndex } from '@matter/types/datatype';
|
|
6
|
-
import { Status } from '@matter/types/globals';
|
|
7
3
|
import { getEnumDescription } from '@matterbridge/utils/enum';
|
|
8
|
-
import { debugStringify } from 'node-ansi-logger';
|
|
9
4
|
import { MatterbridgeServer } from './matterbridgeServer.js';
|
|
10
5
|
export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Feature.User, DoorLock.Feature.PinCredential).enable({
|
|
11
6
|
events: { doorLockAlarm: true, lockOperation: true, lockOperationError: true },
|
|
@@ -49,20 +44,8 @@ export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Fea
|
|
|
49
44
|
endpoint: this.endpoint,
|
|
50
45
|
context: this.context,
|
|
51
46
|
});
|
|
52
|
-
device.log.debug(`MatterbridgeDoorLockServer: unlockDoor called ${this.state.autoRelockTime ? 'with ' + this.state.autoRelockTime + ' seconds' : 'without'} autoRelockTime
|
|
47
|
+
device.log.debug(`MatterbridgeDoorLockServer: unlockDoor called ${this.state.autoRelockTime ? 'with ' + this.state.autoRelockTime + ' seconds' : 'without'} autoRelockTime`);
|
|
53
48
|
await super.unlockDoor(request);
|
|
54
|
-
if (!this.internal.enableTimeout)
|
|
55
|
-
return;
|
|
56
|
-
if (this.state.autoRelockTime) {
|
|
57
|
-
clearTimeout(this.internal.unlockTimeout);
|
|
58
|
-
this.internal.unlockTimeout = setTimeout(async () => {
|
|
59
|
-
this.internal.unlockTimeout = undefined;
|
|
60
|
-
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
61
|
-
const state = this.endpoint.stateOf(MatterbridgeDoorLockServer.with());
|
|
62
|
-
device.log.info(`Auto-relocking door after ${state.autoRelockTime} seconds (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
63
|
-
await this.endpoint.act((agent) => agent.get(MatterbridgeDoorLockServer.with()).lockDoor({ pinCode: request.pinCode }));
|
|
64
|
-
}, this.state.autoRelockTime * 1000).unref();
|
|
65
|
-
}
|
|
66
49
|
}
|
|
67
50
|
async unlockWithTimeout(request) {
|
|
68
51
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
@@ -79,25 +62,12 @@ export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Fea
|
|
|
79
62
|
endpoint: this.endpoint,
|
|
80
63
|
context: this.context,
|
|
81
64
|
});
|
|
82
|
-
device.log.debug(`MatterbridgeDoorLockServer: unlockWithTimeout called
|
|
83
|
-
|
|
84
|
-
if (!this.internal.enableTimeout)
|
|
85
|
-
return;
|
|
86
|
-
if (request.timeout) {
|
|
87
|
-
clearTimeout(this.internal.unlockTimeout);
|
|
88
|
-
this.internal.unlockTimeout = setTimeout(async () => {
|
|
89
|
-
this.internal.unlockTimeout = undefined;
|
|
90
|
-
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
91
|
-
device.log.info(`Locking door after ${request.timeout} seconds (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
92
|
-
await this.endpoint.act((agent) => agent.get(MatterbridgeDoorLockServer.with()).lockDoor({ pinCode: request.pinCode }));
|
|
93
|
-
}, request.timeout * 1000).unref();
|
|
94
|
-
}
|
|
65
|
+
device.log.debug(`MatterbridgeDoorLockServer: unlockWithTimeout called`);
|
|
66
|
+
await super.unlockWithTimeout(request);
|
|
95
67
|
}
|
|
96
68
|
async setUser(request) {
|
|
97
69
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
98
|
-
const accessingFabricIndex = this.getAccessingFabricIndex();
|
|
99
70
|
device.log.info(`Setting user operationType ${getEnumDescription(DoorLock.DataOperationType, request.operationType)} userIndex ${request.userIndex} userName ${request.userName ?? 'null'} userUniqueId ${request.userUniqueId ?? 'null'} userStatus ${getEnumDescription(DoorLock.UserStatus, request.userStatus, { fallback: 'null' })} userType ${getEnumDescription(DoorLock.UserType, request.userType, { fallback: 'null' })} credentialRule ${getEnumDescription(DoorLock.CredentialRule, request.credentialRule, { fallback: 'null' })} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
100
|
-
device.log.debug(`MatterbridgeDoorLockServer: setUser accessingFabricIndex ${accessingFabricIndex ?? 'null'}`);
|
|
101
71
|
await device.commandHandler.executeHandler('DoorLock.setUser', {
|
|
102
72
|
command: 'setUser',
|
|
103
73
|
request,
|
|
@@ -106,49 +76,8 @@ export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Fea
|
|
|
106
76
|
endpoint: this.endpoint,
|
|
107
77
|
context: this.context,
|
|
108
78
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (!user && request.operationType === DoorLock.DataOperationType.Add) {
|
|
112
|
-
this.internal.users.push({
|
|
113
|
-
userIndex: request.userIndex,
|
|
114
|
-
userName: request.userName ?? '',
|
|
115
|
-
userUniqueId: request.userUniqueId ?? 0xffffffff,
|
|
116
|
-
userStatus: request.userStatus ?? DoorLock.UserStatus.OccupiedEnabled,
|
|
117
|
-
userType: request.userType ?? DoorLock.UserType.UnrestrictedUser,
|
|
118
|
-
credentialRule: request.credentialRule ?? DoorLock.CredentialRule.Single,
|
|
119
|
-
credentials: [],
|
|
120
|
-
creatorFabricIndex: accessingFabricIndex,
|
|
121
|
-
lastModifiedFabricIndex: accessingFabricIndex,
|
|
122
|
-
});
|
|
123
|
-
this.events.lockUserChange.emit({
|
|
124
|
-
lockDataType: DoorLock.LockDataType.UserIndex,
|
|
125
|
-
dataOperationType: DoorLock.DataOperationType.Add,
|
|
126
|
-
operationSource: this.getOperationSource(),
|
|
127
|
-
userIndex: request.userIndex,
|
|
128
|
-
fabricIndex: accessingFabricIndex,
|
|
129
|
-
sourceNode: this.getAccessingNodeId(),
|
|
130
|
-
dataIndex: request.userIndex,
|
|
131
|
-
}, this.context);
|
|
132
|
-
device.log.debug(`MatterbridgeDoorLockServer: added userIndex ${request.userIndex} (total users: ${this.internal.users.length}) to internal state: ${debugStringify(this.internal.users.find((storedUser) => storedUser.userIndex === request.userIndex))}`);
|
|
133
|
-
}
|
|
134
|
-
else if (user && request.operationType === DoorLock.DataOperationType.Modify) {
|
|
135
|
-
user.userName = request.userName ?? user.userName;
|
|
136
|
-
user.userUniqueId = request.userUniqueId ?? user.userUniqueId;
|
|
137
|
-
user.userStatus = request.userStatus ?? user.userStatus;
|
|
138
|
-
user.userType = request.userType ?? user.userType;
|
|
139
|
-
user.credentialRule = request.credentialRule ?? user.credentialRule;
|
|
140
|
-
user.lastModifiedFabricIndex = accessingFabricIndex;
|
|
141
|
-
this.events.lockUserChange.emit({
|
|
142
|
-
lockDataType: DoorLock.LockDataType.UserIndex,
|
|
143
|
-
dataOperationType: DoorLock.DataOperationType.Modify,
|
|
144
|
-
operationSource: this.getOperationSource(),
|
|
145
|
-
userIndex: request.userIndex,
|
|
146
|
-
fabricIndex: accessingFabricIndex,
|
|
147
|
-
sourceNode: this.getAccessingNodeId(),
|
|
148
|
-
dataIndex: request.userIndex,
|
|
149
|
-
}, this.context);
|
|
150
|
-
device.log.debug(`MatterbridgeDoorLockServer: modified userIndex ${request.userIndex} (total users: ${this.internal.users.length}) in internal state: ${debugStringify(user)}`);
|
|
151
|
-
}
|
|
79
|
+
device.log.debug(`MatterbridgeDoorLockServer: setUser called for userIndex ${request.userIndex}`);
|
|
80
|
+
await super.setUser(request);
|
|
152
81
|
}
|
|
153
82
|
async getUser(request) {
|
|
154
83
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
@@ -165,32 +94,10 @@ export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Fea
|
|
|
165
94
|
return response;
|
|
166
95
|
}
|
|
167
96
|
device.log.debug(`MatterbridgeDoorLockServer: getUser called for userIndex ${request.userIndex}`);
|
|
168
|
-
|
|
169
|
-
throw new StatusResponse.InvalidCommandError('Invalid userIndex in GetUser request');
|
|
170
|
-
const user = this.internal.users.find((storedUser) => storedUser.userIndex === request.userIndex);
|
|
171
|
-
if (!user) {
|
|
172
|
-
return {
|
|
173
|
-
userIndex: request.userIndex,
|
|
174
|
-
userName: null,
|
|
175
|
-
userUniqueId: null,
|
|
176
|
-
userStatus: null,
|
|
177
|
-
userType: null,
|
|
178
|
-
credentialRule: null,
|
|
179
|
-
credentials: null,
|
|
180
|
-
creatorFabricIndex: null,
|
|
181
|
-
lastModifiedFabricIndex: null,
|
|
182
|
-
nextUserIndex: null,
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
...user,
|
|
187
|
-
credentials: user.credentials?.map(({ credentialType, credentialIndex }) => ({ credentialType, credentialIndex })) ?? null,
|
|
188
|
-
nextUserIndex: this.getNextUserIndex(request.userIndex),
|
|
189
|
-
};
|
|
97
|
+
return await super.getUser(request);
|
|
190
98
|
}
|
|
191
99
|
async clearUser(request) {
|
|
192
100
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
193
|
-
const accessingFabricIndex = this.getAccessingFabricIndex();
|
|
194
101
|
device.log.info(`Clearing userIndex ${request.userIndex} ${request.userIndex === 0xfffe ? '(all users)' : ''} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
195
102
|
await device.commandHandler.executeHandler('DoorLock.clearUser', {
|
|
196
103
|
command: 'clearUser',
|
|
@@ -201,27 +108,10 @@ export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Fea
|
|
|
201
108
|
context: this.context,
|
|
202
109
|
});
|
|
203
110
|
device.log.debug(`MatterbridgeDoorLockServer: clearUser called for userIndex ${request.userIndex}`);
|
|
204
|
-
|
|
205
|
-
throw new StatusResponse.InvalidCommandError('Invalid userIndex in ClearUser request');
|
|
206
|
-
if (request.userIndex === 0xfffe) {
|
|
207
|
-
this.internal.users = [];
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
this.internal.users = this.internal.users.filter((storedUser) => storedUser.userIndex !== request.userIndex);
|
|
211
|
-
}
|
|
212
|
-
this.events.lockUserChange.emit({
|
|
213
|
-
lockDataType: DoorLock.LockDataType.UserIndex,
|
|
214
|
-
dataOperationType: DoorLock.DataOperationType.Clear,
|
|
215
|
-
operationSource: this.getOperationSource(),
|
|
216
|
-
userIndex: request.userIndex,
|
|
217
|
-
fabricIndex: accessingFabricIndex,
|
|
218
|
-
sourceNode: this.getAccessingNodeId(),
|
|
219
|
-
dataIndex: request.userIndex,
|
|
220
|
-
}, this.context);
|
|
111
|
+
await super.clearUser(request);
|
|
221
112
|
}
|
|
222
113
|
async setCredential(request) {
|
|
223
114
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
224
|
-
const accessingFabricIndex = this.getAccessingFabricIndex();
|
|
225
115
|
device.log.info(`Setting credential operationType ${getEnumDescription(DoorLock.DataOperationType, request.operationType)} credentialType ${getEnumDescription(DoorLock.CredentialType, request.credential.credentialType)} credentialIndex ${request.credential.credentialIndex} credentialData ${Buffer.from(request.credentialData).toString('hex') ? '0x' + Buffer.from(request.credentialData).toString('hex') : '0x'} userIndex ${request.userIndex ?? 'null'} userStatus ${getEnumDescription(DoorLock.UserStatus, request.userStatus, { fallback: 'null' })} userType ${getEnumDescription(DoorLock.UserType, request.userType, { fallback: 'null' })} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
226
116
|
await device.commandHandler.executeHandler('DoorLock.setCredential', {
|
|
227
117
|
command: 'setCredential',
|
|
@@ -231,45 +121,8 @@ export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Fea
|
|
|
231
121
|
endpoint: this.endpoint,
|
|
232
122
|
context: this.context,
|
|
233
123
|
});
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
device.log.debug(`MatterbridgeDoorLockServer: setCredential pre-update lookup for credentialIndex ${request.credential.credentialIndex} (${existingCredential ? 'existing credential found' : 'no existing credential'})`);
|
|
237
|
-
if (user && (request.operationType === DoorLock.DataOperationType.Add || request.operationType === DoorLock.DataOperationType.Modify)) {
|
|
238
|
-
const credential = user.credentials?.find((storedCredential) => storedCredential.credentialType === request.credential.credentialType && storedCredential.credentialIndex === request.credential.credentialIndex);
|
|
239
|
-
if (credential) {
|
|
240
|
-
credential.credentialData = request.credentialData;
|
|
241
|
-
credential.creatorFabricIndex = credential.creatorFabricIndex ?? accessingFabricIndex;
|
|
242
|
-
credential.lastModifiedFabricIndex = accessingFabricIndex;
|
|
243
|
-
device.log.debug(`MatterbridgeDoorLockServer: modified credentialIndex ${request.credential.credentialIndex} for userIndex ${request.userIndex} in internal state: ${debugStringify(user)}`);
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
user.credentials = user.credentials ?? [];
|
|
247
|
-
user.credentials.push({
|
|
248
|
-
credentialType: request.credential.credentialType,
|
|
249
|
-
credentialIndex: request.credential.credentialIndex,
|
|
250
|
-
credentialData: request.credentialData,
|
|
251
|
-
creatorFabricIndex: accessingFabricIndex,
|
|
252
|
-
lastModifiedFabricIndex: accessingFabricIndex,
|
|
253
|
-
});
|
|
254
|
-
device.log.debug(`MatterbridgeDoorLockServer: added credentialIndex ${request.credential.credentialIndex} for userIndex ${request.userIndex} to internal state: ${debugStringify(user)}`);
|
|
255
|
-
}
|
|
256
|
-
this.events.lockUserChange.emit({
|
|
257
|
-
lockDataType: this.getLockDataTypeForCredentialType(request.credential.credentialType),
|
|
258
|
-
dataOperationType: request.operationType,
|
|
259
|
-
operationSource: this.getOperationSource(),
|
|
260
|
-
userIndex: request.userIndex,
|
|
261
|
-
fabricIndex: accessingFabricIndex,
|
|
262
|
-
sourceNode: this.getAccessingNodeId(),
|
|
263
|
-
dataIndex: this.getCredentialDataIndex(request.credential),
|
|
264
|
-
}, this.context);
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
device.log.debug(`MatterbridgeDoorLockServer: setCredential did not update internal state for credentialIndex ${request.credential.credentialIndex} (user ${request.userIndex ?? 'null'} not found or operation not handled)`);
|
|
268
|
-
}
|
|
269
|
-
return {
|
|
270
|
-
status: Status.Success,
|
|
271
|
-
userIndex: request.userIndex,
|
|
272
|
-
};
|
|
124
|
+
device.log.debug(`MatterbridgeDoorLockServer: setCredential called for userIndex ${request.userIndex}`);
|
|
125
|
+
return await super.setCredential(request);
|
|
273
126
|
}
|
|
274
127
|
async getCredentialStatus(request) {
|
|
275
128
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
@@ -283,23 +136,10 @@ export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Fea
|
|
|
283
136
|
context: this.context,
|
|
284
137
|
});
|
|
285
138
|
device.log.debug(`MatterbridgeDoorLockServer: getCredentialStatus called`);
|
|
286
|
-
|
|
287
|
-
const nextCredentialIndex = this.getNextOccupiedCredentialIndex(request.credential);
|
|
288
|
-
const response = {
|
|
289
|
-
credentialExists: credentialRecord !== null,
|
|
290
|
-
userIndex: credentialRecord?.user.userIndex ?? null,
|
|
291
|
-
creatorFabricIndex: credentialRecord?.storedCredential.creatorFabricIndex ?? null,
|
|
292
|
-
lastModifiedFabricIndex: credentialRecord?.storedCredential.lastModifiedFabricIndex ?? null,
|
|
293
|
-
nextCredentialIndex,
|
|
294
|
-
};
|
|
295
|
-
device.log.debug(`MatterbridgeDoorLockServer: getCredentialStatus result ${debugStringify(response)}`);
|
|
296
|
-
return response;
|
|
139
|
+
return await super.getCredentialStatus(request);
|
|
297
140
|
}
|
|
298
141
|
async clearCredential(request) {
|
|
299
142
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
300
|
-
const accessingFabricIndex = this.getAccessingFabricIndex();
|
|
301
|
-
const clearedCredentialUserIndex = request.credential !== null && request.credential.credentialIndex !== 0xfffe ? (this.findStoredCredential(request.credential)?.user.userIndex ?? null) : null;
|
|
302
|
-
const credentialTypesToClear = request.credential !== null ? [request.credential.credentialType] : this.getStoredCredentialTypes();
|
|
303
143
|
device.log.info(`Clearing credentialType ${request.credential ? getEnumDescription(DoorLock.CredentialType, request.credential.credentialType) : 'null'} credentialIndex ${request.credential ? request.credential.credentialIndex : 'null'} ${request.credential === null ? '(all credentials)' : ''} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
304
144
|
await device.commandHandler.executeHandler('DoorLock.clearCredential', {
|
|
305
145
|
command: 'clearCredential',
|
|
@@ -310,134 +150,6 @@ export class MatterbridgeDoorLockServer extends DoorLockServer.with(DoorLock.Fea
|
|
|
310
150
|
context: this.context,
|
|
311
151
|
});
|
|
312
152
|
device.log.debug('MatterbridgeDoorLockServer: clearCredential called');
|
|
313
|
-
|
|
314
|
-
user.credentials =
|
|
315
|
-
user.credentials?.filter((storedCredential) => {
|
|
316
|
-
if (request.credential === null) {
|
|
317
|
-
return false;
|
|
318
|
-
}
|
|
319
|
-
if (storedCredential.credentialType !== request.credential.credentialType) {
|
|
320
|
-
return true;
|
|
321
|
-
}
|
|
322
|
-
if (request.credential.credentialIndex === 0xfffe) {
|
|
323
|
-
return false;
|
|
324
|
-
}
|
|
325
|
-
return storedCredential.credentialIndex !== request.credential.credentialIndex;
|
|
326
|
-
}) ?? user.credentials;
|
|
327
|
-
}
|
|
328
|
-
for (const credentialType of credentialTypesToClear) {
|
|
329
|
-
this.events.lockUserChange.emit({
|
|
330
|
-
lockDataType: this.getLockDataTypeForCredentialType(credentialType),
|
|
331
|
-
dataOperationType: DoorLock.DataOperationType.Clear,
|
|
332
|
-
operationSource: this.getOperationSource(),
|
|
333
|
-
userIndex: request.credential === null || request.credential.credentialIndex === 0xfffe ? null : clearedCredentialUserIndex,
|
|
334
|
-
fabricIndex: accessingFabricIndex,
|
|
335
|
-
sourceNode: this.getAccessingNodeId(),
|
|
336
|
-
dataIndex: request.credential === null ? 0xfffe : this.getCredentialDataIndex(request.credential),
|
|
337
|
-
}, this.context);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
validateUserIndex(userIndex) {
|
|
341
|
-
if (userIndex < 1 || userIndex > this.state.numberOfTotalUsersSupported) {
|
|
342
|
-
return false;
|
|
343
|
-
}
|
|
344
|
-
return true;
|
|
345
|
-
}
|
|
346
|
-
getNextUserIndex(userIndex) {
|
|
347
|
-
const nextUser = this.internal.users.find((storedUser) => storedUser.userIndex === userIndex + 1);
|
|
348
|
-
if (nextUser && nextUser.userStatus !== DoorLock.UserStatus.Available) {
|
|
349
|
-
return nextUser.userIndex;
|
|
350
|
-
}
|
|
351
|
-
return null;
|
|
352
|
-
}
|
|
353
|
-
getAccessingFabricIndex() {
|
|
354
|
-
let fabricIndex;
|
|
355
|
-
try {
|
|
356
|
-
fabricIndex = this.context.fabric;
|
|
357
|
-
}
|
|
358
|
-
catch {
|
|
359
|
-
return null;
|
|
360
|
-
}
|
|
361
|
-
if (fabricIndex === undefined || fabricIndex === FabricIndex.NO_FABRIC) {
|
|
362
|
-
return null;
|
|
363
|
-
}
|
|
364
|
-
return fabricIndex;
|
|
365
|
-
}
|
|
366
|
-
getAccessingNodeId() {
|
|
367
|
-
if (!hasRemoteActor(this.context)) {
|
|
368
|
-
return null;
|
|
369
|
-
}
|
|
370
|
-
return this.context.session.peerNodeId ?? null;
|
|
371
|
-
}
|
|
372
|
-
getOperationSource() {
|
|
373
|
-
return this.getAccessingNodeId() !== null ? DoorLock.OperationSource.Remote : DoorLock.OperationSource.Unspecified;
|
|
374
|
-
}
|
|
375
|
-
getLockDataTypeForCredentialType(credentialType) {
|
|
376
|
-
switch (credentialType) {
|
|
377
|
-
case DoorLock.CredentialType.ProgrammingPin:
|
|
378
|
-
return DoorLock.LockDataType.ProgrammingCode;
|
|
379
|
-
case DoorLock.CredentialType.Pin:
|
|
380
|
-
return DoorLock.LockDataType.Pin;
|
|
381
|
-
case DoorLock.CredentialType.Rfid:
|
|
382
|
-
return DoorLock.LockDataType.Rfid;
|
|
383
|
-
case DoorLock.CredentialType.Fingerprint:
|
|
384
|
-
return DoorLock.LockDataType.Fingerprint;
|
|
385
|
-
case DoorLock.CredentialType.FingerVein:
|
|
386
|
-
return DoorLock.LockDataType.FingerVein;
|
|
387
|
-
case DoorLock.CredentialType.Face:
|
|
388
|
-
return DoorLock.LockDataType.Face;
|
|
389
|
-
case DoorLock.CredentialType.AliroCredentialIssuerKey:
|
|
390
|
-
return DoorLock.LockDataType.AliroCredentialIssuerKey;
|
|
391
|
-
case DoorLock.CredentialType.AliroEvictableEndpointKey:
|
|
392
|
-
return DoorLock.LockDataType.AliroEvictableEndpointKey;
|
|
393
|
-
case DoorLock.CredentialType.AliroNonEvictableEndpointKey:
|
|
394
|
-
return DoorLock.LockDataType.AliroNonEvictableEndpointKey;
|
|
395
|
-
default:
|
|
396
|
-
return DoorLock.LockDataType.Unspecified;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
getCredentialDataIndex(credential) {
|
|
400
|
-
if (credential.credentialType === DoorLock.CredentialType.ProgrammingPin) {
|
|
401
|
-
return null;
|
|
402
|
-
}
|
|
403
|
-
return credential.credentialIndex;
|
|
404
|
-
}
|
|
405
|
-
getStoredCredentialTypes() {
|
|
406
|
-
const credentialTypes = new Set();
|
|
407
|
-
for (const user of this.internal.users) {
|
|
408
|
-
for (const credential of user.credentials ?? []) {
|
|
409
|
-
credentialTypes.add(credential.credentialType);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
return [...credentialTypes];
|
|
413
|
-
}
|
|
414
|
-
findStoredCredential(credential) {
|
|
415
|
-
for (const user of this.internal.users) {
|
|
416
|
-
for (const storedCredential of user.credentials ?? []) {
|
|
417
|
-
if (storedCredential.credentialType === credential.credentialType && storedCredential.credentialIndex === credential.credentialIndex) {
|
|
418
|
-
return { user, storedCredential };
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
return null;
|
|
423
|
-
}
|
|
424
|
-
getNextOccupiedCredentialIndex(credential) {
|
|
425
|
-
for (const user of this.internal.users) {
|
|
426
|
-
for (const storedCredential of user.credentials ?? []) {
|
|
427
|
-
if (storedCredential.credentialType !== credential.credentialType || storedCredential.credentialIndex <= credential.credentialIndex) {
|
|
428
|
-
continue;
|
|
429
|
-
}
|
|
430
|
-
return storedCredential.credentialIndex;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
return null;
|
|
153
|
+
await super.clearCredential(request);
|
|
434
154
|
}
|
|
435
155
|
}
|
|
436
|
-
(function (MatterbridgeDoorLockServer) {
|
|
437
|
-
class Internal {
|
|
438
|
-
enableTimeout = true;
|
|
439
|
-
unlockTimeout;
|
|
440
|
-
users = [];
|
|
441
|
-
}
|
|
442
|
-
MatterbridgeDoorLockServer.Internal = Internal;
|
|
443
|
-
})(MatterbridgeDoorLockServer || (MatterbridgeDoorLockServer = {}));
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { FanControlServer } from '@matter/node/behaviors/fan-control';
|
|
2
2
|
import { FanControl } from '@matter/types/clusters/fan-control';
|
|
3
|
-
declare const MatterbridgeFanControlServer_base: import("@matter/node").ClusterBehavior.Type<import("@matter/types").
|
|
3
|
+
declare const MatterbridgeFanControlServer_base: import("@matter/node").ClusterBehavior.Type<typeof FanControlServer, import("@matter/types").ClusterType.WithSupportedFeatures<FanControl, {
|
|
4
|
+
step: true;
|
|
5
|
+
airflowDirection: false;
|
|
6
|
+
multiSpeed: false;
|
|
7
|
+
auto: true;
|
|
8
|
+
rocking: false;
|
|
9
|
+
wind: false;
|
|
10
|
+
}>, import("@matter/types").ClusterType.Concrete, new () => {}, "fanControl">;
|
|
4
11
|
export declare class MatterbridgeFanControlServer extends MatterbridgeFanControlServer_base {
|
|
5
12
|
step(request: FanControl.StepRequest): Promise<void>;
|
|
6
13
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { HepaFilterMonitoringServer } from '@matter/node/behaviors/hepa-filter-monitoring';
|
|
2
2
|
import { HepaFilterMonitoring } from '@matter/types/clusters/hepa-filter-monitoring';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const MatterbridgeHepaFilterMonitoringServer_base: import("@matter/node").ClusterBehavior.Type<typeof HepaFilterMonitoringServer, import("@matter/types").ClusterType.WithSupportedFeatures<HepaFilterMonitoring, {
|
|
4
|
+
condition: true;
|
|
5
|
+
replacementProductList: false;
|
|
6
|
+
warning: false;
|
|
7
|
+
}>, import("@matter/types").ClusterType.Concrete, new () => {}, "hepaFilterMonitoring">;
|
|
5
8
|
export declare class MatterbridgeHepaFilterMonitoringServer extends MatterbridgeHepaFilterMonitoringServer_base {
|
|
6
9
|
resetCondition(): Promise<void>;
|
|
7
10
|
}
|
|
@@ -1,82 +1,9 @@
|
|
|
1
1
|
import { SmokeCoAlarmServer } from '@matter/node/behaviors/smoke-co-alarm';
|
|
2
2
|
import { SmokeCoAlarm } from '@matter/types/clusters/smoke-co-alarm';
|
|
3
|
-
declare const MatterbridgeSmokeCoAlarmServer_base: import("@matter/node").ClusterBehavior.Type<import("@matter/types").
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly features: {
|
|
8
|
-
readonly smokeAlarm: import("@matter/types").BitFlag;
|
|
9
|
-
readonly coAlarm: import("@matter/types").BitFlag;
|
|
10
|
-
};
|
|
11
|
-
readonly attributes: {
|
|
12
|
-
readonly expressedState: import("@matter/types").Attribute<SmokeCoAlarm.ExpressedState, any>;
|
|
13
|
-
readonly batteryAlert: import("@matter/types").Attribute<SmokeCoAlarm.AlarmState, any>;
|
|
14
|
-
readonly deviceMuted: import("@matter/types").OptionalAttribute<SmokeCoAlarm.MuteState, any>;
|
|
15
|
-
readonly testInProgress: import("@matter/types").Attribute<boolean, any>;
|
|
16
|
-
readonly hardwareFaultAlert: import("@matter/types").Attribute<boolean, any>;
|
|
17
|
-
readonly endOfServiceAlert: import("@matter/types").Attribute<SmokeCoAlarm.EndOfService, any>;
|
|
18
|
-
readonly interconnectSmokeAlarm: import("@matter/types").OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
|
|
19
|
-
readonly interconnectCoAlarm: import("@matter/types").OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
|
|
20
|
-
readonly expiryDate: import("@matter/types").OptionalFixedAttribute<number, any>;
|
|
21
|
-
};
|
|
22
|
-
readonly commands: {
|
|
23
|
-
readonly selfTestRequest: import("@matter/types").OptionalCommand<void, void, any>;
|
|
24
|
-
};
|
|
25
|
-
readonly events: {
|
|
26
|
-
readonly lowBattery: import("@matter/types").Event<import("@matter/types").TypeFromFields<{
|
|
27
|
-
alarmSeverityLevel: import("@matter/types").FieldType<SmokeCoAlarm.AlarmState>;
|
|
28
|
-
}>, any>;
|
|
29
|
-
readonly hardwareFault: import("@matter/types").Event<void, any>;
|
|
30
|
-
readonly endOfService: import("@matter/types").Event<void, any>;
|
|
31
|
-
readonly selfTestComplete: import("@matter/types").Event<void, any>;
|
|
32
|
-
readonly alarmMuted: import("@matter/types").OptionalEvent<void, any>;
|
|
33
|
-
readonly muteEnded: import("@matter/types").OptionalEvent<void, any>;
|
|
34
|
-
readonly allClear: import("@matter/types").Event<void, any>;
|
|
35
|
-
};
|
|
36
|
-
readonly extensions: readonly [{
|
|
37
|
-
readonly flags: {
|
|
38
|
-
readonly smokeAlarm: true;
|
|
39
|
-
};
|
|
40
|
-
readonly component: {
|
|
41
|
-
readonly attributes: {
|
|
42
|
-
readonly smokeState: import("@matter/types").Attribute<SmokeCoAlarm.AlarmState, any>;
|
|
43
|
-
readonly contaminationState: import("@matter/types").OptionalAttribute<SmokeCoAlarm.ContaminationState, any>;
|
|
44
|
-
readonly smokeSensitivityLevel: import("@matter/types").OptionalWritableAttribute<SmokeCoAlarm.Sensitivity, any>;
|
|
45
|
-
};
|
|
46
|
-
readonly events: {
|
|
47
|
-
readonly smokeAlarm: import("@matter/types").Event<import("@matter/types").TypeFromFields<{
|
|
48
|
-
alarmSeverityLevel: import("@matter/types").FieldType<SmokeCoAlarm.AlarmState>;
|
|
49
|
-
}>, any>;
|
|
50
|
-
readonly interconnectSmokeAlarm: import("@matter/types").OptionalEvent<import("@matter/types").TypeFromFields<{
|
|
51
|
-
alarmSeverityLevel: import("@matter/types").FieldType<SmokeCoAlarm.AlarmState>;
|
|
52
|
-
}>, any>;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
}, {
|
|
56
|
-
readonly flags: {
|
|
57
|
-
readonly coAlarm: true;
|
|
58
|
-
};
|
|
59
|
-
readonly component: {
|
|
60
|
-
readonly attributes: {
|
|
61
|
-
readonly coState: import("@matter/types").Attribute<SmokeCoAlarm.AlarmState, any>;
|
|
62
|
-
};
|
|
63
|
-
readonly events: {
|
|
64
|
-
readonly coAlarm: import("@matter/types").Event<import("@matter/types").TypeFromFields<{
|
|
65
|
-
alarmSeverityLevel: import("@matter/types").FieldType<SmokeCoAlarm.AlarmState>;
|
|
66
|
-
}>, any>;
|
|
67
|
-
readonly interconnectCoAlarm: import("@matter/types").OptionalEvent<import("@matter/types").TypeFromFields<{
|
|
68
|
-
alarmSeverityLevel: import("@matter/types").FieldType<SmokeCoAlarm.AlarmState>;
|
|
69
|
-
}>, any>;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}, {
|
|
73
|
-
readonly flags: {
|
|
74
|
-
readonly smokeAlarm: false;
|
|
75
|
-
readonly coAlarm: false;
|
|
76
|
-
};
|
|
77
|
-
readonly component: false;
|
|
78
|
-
}];
|
|
79
|
-
}>, readonly [SmokeCoAlarm.Feature.SmokeAlarm, SmokeCoAlarm.Feature.CoAlarm]>, typeof SmokeCoAlarmServer, import("@matter/node/behaviors/smoke-co-alarm").SmokeCoAlarmInterface>;
|
|
3
|
+
declare const MatterbridgeSmokeCoAlarmServer_base: import("@matter/node").ClusterBehavior.Type<typeof SmokeCoAlarmServer, import("@matter/types").ClusterType.WithSupportedFeatures<SmokeCoAlarm, {
|
|
4
|
+
smokeAlarm: true;
|
|
5
|
+
coAlarm: true;
|
|
6
|
+
}>, import("@matter/types").ClusterType.Concrete, new () => {}, "smokeCoAlarm">;
|
|
80
7
|
export declare class MatterbridgeSmokeCoAlarmServer extends MatterbridgeSmokeCoAlarmServer_base {
|
|
81
8
|
selfTestRequest(): Promise<void>;
|
|
82
9
|
}
|