@matter/create 0.16.0-alpha.0-20250817-1b000357c → 0.16.0-alpha.0-20250819-0a388db8b
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/templates/controller/ControllerNode.ts +1 -1
- package/dist/templates/device-bridge-onoff/BridgedDevicesNode.ts +1 -1
- package/dist/templates/device-composed-onoff/ComposedDeviceNode.ts +1 -1
- package/dist/templates/device-composed-wc-light/IlluminatedRollerShade.ts +2 -2
- package/dist/templates/device-measuring-socket/MeasuredSocketDevice.ts +2 -2
- package/dist/templates/device-multiple-onoff/MultiDeviceNode.ts +1 -2
- package/dist/templates/device-onoff/DeviceNode.ts +1 -1
- package/dist/templates/device-onoff-advanced/DeviceNodeFull.ts +1 -1
- package/dist/templates/device-robotic-vacuum-cleaner/RvcDeviceLogic.ts +8 -6
- package/dist/templates/device-sensor/SensorDeviceNode.ts +1 -1
- package/dist/templates/index.json +20 -20
- package/package.json +3 -3
|
@@ -65,7 +65,7 @@ class ControllerNode {
|
|
|
65
65
|
: environment.vars.number("port");
|
|
66
66
|
const uniqueId = (await controllerStorage.has("uniqueid"))
|
|
67
67
|
? await controllerStorage.get<string>("uniqueid")
|
|
68
|
-
: (environment.vars.string("uniqueid") ?? Time.nowMs
|
|
68
|
+
: (environment.vars.string("uniqueid") ?? Time.nowMs.toString());
|
|
69
69
|
await controllerStorage.set("uniqueid", uniqueId);
|
|
70
70
|
const adminFabricLabel = (await controllerStorage.has("fabriclabel"))
|
|
71
71
|
? await controllerStorage.get<string>("fabriclabel")
|
|
@@ -219,7 +219,7 @@ async function getConfiguration() {
|
|
|
219
219
|
const port = environment.vars.number("port") ?? 5540;
|
|
220
220
|
|
|
221
221
|
const uniqueId =
|
|
222
|
-
environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs
|
|
222
|
+
environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs.toString()));
|
|
223
223
|
|
|
224
224
|
// Persist basic data to keep them also on restart
|
|
225
225
|
await deviceStorage.set({
|
|
@@ -159,7 +159,7 @@ async function getConfiguration() {
|
|
|
159
159
|
const port = environment.vars.number("port") ?? 5540;
|
|
160
160
|
|
|
161
161
|
const uniqueId =
|
|
162
|
-
environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs
|
|
162
|
+
environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs.toString()));
|
|
163
163
|
|
|
164
164
|
// Persist basic data to keep them also on restart
|
|
165
165
|
await deviceStorage.set({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { ServerNode } from "@matter/main";
|
|
8
|
+
import { ServerNode, VendorId } from "@matter/main";
|
|
9
9
|
import { MovementDirection, MovementType, WindowCoveringServer } from "@matter/main/behaviors/window-covering";
|
|
10
10
|
import { OnOffLightDevice, OnOffLightRequirements } from "@matter/main/devices/on-off-light";
|
|
11
11
|
import { WindowCoveringDevice } from "@matter/main/devices/window-covering";
|
|
@@ -68,7 +68,7 @@ const node = new ServerNode({
|
|
|
68
68
|
basicInformation: {
|
|
69
69
|
vendorName: "Acme Corporation",
|
|
70
70
|
productName: "Excelsior 1000 EZ-Nite™",
|
|
71
|
-
vendorId: 0xfff1,
|
|
71
|
+
vendorId: VendorId(0xfff1),
|
|
72
72
|
productId: 0x8000,
|
|
73
73
|
serialNumber: "1234-12345-123",
|
|
74
74
|
},
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
// This demonstrates bringing a "socket" device with electrical power and energy measurement online with matter.js.
|
|
9
9
|
|
|
10
|
-
import { Endpoint, ServerNode, Time } from "@matter/main";
|
|
10
|
+
import { Endpoint, Seconds, ServerNode, Time } from "@matter/main";
|
|
11
11
|
import { ElectricalEnergyMeasurementServer, ElectricalPowerMeasurementServer } from "@matter/main/behaviors";
|
|
12
12
|
import { ElectricalEnergyMeasurement, ElectricalPowerMeasurement } from "@matter/main/clusters";
|
|
13
13
|
import { OnOffPlugInUnitDevice } from "@matter/main/devices";
|
|
@@ -97,7 +97,7 @@ measuredSocketEndpoint.events.onOff.onOff$Changed.on(value => {
|
|
|
97
97
|
// We will simulate the device sending measurements every 10 seconds.
|
|
98
98
|
// When the device is turned off, the measurements will be zero, otherwise they will be random values.
|
|
99
99
|
// Note: This is just example code. In a real device, you would set the data to 0 once the device is turned off.
|
|
100
|
-
const fakeMeasurementTimer = Time.getPeriodicTimer("fakeMeasurement",
|
|
100
|
+
const fakeMeasurementTimer = Time.getPeriodicTimer("fakeMeasurement", Seconds(10), async () => {
|
|
101
101
|
const turnedOn = measuredSocketEndpoint.state.onOff.onOff;
|
|
102
102
|
const power = turnedOn ? Math.round(Math.random() * 1000) : 0; // W
|
|
103
103
|
const current = turnedOn ? Math.round(Math.random() * 32) : 0; // A
|
|
@@ -168,8 +168,7 @@ async function getConfiguration() {
|
|
|
168
168
|
const port = environment.vars.number(`port${i}`) ?? defaultPort++;
|
|
169
169
|
|
|
170
170
|
const uniqueId =
|
|
171
|
-
environment.vars.string(`uniqueid${i}`) ??
|
|
172
|
-
(await deviceStorage.get(`uniqueid${i}`, `${i}-${Time.nowMs()}`));
|
|
171
|
+
environment.vars.string(`uniqueid${i}`) ?? (await deviceStorage.get(`uniqueid${i}`, `${i}-${Time.nowMs}`));
|
|
173
172
|
|
|
174
173
|
// Persist basic data to keep them also on restart
|
|
175
174
|
await deviceStorage.set(`passcode${i}`, passcode);
|
|
@@ -162,7 +162,7 @@ async function getConfiguration() {
|
|
|
162
162
|
const port = environment.vars.number("port") ?? 5540;
|
|
163
163
|
|
|
164
164
|
const uniqueId =
|
|
165
|
-
environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs
|
|
165
|
+
environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs)).toString();
|
|
166
166
|
|
|
167
167
|
// Persist basic data to keep them also on restart
|
|
168
168
|
await deviceStorage.set({
|
|
@@ -128,7 +128,7 @@ const productId = environment.vars.number("productid") ?? (await deviceStorage.g
|
|
|
128
128
|
|
|
129
129
|
const port = environment.vars.number("port") ?? 5540;
|
|
130
130
|
|
|
131
|
-
const uniqueId = environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs
|
|
131
|
+
const uniqueId = environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs.toString()));
|
|
132
132
|
|
|
133
133
|
await deviceStorage.set({
|
|
134
134
|
passcode,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2022-2025 Matter.js Authors
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { Behavior, Logger, Node, Time, Timer } from "@matter/main";
|
|
6
|
+
import { Behavior, Hours, Logger, Millis, Minutes, Node, Seconds, Time, Timer } from "@matter/main";
|
|
7
7
|
import { ServiceAreaServer } from "@matter/main/behaviors/service-area";
|
|
8
8
|
import { RvcOperationalState } from "@matter/main/clusters/rvc-operational-state";
|
|
9
9
|
import { CustomRvcCleanModeServer } from "./behaviors/CustomRvcCleanModeServer.js";
|
|
@@ -57,7 +57,7 @@ enum DetailOperationalDeviceState {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// We simulate cleaning rounds of 10 minutes
|
|
60
|
-
const CLEANING_MAPPING_ROUND_TIME = 10
|
|
60
|
+
const CLEANING_MAPPING_ROUND_TIME = Minutes(10);
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* This class implements the Logic of our fictional robotic vacuum cleaner device and should demonstrate how the
|
|
@@ -81,9 +81,11 @@ export class RvcDeviceLogic extends Behavior {
|
|
|
81
81
|
this.internal.mappingTimer = Time.getTimer("MappingTimer", CLEANING_MAPPING_ROUND_TIME, () =>
|
|
82
82
|
this.#handleMappingDone(),
|
|
83
83
|
);
|
|
84
|
-
this.internal.rechargingTimer = Time.getTimer("RechargingTimer", 2
|
|
85
|
-
this.internal.autoWaitTimer = Time.getTimer("AutoWaitTimer",
|
|
86
|
-
this.internal.seekingChargerTimer = Time.getTimer("SeekingChargerTimer",
|
|
84
|
+
this.internal.rechargingTimer = Time.getTimer("RechargingTimer", Minutes(2), () => this.#handleRechargeDone());
|
|
85
|
+
this.internal.autoWaitTimer = Time.getTimer("AutoWaitTimer", Hours(3), () => this.#handleAutoWaitDone());
|
|
86
|
+
this.internal.seekingChargerTimer = Time.getTimer("SeekingChargerTimer", Seconds(30), () =>
|
|
87
|
+
this.#handleDocking(),
|
|
88
|
+
);
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
async #initializeNode() {
|
|
@@ -368,7 +370,7 @@ export class RvcDeviceLogic extends Behavior {
|
|
|
368
370
|
|
|
369
371
|
this.internal.serviceAreaChangeTimer = Time.getPeriodicTimer(
|
|
370
372
|
"ServiceAreaChangeTimer",
|
|
371
|
-
CLEANING_MAPPING_ROUND_TIME / numberOfAreas +
|
|
373
|
+
Millis(CLEANING_MAPPING_ROUND_TIME / numberOfAreas + Seconds(1)), // Two Areas by default
|
|
372
374
|
() => this.#changeCurrentServiceArea(),
|
|
373
375
|
).start();
|
|
374
376
|
await this.#changeCurrentServiceArea();
|
|
@@ -208,7 +208,7 @@ async function getConfiguration() {
|
|
|
208
208
|
const port = environment.vars.number("port") ?? 5540;
|
|
209
209
|
|
|
210
210
|
const uniqueId =
|
|
211
|
-
environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs
|
|
211
|
+
environment.vars.string("uniqueid") ?? (await deviceStorage.get("uniqueid", Time.nowMs.toString()));
|
|
212
212
|
|
|
213
213
|
// Persist basic data to keep them also on restart
|
|
214
214
|
await deviceStorage.set({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"typescriptVersion": "~5.9.2",
|
|
3
|
-
"nodeTypesVersion": "^24.
|
|
3
|
+
"nodeTypesVersion": "^24.3.0",
|
|
4
4
|
"templates": [
|
|
5
5
|
{
|
|
6
6
|
"name": "control-onoff",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
8
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
9
9
|
},
|
|
10
10
|
"description": "Simple light controller",
|
|
11
11
|
"entrypoint": "OnOffController.ts"
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
{
|
|
14
14
|
"name": "controller",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
17
|
-
"@matter/nodejs-ble": "~0.16.0-alpha.0-
|
|
18
|
-
"@project-chip/matter.js": "~0.16.0-alpha.0-
|
|
16
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b",
|
|
17
|
+
"@matter/nodejs-ble": "~0.16.0-alpha.0-20250819-0a388db8b",
|
|
18
|
+
"@project-chip/matter.js": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
19
19
|
},
|
|
20
20
|
"description": "Controller example to commission and connect devices",
|
|
21
21
|
"entrypoint": "ControllerNode.ts"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
{
|
|
24
24
|
"name": "device-air-quality-sensor",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
26
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
27
27
|
},
|
|
28
28
|
"description": "Air quality sensor example",
|
|
29
29
|
"entrypoint": "AirQualitySensorDeviceNode.ts"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
{
|
|
32
32
|
"name": "device-bridge-onoff",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
34
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
35
35
|
},
|
|
36
36
|
"description": "Bridge for multiple OnOff light/sockets with a CLI command execution interface",
|
|
37
37
|
"entrypoint": "BridgedDevicesNode.ts"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
{
|
|
40
40
|
"name": "device-composed-onoff",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
42
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
43
43
|
},
|
|
44
44
|
"description": "Composed device for multiple OnOff light/sockets with a CLI command execution interface",
|
|
45
45
|
"entrypoint": "ComposedDeviceNode.ts"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
{
|
|
48
48
|
"name": "device-composed-wc-light",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
50
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
51
51
|
},
|
|
52
52
|
"description": "Composed device with Window covering and a light endpoint that logs changes",
|
|
53
53
|
"entrypoint": "IlluminatedRollerShade.ts"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
{
|
|
56
56
|
"name": "device-measuring-socket",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
58
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
59
59
|
},
|
|
60
60
|
"description": "Socket device that reports random Energy and Power measurements",
|
|
61
61
|
"entrypoint": "MeasuredSocketDevice.ts"
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
{
|
|
64
64
|
"name": "device-multiple-onoff",
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
66
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
67
67
|
},
|
|
68
68
|
"description": "Multiple OnOff light/socket nodes in one process with a CLI command execution interface",
|
|
69
69
|
"entrypoint": "MultiDeviceNode.ts"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
{
|
|
72
72
|
"name": "device-onoff",
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
74
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
75
75
|
},
|
|
76
76
|
"description": "OnOff light/socket device with a CLI command execution interface",
|
|
77
77
|
"entrypoint": "DeviceNode.ts"
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
{
|
|
80
80
|
"name": "device-onoff-advanced",
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@matter/nodejs": "~0.16.0-alpha.0-
|
|
83
|
-
"@matter/nodejs-ble": "~0.16.0-alpha.0-
|
|
84
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
82
|
+
"@matter/nodejs": "~0.16.0-alpha.0-20250819-0a388db8b",
|
|
83
|
+
"@matter/nodejs-ble": "~0.16.0-alpha.0-20250819-0a388db8b",
|
|
84
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
85
85
|
},
|
|
86
86
|
"description": "OnOff light/socket device with BLE support and advanced API usage",
|
|
87
87
|
"entrypoint": "DeviceNodeFull.ts"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
{
|
|
90
90
|
"name": "device-onoff-light",
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
92
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
93
93
|
},
|
|
94
94
|
"description": "OnOff light example which logs the state changes to the console",
|
|
95
95
|
"entrypoint": "LightDevice.ts"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
{
|
|
98
98
|
"name": "device-robotic-vacuum-cleaner",
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
100
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
101
101
|
},
|
|
102
102
|
"description": "Robotic Vacuum Cleaner Example",
|
|
103
103
|
"entrypoint": "RoboticVacuumCleanerDevice.ts"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
{
|
|
106
106
|
"name": "device-sensor",
|
|
107
107
|
"dependencies": {
|
|
108
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
108
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
109
109
|
},
|
|
110
110
|
"description": "Temperature/Humidity sensor with a CLI command interface to get the value",
|
|
111
111
|
"entrypoint": "SensorDeviceNode.ts"
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
{
|
|
114
114
|
"name": "device-simple",
|
|
115
115
|
"dependencies": {
|
|
116
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
116
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
117
117
|
},
|
|
118
118
|
"description": "A simple on/off device",
|
|
119
119
|
"entrypoint": "main.ts"
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
{
|
|
122
122
|
"name": "device-smoke-co-alarm",
|
|
123
123
|
"dependencies": {
|
|
124
|
-
"@matter/main": "~0.16.0-alpha.0-
|
|
124
|
+
"@matter/main": "~0.16.0-alpha.0-20250819-0a388db8b"
|
|
125
125
|
},
|
|
126
126
|
"description": "Smoke CO Alarm Example",
|
|
127
127
|
"entrypoint": "SmokeCOAlarmDeviceNode.ts"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matter/create",
|
|
3
|
-
"version": "0.16.0-alpha.0-
|
|
3
|
+
"version": "0.16.0-alpha.0-20250819-0a388db8b",
|
|
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/matter-js/matter.js#readme",
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@matter/tools": "0.16.0-alpha.0-
|
|
36
|
-
"@types/node": "^24.
|
|
35
|
+
"@matter/tools": "0.16.0-alpha.0-20250819-0a388db8b",
|
|
36
|
+
"@types/node": "^24.3.0",
|
|
37
37
|
"@types/tar-stream": "^3.1.4"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|