@matter/nodejs-shell 0.17.9 → 0.18.0-alpha.0-20260812-4d7f2790e
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 +11 -1
- package/dist/esm/MatterNode.js +237 -134
- package/dist/esm/MatterNode.js.map +1 -1
- package/dist/esm/app.js +13 -7
- package/dist/esm/app.js.map +1 -1
- package/dist/esm/shell/cmd_cluster-attributes.js +64 -45
- package/dist/esm/shell/cmd_cluster-attributes.js.map +2 -2
- package/dist/esm/shell/cmd_cluster-commands.js +11 -9
- package/dist/esm/shell/cmd_cluster-commands.js.map +1 -1
- package/dist/esm/shell/cmd_cluster-events.js +36 -9
- package/dist/esm/shell/cmd_cluster-events.js.map +1 -1
- package/dist/esm/shell/cmd_commission.js +119 -93
- package/dist/esm/shell/cmd_commission.js.map +1 -1
- package/dist/esm/shell/cmd_discover.js +23 -21
- package/dist/esm/shell/cmd_discover.js.map +1 -1
- package/dist/esm/shell/cmd_icd.js +46 -30
- package/dist/esm/shell/cmd_icd.js.map +1 -1
- package/dist/esm/shell/cmd_identify.js +11 -7
- package/dist/esm/shell/cmd_identify.js.map +1 -1
- package/dist/esm/shell/cmd_nodes.js +189 -168
- package/dist/esm/shell/cmd_nodes.js.map +1 -1
- package/dist/esm/shell/cmd_session.js +3 -4
- package/dist/esm/shell/cmd_session.js.map +1 -1
- package/dist/esm/shell/cmd_subscribe.js +26 -12
- package/dist/esm/shell/cmd_subscribe.js.map +1 -1
- package/dist/esm/util/ClusterEndpoint.js +61 -0
- package/dist/esm/util/ClusterEndpoint.js.map +6 -0
- package/dist/esm/util/awaitSeeded.js +31 -0
- package/dist/esm/util/awaitSeeded.js.map +6 -0
- package/dist/esm/util/diagnosticLogging.js +99 -0
- package/dist/esm/util/diagnosticLogging.js.map +6 -0
- package/dist/esm/util/legacyStorageMigration.js +188 -0
- package/dist/esm/util/legacyStorageMigration.js.map +6 -0
- package/package.json +10 -11
- package/src/MatterNode.ts +298 -159
- package/src/app.ts +17 -9
- package/src/shell/cmd_cluster-attributes.ts +77 -53
- package/src/shell/cmd_cluster-commands.ts +12 -13
- package/src/shell/cmd_cluster-events.ts +38 -11
- package/src/shell/cmd_commission.ts +136 -113
- package/src/shell/cmd_discover.ts +36 -22
- package/src/shell/cmd_icd.ts +52 -32
- package/src/shell/cmd_identify.ts +11 -7
- package/src/shell/cmd_nodes.ts +226 -199
- package/src/shell/cmd_session.ts +3 -5
- package/src/shell/cmd_subscribe.ts +37 -14
- package/src/shell/webassets/index.html +1 -1
- package/src/tsconfig.json +0 -3
- package/src/util/ClusterEndpoint.ts +107 -0
- package/src/util/awaitSeeded.ts +43 -0
- package/src/util/diagnosticLogging.ts +117 -0
- package/src/util/legacyStorageMigration.ts +275 -0
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { IdentifyClient } from "@matter/node/behaviors/identify";
|
|
8
8
|
import type { Argv } from "yargs";
|
|
9
9
|
import { MatterNode } from "../MatterNode.js";
|
|
10
|
+
import { awaitSeeded } from "../util/awaitSeeded.js";
|
|
10
11
|
|
|
11
12
|
export default function commands(theNode: MatterNode) {
|
|
12
13
|
return {
|
|
@@ -34,17 +35,20 @@ export default function commands(theNode: MatterNode) {
|
|
|
34
35
|
|
|
35
36
|
handler: async (argv: any) => {
|
|
36
37
|
const { nodeId, time = 10, endpointId } = argv;
|
|
38
|
+
const nodes = await theNode.connectAndGetNodes(nodeId);
|
|
39
|
+
for (const node of nodes) {
|
|
40
|
+
await awaitSeeded(node);
|
|
41
|
+
}
|
|
37
42
|
await theNode.iterateNodeDevices(
|
|
38
|
-
|
|
43
|
+
nodes,
|
|
39
44
|
async (device, node) => {
|
|
40
|
-
|
|
41
|
-
if (identifyCluster === undefined) {
|
|
45
|
+
if (device.number === 0 || !device.behaviors.has(IdentifyClient)) {
|
|
42
46
|
return;
|
|
43
47
|
}
|
|
44
|
-
console.log("Invoke Identify for", node.nodeId.toString());
|
|
45
|
-
await
|
|
48
|
+
console.log("Invoke Identify for", node.peerAddress?.nodeId.toString());
|
|
49
|
+
await device.act(agent => agent.get(IdentifyClient).identify({ identifyTime: time }));
|
|
46
50
|
},
|
|
47
|
-
endpointId,
|
|
51
|
+
endpointId !== undefined ? [endpointId] : undefined,
|
|
48
52
|
);
|
|
49
53
|
},
|
|
50
54
|
};
|