@matter/create 0.13.0-alpha.0-20250322-f085fa576 → 0.13.0-alpha.0-20250324-d7b7d9731

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.
@@ -11,7 +11,7 @@
11
11
  * because you need to adjust the code in any way depending on your use case.
12
12
  */
13
13
 
14
- import { Environment, Logger, singleton, StorageService, Time } from "@matter/main";
14
+ import { Diagnostic, Environment, Logger, singleton, StorageService, Time } from "@matter/main";
15
15
  import { BasicInformationCluster, DescriptorCluster, GeneralCommissioning, OnOff } from "@matter/main/clusters";
16
16
  import { Ble, ClusterClientObj } from "@matter/main/protocol";
17
17
  import { ManualPairingCodeCodec, NodeId } from "@matter/main/types";
@@ -78,7 +78,7 @@ class ControllerNode {
78
78
  shortDiscriminator = pairingCodeCodec.shortDiscriminator;
79
79
  longDiscriminator = undefined;
80
80
  setupPin = pairingCodeCodec.passcode;
81
- logger.debug(`Data extracted from pairing code: ${Logger.toJSON(pairingCodeCodec)}`);
81
+ logger.debug(`Data extracted from pairing code: ${Diagnostic.json(pairingCodeCodec)}`);
82
82
  } else {
83
83
  longDiscriminator =
84
84
  environment.vars.number("longDiscriminator") ??
@@ -152,7 +152,7 @@ class ControllerNode {
152
152
  },
153
153
  passcode: setupPin,
154
154
  };
155
- logger.info(`Commissioning ... ${Logger.toJSON(options)}`);
155
+ logger.info(`Commissioning ... ${Diagnostic.json(options)}`);
156
156
  const nodeId = await commissioningController.commissionNode(options);
157
157
 
158
158
  console.log(`Commissioning successfully done with nodeId ${nodeId}`);
