@matter/create 0.15.2-alpha.0-20250703-2e16aba2b → 0.15.2-alpha.0-20250708-b8eb61a5e

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.
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022-2025 Matter.js Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * This is simple command line application that demonstrates device control using the @matter/node API.
9
+ *
10
+ * This API is a work in progress and is not yet fully implemented.
11
+ */
12
+
13
+ import { ServerNode } from "@matter/main";
14
+ import { OnOffClient } from "@matter/main/behaviors/on-off";
15
+
16
+ // Create the controller
17
+ const controller = await ServerNode.create();
18
+
19
+ const [, , command, ...args] = process.argv.slice(2);
20
+
21
+ switch (command) {
22
+ case "commission":
23
+ // Validation
24
+ if (controller.nodes.get("device")) {
25
+ die("There is already a device commissioned");
26
+ }
27
+ if (args.length !== 1) {
28
+ die(`Usage: ${process.argv[0]} commission <pairingcode>`);
29
+ }
30
+ const [pairingCode] = args;
31
+
32
+ // This is the actual commissioning
33
+ await controller.nodes.commission({ id: "device", pairingCode });
34
+
35
+ break;
36
+
37
+ case "toggle":
38
+ {
39
+ // Validation
40
+ const endpointNo = Number.parseInt(args[0]);
41
+ if (args.length !== 1 || Number.isNaN(endpointNo)) {
42
+ die(`Usage: ${process.argv[0]} toggle <endpoint number>`);
43
+ }
44
+ const node = controller.nodes.get("device");
45
+ if (node === undefined) {
46
+ die("Cannot toggle because there is no commissioned device");
47
+ }
48
+ const endpoint = node.parts.get(endpointNo);
49
+ if (endpoint === undefined) {
50
+ die(`Cannot toggle because endpoint ${endpointNo} does not exist`);
51
+ }
52
+
53
+ // Invocation
54
+ await endpoint.commandsOf(OnOffClient).toggle();
55
+ }
56
+
57
+ break;
58
+
59
+ case "decommission":
60
+ {
61
+ // Validation
62
+ const node = controller.nodes.get("device");
63
+ if (node === undefined) {
64
+ die("Cannot decommission because there is no commissioned device");
65
+ }
66
+
67
+ // Decommission
68
+ await node.delete();
69
+ }
70
+ break;
71
+
72
+ default:
73
+ die(
74
+ `Unsupported command ${process.argv[1] ?? "(none)"}. Supported commands: commission, toggle, decommission`,
75
+ );
76
+ }
77
+
78
+ /**
79
+ * Report command line error and exit.
80
+ */
81
+ function die(message: string): never {
82
+ console.log(message);
83
+ process.exit(1);
84
+ }
@@ -1,13 +1,21 @@
1
1
  {
2
2
  "typescriptVersion": "~5.8.3",
3
- "nodeTypesVersion": "^24.0.7",
3
+ "nodeTypesVersion": "^24.0.10",
4
4
  "templates": [
5
+ {
6
+ "name": "control-onoff",
7
+ "dependencies": {
8
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
9
+ },
10
+ "description": "Simple light controller",
11
+ "entrypoint": "OnOffController.ts"
12
+ },
5
13
  {
6
14
  "name": "controller",
7
15
  "dependencies": {
8
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b",
9
- "@matter/nodejs-ble": "~0.15.2-alpha.0-20250703-2e16aba2b",
10
- "@project-chip/matter.js": "~0.15.2-alpha.0-20250703-2e16aba2b"
16
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e",
17
+ "@matter/nodejs-ble": "~0.15.2-alpha.0-20250708-b8eb61a5e",
18
+ "@project-chip/matter.js": "~0.15.2-alpha.0-20250708-b8eb61a5e"
11
19
  },
12
20
  "description": "Controller example to commission and connect devices",
13
21
  "entrypoint": "ControllerNode.ts"
@@ -15,7 +23,7 @@
15
23
  {
16
24
  "name": "device-air-quality-sensor",
17
25
  "dependencies": {
18
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
26
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
19
27
  },
20
28
  "description": "Air quality sensor example",
21
29
  "entrypoint": "AirQualitySensorDeviceNode.ts"
@@ -23,7 +31,7 @@
23
31
  {
24
32
  "name": "device-bridge-onoff",
25
33
  "dependencies": {
26
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
34
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
27
35
  },
28
36
  "description": "Bridge for multiple OnOff light/sockets with a CLI command execution interface",
29
37
  "entrypoint": "BridgedDevicesNode.ts"
@@ -31,7 +39,7 @@
31
39
  {
32
40
  "name": "device-composed-onoff",
33
41
  "dependencies": {
34
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
42
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
35
43
  },
36
44
  "description": "Composed device for multiple OnOff light/sockets with a CLI command execution interface",
37
45
  "entrypoint": "ComposedDeviceNode.ts"
@@ -39,7 +47,7 @@
39
47
  {
40
48
  "name": "device-composed-wc-light",
41
49
  "dependencies": {
42
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
50
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
43
51
  },
44
52
  "description": "Composed device with Window covering and a light endpoint that logs changes",
45
53
  "entrypoint": "IlluminatedRollerShade.ts"
@@ -47,7 +55,7 @@
47
55
  {
48
56
  "name": "device-measuring-socket",
49
57
  "dependencies": {
50
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
58
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
51
59
  },
52
60
  "description": "Socket device that reports random Energy and Power measurements",
53
61
  "entrypoint": "MeasuredSocketDevice.ts"
@@ -55,7 +63,7 @@
55
63
  {
56
64
  "name": "device-multiple-onoff",
57
65
  "dependencies": {
58
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
66
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
59
67
  },
60
68
  "description": "Multiple OnOff light/socket nodes in one process with a CLI command execution interface",
61
69
  "entrypoint": "MultiDeviceNode.ts"
@@ -63,7 +71,7 @@
63
71
  {
64
72
  "name": "device-onoff",
65
73
  "dependencies": {
66
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
74
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
67
75
  },
68
76
  "description": "OnOff light/socket device with a CLI command execution interface",
69
77
  "entrypoint": "DeviceNode.ts"
@@ -71,9 +79,9 @@
71
79
  {
72
80
  "name": "device-onoff-advanced",
73
81
  "dependencies": {
74
- "@matter/nodejs": "~0.15.2-alpha.0-20250703-2e16aba2b",
75
- "@matter/nodejs-ble": "~0.15.2-alpha.0-20250703-2e16aba2b",
76
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
82
+ "@matter/nodejs": "~0.15.2-alpha.0-20250708-b8eb61a5e",
83
+ "@matter/nodejs-ble": "~0.15.2-alpha.0-20250708-b8eb61a5e",
84
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
77
85
  },
78
86
  "description": "OnOff light/socket device with BLE support and advanced API usage",
79
87
  "entrypoint": "DeviceNodeFull.ts"
@@ -81,7 +89,7 @@
81
89
  {
82
90
  "name": "device-onoff-light",
83
91
  "dependencies": {
84
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
92
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
85
93
  },
86
94
  "description": "OnOff light example which logs the state changes to the console",
87
95
  "entrypoint": "LightDevice.ts"
@@ -89,7 +97,7 @@
89
97
  {
90
98
  "name": "device-robotic-vacuum-cleaner",
91
99
  "dependencies": {
92
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
100
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
93
101
  },
94
102
  "description": "Robotic Vacuum Cleaner Example",
95
103
  "entrypoint": "RoboticVacuumCleanerDevice.ts"
@@ -97,7 +105,7 @@
97
105
  {
98
106
  "name": "device-sensor",
99
107
  "dependencies": {
100
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
108
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
101
109
  },
102
110
  "description": "Temperature/Humidity sensor with a CLI command interface to get the value",
103
111
  "entrypoint": "SensorDeviceNode.ts"
@@ -105,7 +113,7 @@
105
113
  {
106
114
  "name": "device-simple",
107
115
  "dependencies": {
108
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
116
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
109
117
  },
110
118
  "description": "A simple on/off device",
111
119
  "entrypoint": "main.ts"
@@ -113,7 +121,7 @@
113
121
  {
114
122
  "name": "device-smoke-co-alarm",
115
123
  "dependencies": {
116
- "@matter/main": "~0.15.2-alpha.0-20250703-2e16aba2b"
124
+ "@matter/main": "~0.15.2-alpha.0-20250708-b8eb61a5e"
117
125
  },
118
126
  "description": "Smoke CO Alarm Example",
119
127
  "entrypoint": "SmokeCOAlarmDeviceNode.ts"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matter/create",
3
- "version": "0.15.2-alpha.0-20250703-2e16aba2b",
3
+ "version": "0.15.2-alpha.0-20250708-b8eb61a5e",
4
4
  "description": "Matter.js skeleton project generator",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "homepage": "https://github.com/project-chip/matter.js#readme",
34
34
  "devDependencies": {
35
- "@matter/tools": "0.15.2-alpha.0-20250703-2e16aba2b",
36
- "@types/node": "^24.0.7",
35
+ "@matter/tools": "0.15.2-alpha.0-20250708-b8eb61a5e",
36
+ "@types/node": "^24.0.10",
37
37
  "@types/tar-stream": "^3.1.4"
38
38
  },
39
39
  "publishConfig": {