@matter/examples 0.16.0-alpha.0-20250925-9e6a5c124 → 0.16.0-alpha.0-20250927-238ce7756
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.
|
@@ -9,14 +9,14 @@ const controller = await ServerNode.create();
|
|
|
9
9
|
const [, , command, ...args] = process.argv.slice(2);
|
|
10
10
|
switch (command) {
|
|
11
11
|
case "commission":
|
|
12
|
-
if (controller.
|
|
12
|
+
if (controller.peers.get("device")) {
|
|
13
13
|
die("There is already a device commissioned");
|
|
14
14
|
}
|
|
15
15
|
if (args.length !== 1) {
|
|
16
16
|
die(`Usage: ${process.argv[0]} commission <pairingcode>`);
|
|
17
17
|
}
|
|
18
18
|
const [pairingCode] = args;
|
|
19
|
-
await controller.
|
|
19
|
+
await controller.peers.commission({ id: "device", pairingCode });
|
|
20
20
|
break;
|
|
21
21
|
case "toggle":
|
|
22
22
|
{
|
|
@@ -24,7 +24,7 @@ switch (command) {
|
|
|
24
24
|
if (args.length !== 1 || !Number.isFinite(endpointNo)) {
|
|
25
25
|
die(`Usage: ${process.argv[0]} toggle <endpoint number>`);
|
|
26
26
|
}
|
|
27
|
-
const node = controller.
|
|
27
|
+
const node = controller.peers.get("device");
|
|
28
28
|
if (node === void 0) {
|
|
29
29
|
die("Cannot toggle because there is no commissioned device");
|
|
30
30
|
}
|
|
@@ -37,7 +37,7 @@ switch (command) {
|
|
|
37
37
|
break;
|
|
38
38
|
case "decommission":
|
|
39
39
|
{
|
|
40
|
-
const node = controller.
|
|
40
|
+
const node = controller.peers.get("device");
|
|
41
41
|
if (node === void 0) {
|
|
42
42
|
die("Cannot decommission because there is no commissioned device");
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matter/examples",
|
|
3
|
-
"version": "0.16.0-alpha.0-
|
|
3
|
+
"version": "0.16.0-alpha.0-20250927-238ce7756",
|
|
4
4
|
"description": "Matter.js examples and reference implementations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iot",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"matter-controller": "dist/esm/controller/ControllerNode.js"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@matter/main": "0.16.0-alpha.0-
|
|
59
|
-
"@matter/nodejs": "0.16.0-alpha.0-
|
|
60
|
-
"@matter/tools": "0.16.0-alpha.0-
|
|
61
|
-
"@project-chip/matter.js": "0.16.0-alpha.0-
|
|
58
|
+
"@matter/main": "0.16.0-alpha.0-20250927-238ce7756",
|
|
59
|
+
"@matter/nodejs": "0.16.0-alpha.0-20250927-238ce7756",
|
|
60
|
+
"@matter/tools": "0.16.0-alpha.0-20250927-238ce7756",
|
|
61
|
+
"@project-chip/matter.js": "0.16.0-alpha.0-20250927-238ce7756",
|
|
62
62
|
"esbuild": "^0.25.9"
|
|
63
63
|
},
|
|
64
64
|
"optionalDependencies": {
|
|
65
|
-
"@matter/nodejs-ble": "0.16.0-alpha.0-
|
|
65
|
+
"@matter/nodejs-ble": "0.16.0-alpha.0-20250927-238ce7756"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=20.19.0 <22.0.0 || >=22.13.0"
|
|
@@ -21,7 +21,7 @@ const [, , command, ...args] = process.argv.slice(2);
|
|
|
21
21
|
switch (command) {
|
|
22
22
|
case "commission":
|
|
23
23
|
// Validation
|
|
24
|
-
if (controller.
|
|
24
|
+
if (controller.peers.get("device")) {
|
|
25
25
|
die("There is already a device commissioned");
|
|
26
26
|
}
|
|
27
27
|
if (args.length !== 1) {
|
|
@@ -30,7 +30,7 @@ switch (command) {
|
|
|
30
30
|
const [pairingCode] = args;
|
|
31
31
|
|
|
32
32
|
// This is the actual commissioning
|
|
33
|
-
await controller.
|
|
33
|
+
await controller.peers.commission({ id: "device", pairingCode });
|
|
34
34
|
|
|
35
35
|
break;
|
|
36
36
|
|
|
@@ -41,7 +41,7 @@ switch (command) {
|
|
|
41
41
|
if (args.length !== 1 || !Number.isFinite(endpointNo)) {
|
|
42
42
|
die(`Usage: ${process.argv[0]} toggle <endpoint number>`);
|
|
43
43
|
}
|
|
44
|
-
const node = controller.
|
|
44
|
+
const node = controller.peers.get("device");
|
|
45
45
|
if (node === undefined) {
|
|
46
46
|
die("Cannot toggle because there is no commissioned device");
|
|
47
47
|
}
|
|
@@ -59,7 +59,7 @@ switch (command) {
|
|
|
59
59
|
case "decommission":
|
|
60
60
|
{
|
|
61
61
|
// Validation
|
|
62
|
-
const node = controller.
|
|
62
|
+
const node = controller.peers.get("device");
|
|
63
63
|
if (node === undefined) {
|
|
64
64
|
die("Cannot decommission because there is no commissioned device");
|
|
65
65
|
}
|