@@ -161,7 +161,7 @@ class ControllerNode {
161
161
  // After commissioning or if we have a commissioned node we can connect to it
162
162
  try {
163
163
  const nodes = commissioningController.getCommissionedNodes();
164
- console.log("Found commissioned nodes:", Logger.toJSON(nodes));
164
+ console.log("Found commissioned nodes:", Diagnostic.json(nodes));
165
165
 
166
166
  const nodeId = NodeId(environment.vars.number("nodeid") ?? nodes[0]);
167
167
  if (!nodes.includes(nodeId)) {
@@ -169,7 +169,10 @@ class ControllerNode {
169
169
  }
170
170
 
171
171
  const nodeDetails = commissioningController.getCommissionedNodesDetails();
172
- console.log("Commissioned nodes details:", Logger.toJSON(nodeDetails.find(node => node.nodeId === nodeId)));
172
+ console.log(
173
+ "Commissioned nodes details:",
174
+ Diagnostic.json(nodeDetails.find(node => node.nodeId === nodeId)),
175
+ );
173
176
 
174
177
  // Get the node instance
175
178
  const node = await commissioningController.getNode(nodeId);
@@ -177,14 +180,14 @@ class ControllerNode {
177
180
  // Subscribe to events of the node
178
181
  node.events.attributeChanged.on(({ path: { nodeId, clusterId, endpointId, attributeName }, value }) =>
179
182
  console.log(
180
- `attributeChangedCallback ${nodeId}: Attribute ${endpointId}/${clusterId}/${attributeName} changed to ${Logger.toJSON(
183
+ `attributeChangedCallback ${nodeId}: Attribute ${endpointId}/${clusterId}/${attributeName} changed to ${Diagnostic.json(
181
184
  value,
182
185
  )}`,
183
186
  ),
184
187
  );
185
188
  node.events.eventTriggered.on(({ path: { nodeId, clusterId, endpointId, eventName }, events }) =>
186
189
  console.log(
187
- `eventTriggeredCallback ${nodeId}: Event ${endpointId}/${clusterId}/${eventName} triggered with ${Logger.toJSON(
190
+ `eventTriggeredCallback ${nodeId}: Event ${endpointId}/${clusterId}/${eventName} triggered with ${Diagnostic.json(
188
191
  events,
189
192
  )}`,
190
193
  ),
@@ -246,7 +249,7 @@ class ControllerNode {
246
249
 
247
250
  // Example to get all Attributes of the commissioned node: */*/*
248
251
  //const attributesAll = await interactionClient.getAllAttributes();
249
- //console.log("Attributes-All:", Logger.toJSON(attributesAll));
252
+ //console.log("Attributes-All:", Diagnostic.json(attributesAll));
250
253
 
251
254
  // Example to get all Attributes of all Descriptor Clusters of the commissioned node: */DescriptorCluster/*
252
255
  //const attributesAllDescriptor = await interactionClient.getMultipleAttributes([{ clusterId: DescriptorCluster.id} ]);
@@ -260,7 +263,7 @@ class ControllerNode {
260
263
  if (devices[0] && devices[0].number === 1) {
261
264
  // Example to subscribe to all Attributes of endpoint 1 of the commissioned node: */*/*
262
265
  //await interactionClient.subscribeMultipleAttributes([{ endpointId: 1, /* subscribe anything from endpoint 1 */ }], 0, 180, data => {
263
- // console.log("Subscribe-All Data:", Logger.toJSON(data));
266
+ // console.log("Subscribe-All Data:", Diagnostic.json(data));
264
267
  //});
265
268
 
266
269
  const onOff: ClusterClientObj<OnOff.Complete> | undefined = devices[0].getClusterClient(OnOff.Complete);
@@ -26,13 +26,13 @@ import {
26
26
  Endpoint,
27
27
  EndpointServer,
28
28
  Environment,
29
+ LogDestination,
29
30
  LogLevel,
30
31
  Logger,
31
32
  ServerNode,
32
33
  StorageService,
33
34
  Time,
34
35
  VendorId,
35
- logLevelFromString,
36
36
  singleton,
37
37
  } from "@matter/main";
38
38
  import { OnOffServer } from "@matter/main/behaviors";
@@ -97,8 +97,9 @@ function executeCommand(scriptParamName: string) {
97
97
 
98
98
  const logFile = environment.vars.string("logfile.filename");
99
99
  if (logFile !== undefined) {
100
- Logger.addLogger("filelogger", await createFileLogger(logFile), {
101
- defaultLogLevel: logLevelFromString(environment.vars.string("logfile.loglevel")) ?? LogLevel.DEBUG,
100
+ Logger.destinations.filelogger = LogDestination({
101
+ write: await createFileLogger(logFile),
102
+ level: LogLevel(environment.vars.get("logfile.loglevel", "debug")),
102
103
  });
103
104
  }
104
105
 
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import { Bytes, Logger } from "@matter/main";
7
+ import { Bytes, Diagnostic } from "@matter/main";
8
8
  import { GeneralCommissioningBehavior } from "@matter/main/behaviors/general-commissioning";
9
9
  import { NetworkCommissioningBehavior } from "@matter/main/behaviors/network-commissioning";
10
10
  import { NetworkCommissioning } from "@matter/main/clusters";
@@ -48,7 +48,7 @@ export class DummyThreadNetworkCommissioningServer extends NetworkCommissioningB
48
48
  lqi: 50,
49
49
  },
50
50
  ];
51
- console.log(Logger.toJSON(threadScanResults));
51
+ console.log(Diagnostic.json(threadScanResults));
52
52
 
53
53
  return {
54
54
  networkingStatus,
@@ -5,9 +5,9 @@
5
5
  {
6
6
  "name": "controller",
7
7
  "dependencies": {
8
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576",
9
- "@matter/nodejs-ble": "~0.13.0-alpha.0-20250322-f085fa576",
10
- "@project-chip/matter.js": "~0.13.0-alpha.0-20250322-f085fa576"
8
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731",
9
+ "@matter/nodejs-ble": "~0.13.0-alpha.0-20250324-d7b7d9731",
10
+ "@project-chip/matter.js": "~0.13.0-alpha.0-20250324-d7b7d9731"
11
11
  },
12
12
  "description": "Controller example to commission and connect devices",
13
13
  "entrypoint": "ControllerNode.ts"
@@ -15,7 +15,7 @@
15
15
  {
16
16
  "name": "device-bridge-onoff",
17
17
  "dependencies": {
18
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576"
18
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731"
19
19
  },
20
20
  "description": "Bridge for multiple OnOff light/sockets with a CLI command execution interface",
21
21
  "entrypoint": "BridgedDevicesNode.ts"
@@ -23,7 +23,7 @@
23
23
  {
24
24
  "name": "device-composed-onoff",
25
25
  "dependencies": {
26
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576"
26
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731"
27
27
  },
28
28
  "description": "Composed device for multiple OnOff light/sockets with a CLI command execution interface",
29
29
  "entrypoint": "ComposedDeviceNode.ts"
@@ -31,7 +31,7 @@
31
31
  {
32
32
  "name": "device-composed-wc-light",
33
33
  "dependencies": {
34
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576"
34
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731"
35
35
  },
36
36
  "description": "Composed device with Window covering and a light endpoint that logs changes",
37
37
  "entrypoint": "IlluminatedRollerShade.ts"
@@ -39,7 +39,7 @@
39
39
  {
40
40
  "name": "device-measuring-socket",
41
41
  "dependencies": {
42
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576"
42
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731"
43
43
  },
44
44
  "description": "Socket device that reports random Energy and Power measurements",
45
45
  "entrypoint": "MeasuredSocketDevice.ts"
@@ -59,9 +59,9 @@
59
59
  {
60
60
  "name": "device-onoff-advanced",
61
61
  "dependencies": {
62
- "@matter/nodejs": "~0.13.0-alpha.0-20250322-f085fa576",
63
- "@matter/nodejs-ble": "~0.13.0-alpha.0-20250322-f085fa576",
64
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576"
62
+ "@matter/nodejs": "~0.13.0-alpha.0-20250324-d7b7d9731",
63
+ "@matter/nodejs-ble": "~0.13.0-alpha.0-20250324-d7b7d9731",
64
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731"
65
65
  },
66
66
  "description": "OnOff light/socket device with BLE support and advanced API usage",
67
67
  "entrypoint": "DeviceNodeFull.ts"
@@ -69,7 +69,7 @@
69
69
  {
70
70
  "name": "device-onoff-light",
71
71
  "dependencies": {
72
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576"
72
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731"
73
73
  },
74
74
  "description": "OnOff light example which logs the state changes to the console",
75
75
  "entrypoint": "LightDevice.ts"
@@ -77,7 +77,7 @@
77
77
  {
78
78
  "name": "device-sensor",
79
79
  "dependencies": {
80
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576"
80
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731"
81
81
  },
82
82
  "description": "Temperature/Humidity sensor with a CLI command interface to get the value",
83
83
  "entrypoint": "SensorDeviceNode.ts"
@@ -85,7 +85,7 @@
85
85
  {
86
86
  "name": "device-simple",
87
87
  "dependencies": {
88
- "@matter/main": "~0.13.0-alpha.0-20250322-f085fa576"
88
+ "@matter/main": "~0.13.0-alpha.0-20250324-d7b7d9731"
89
89
  },
90
90
  "description": "A simple on/off device",
91
91
  "entrypoint": "main.ts"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matter/create",
3
- "version": "0.13.0-alpha.0-20250322-f085fa576",
3
+ "version": "0.13.0-alpha.0-20250324-d7b7d9731",
4
4
  "description": "Matter.js skeleton project generator",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/project-chip/matter.js#readme",
34
34
  "devDependencies": {
35
- "@matter/tools": "0.13.0-alpha.0-20250322-f085fa576",
35
+ "@matter/tools": "0.13.0-alpha.0-20250324-d7b7d9731",
36
36
  "@types/node": "^22.13.10",
37
37
  "@types/tar-stream": "^3.1.3"
38
38
  },