@project-chip/matter.js 0.13.0-alpha.0-20250318-c1aa38b08 → 0.13.0-alpha.0-20250323-770919c6a
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/cjs/CommissioningController.d.ts +31 -9
- package/dist/cjs/CommissioningController.d.ts.map +1 -1
- package/dist/cjs/CommissioningController.js +34 -16
- package/dist/cjs/CommissioningController.js.map +1 -1
- package/dist/cjs/MatterController.d.ts +13 -3
- package/dist/cjs/MatterController.d.ts.map +1 -1
- package/dist/cjs/MatterController.js +41 -21
- package/dist/cjs/MatterController.js.map +2 -2
- package/dist/cjs/PaseCommissioner.js +1 -1
- package/dist/cjs/PaseCommissioner.js.map +1 -1
- package/dist/cjs/cluster/server/ClusterServer.js +9 -9
- package/dist/cjs/cluster/server/ClusterServer.js.map +1 -1
- package/dist/cjs/device/PairedNode.d.ts.map +1 -1
- package/dist/cjs/device/PairedNode.js +23 -14
- package/dist/cjs/device/PairedNode.js.map +1 -1
- package/dist/esm/CommissioningController.d.ts +31 -9
- package/dist/esm/CommissioningController.d.ts.map +1 -1
- package/dist/esm/CommissioningController.js +35 -16
- package/dist/esm/CommissioningController.js.map +1 -1
- package/dist/esm/MatterController.d.ts +13 -3
- package/dist/esm/MatterController.d.ts.map +1 -1
- package/dist/esm/MatterController.js +43 -23
- package/dist/esm/MatterController.js.map +1 -1
- package/dist/esm/PaseCommissioner.js +1 -1
- package/dist/esm/PaseCommissioner.js.map +1 -1
- package/dist/esm/cluster/server/ClusterServer.js +10 -10
- package/dist/esm/cluster/server/ClusterServer.js.map +1 -1
- package/dist/esm/device/PairedNode.d.ts.map +1 -1
- package/dist/esm/device/PairedNode.js +23 -14
- package/dist/esm/device/PairedNode.js.map +1 -1
- package/package.json +8 -8
- package/src/CommissioningController.ts +67 -17
- package/src/MatterController.ts +56 -24
- package/src/PaseCommissioner.ts +1 -1
- package/src/cluster/server/ClusterServer.ts +11 -11
- package/src/device/PairedNode.ts +29 -20
package/src/device/PairedNode.ts
CHANGED
|
@@ -346,20 +346,26 @@ export class PairedNode {
|
|
|
346
346
|
this.#reconnectFunc = reconnectFunc;
|
|
347
347
|
|
|
348
348
|
this.#interactionClient = interactionClient;
|
|
349
|
-
this.#interactionClient.
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
349
|
+
if (this.#interactionClient.isReconnectable) {
|
|
350
|
+
this.#interactionClient.channelUpdated.on(() => {
|
|
351
|
+
// When we had planned a reconnect because of a disconnect we can stop the timer now
|
|
352
|
+
if (
|
|
353
|
+
this.#reconnectDelayTimer?.isRunning &&
|
|
354
|
+
!this.#clientReconnectInProgress &&
|
|
355
|
+
!this.#reconnectionInProgress &&
|
|
356
|
+
this.#connectionState === NodeStates.Reconnecting
|
|
357
|
+
) {
|
|
358
|
+
logger.info(`Node ${this.nodeId}: Got a reconnect, so reconnection not needed anymore ...`);
|
|
359
|
+
this.#reconnectDelayTimer?.stop();
|
|
360
|
+
this.#reconnectDelayTimer = undefined;
|
|
361
|
+
this.#setConnectionState(NodeStates.Connected);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
} else {
|
|
365
|
+
logger.warn(
|
|
366
|
+
`Node ${this.nodeId}: InteractionClient is not reconnectable, no automatic reconnection will happen in case of errors.`,
|
|
367
|
+
);
|
|
368
|
+
}
|
|
363
369
|
this.#nodeDetails = new DeviceInformation(nodeId, knownNodeDetails);
|
|
364
370
|
logger.info(`Node ${this.nodeId}: Created paired node with device data`, this.#nodeDetails.meta);
|
|
365
371
|
|
|
@@ -757,7 +763,7 @@ export class PairedNode {
|
|
|
757
763
|
return;
|
|
758
764
|
}
|
|
759
765
|
logger.debug(
|
|
760
|
-
`Node ${this.nodeId} Trigger attribute update for ${endpointId}.${cluster.name}.${attributeId} to ${
|
|
766
|
+
`Node ${this.nodeId} Trigger attribute update for ${endpointId}.${cluster.name}.${attributeId} to ${Diagnostic.json(
|
|
761
767
|
value,
|
|
762
768
|
)} (changed: ${changed})`,
|
|
763
769
|
);
|
|
@@ -967,7 +973,7 @@ export class PairedNode {
|
|
|
967
973
|
continue;
|
|
968
974
|
}
|
|
969
975
|
|
|
970
|
-
logger.debug(`Node ${this.nodeId}: Creating device`, endpointId,
|
|
976
|
+
logger.debug(`Node ${this.nodeId}: Creating device`, endpointId, Diagnostic.json(clusters));
|
|
971
977
|
this.#endpoints.set(
|
|
972
978
|
endpointIdNumber,
|
|
973
979
|
this.#createDevice(endpointIdNumber, clusters, this.#interactionClient),
|
|
@@ -979,7 +985,10 @@ export class PairedNode {
|
|
|
979
985
|
|
|
980
986
|
/** Bring the endpoints in a structure based on their partsList attribute. */
|
|
981
987
|
#structureEndpoints(partLists: Map<EndpointNumber, EndpointNumber[]>) {
|
|
982
|
-
logger.debug(
|
|
988
|
+
logger.debug(
|
|
989
|
+
`Node ${this.nodeId}: Endpoints from PartsLists`,
|
|
990
|
+
Diagnostic.json(Array.from(partLists.entries())),
|
|
991
|
+
);
|
|
983
992
|
|
|
984
993
|
const endpointUsages: { [key: EndpointNumber]: EndpointNumber[] } = {};
|
|
985
994
|
Array.from(partLists.entries()).forEach(([parent, partsList]) =>
|
|
@@ -994,7 +1003,7 @@ export class PairedNode {
|
|
|
994
1003
|
}),
|
|
995
1004
|
);
|
|
996
1005
|
|
|
997
|
-
logger.debug(`Node ${this.nodeId}: Endpoint usages`,
|
|
1006
|
+
logger.debug(`Node ${this.nodeId}: Endpoint usages`, Diagnostic.json(endpointUsages));
|
|
998
1007
|
|
|
999
1008
|
while (true) {
|
|
1000
1009
|
// get all endpoints with only one usage
|
|
@@ -1005,7 +1014,7 @@ export class PairedNode {
|
|
|
1005
1014
|
break;
|
|
1006
1015
|
}
|
|
1007
1016
|
|
|
1008
|
-
logger.debug(`Node ${this.nodeId}: Processing Endpoint ${
|
|
1017
|
+
logger.debug(`Node ${this.nodeId}: Processing Endpoint ${Diagnostic.json(singleUsageEndpoints)}`);
|
|
1009
1018
|
|
|
1010
1019
|
const idsToCleanup: { [key: EndpointNumber]: boolean } = {};
|
|
1011
1020
|
singleUsageEndpoints.forEach(([childId, usages]) => {
|
|
@@ -1027,7 +1036,7 @@ export class PairedNode {
|
|
|
1027
1036
|
delete endpointUsages[EndpointNumber(parseInt(childId))];
|
|
1028
1037
|
idsToCleanup[usages[0]] = true;
|
|
1029
1038
|
});
|
|
1030
|
-
logger.debug(`Node ${this.nodeId}: Endpoint data Cleanup`,
|
|
1039
|
+
logger.debug(`Node ${this.nodeId}: Endpoint data Cleanup`, Diagnostic.json(idsToCleanup));
|
|
1031
1040
|
Object.keys(idsToCleanup).forEach(idToCleanup => {
|
|
1032
1041
|
Object.keys(endpointUsages).forEach(id => {
|
|
1033
1042
|
const usageId = EndpointNumber(parseInt(id));
|