matterbridge 3.4.0-dev-20251120-5724e43 → 3.4.0-dev-20251121-a354bec
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/CHANGELOG.md +3 -2
- package/dist/matterbridgePlatform.js +14 -12
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -46,12 +46,13 @@ Removed the following long deprecated elements:
|
|
|
46
46
|
- [doorLock]: Added autoRelockTime attribute with default 0.
|
|
47
47
|
- [DevContainer]: Added instructions for testing a plugin with a paired controller when using DevContainer.
|
|
48
48
|
- [platform]: Made internal use methods and properties hard-private.
|
|
49
|
-
- [platform]: Added size(), getDeviceByName(), getDeviceByUniqueId(), getDeviceBySerialNumber(), getDeviceById(), getDeviceByOriginalId(), getDeviceByNumber() and hasDeviceUniqueId().
|
|
50
|
-
- [platform]: Added isReady, isLoaded, isStarted and isConfigured.
|
|
49
|
+
- [platform]: Added size(), getDeviceByName(), getDeviceByUniqueId(), getDeviceBySerialNumber(), getDeviceById(), getDeviceByOriginalId(), getDeviceByNumber() and hasDeviceUniqueId() methods.
|
|
50
|
+
- [platform]: Added isReady, isLoaded, isStarted and isConfigured properties.
|
|
51
51
|
|
|
52
52
|
### Changed
|
|
53
53
|
|
|
54
54
|
- [package]: Updated dependencies.
|
|
55
|
+
- [platform]: Bumped MatterbridgePlatform v.1.4.0.
|
|
55
56
|
- [deviceManager]: Bumped DeviceManager v.1.1.1.
|
|
56
57
|
- [pluginManager]: Bumped PluginManager v.1.3.1.
|
|
57
58
|
- [broadcastServer]: Bumped BroadcastServer v.1.0.3.
|
|
@@ -18,7 +18,7 @@ export class MatterbridgePlatform {
|
|
|
18
18
|
name = '';
|
|
19
19
|
type = 'AnyPlatform';
|
|
20
20
|
version = '1.0.0';
|
|
21
|
-
storage;
|
|
21
|
+
#storage;
|
|
22
22
|
context;
|
|
23
23
|
isReady = false;
|
|
24
24
|
isLoaded = false;
|
|
@@ -48,7 +48,7 @@ export class MatterbridgePlatform {
|
|
|
48
48
|
throw new Error('Platform: the plugin name is missing or invalid.');
|
|
49
49
|
}
|
|
50
50
|
this.log.debug(`Creating storage for plugin ${this.config.name} in ${path.join(this.matterbridge.matterbridgeDirectory, this.config.name)}`);
|
|
51
|
-
this
|
|
51
|
+
this.#storage = new NodeStorageManager({
|
|
52
52
|
dir: path.join(this.matterbridge.matterbridgeDirectory, this.config.name),
|
|
53
53
|
writeQueue: false,
|
|
54
54
|
expiredInterval: undefined,
|
|
@@ -56,13 +56,13 @@ export class MatterbridgePlatform {
|
|
|
56
56
|
forgiveParseErrors: true,
|
|
57
57
|
});
|
|
58
58
|
this.log.debug(`Creating context for plugin ${this.config.name}`);
|
|
59
|
-
this.#contextReady = this
|
|
59
|
+
this.#contextReady = this.#storage.createStorage('context').then((context) => {
|
|
60
60
|
this.context = context;
|
|
61
61
|
this.log.debug(`Created context for plugin ${this.config.name}`);
|
|
62
62
|
return;
|
|
63
63
|
});
|
|
64
64
|
this.log.debug(`Loading selectDevice for plugin ${this.config.name}`);
|
|
65
|
-
this.#selectDeviceContextReady = this
|
|
65
|
+
this.#selectDeviceContextReady = this.#storage.createStorage('selectDevice').then(async (context) => {
|
|
66
66
|
const selectDevice = await context.get('selectDevice', []);
|
|
67
67
|
for (const device of selectDevice)
|
|
68
68
|
this.#selectDevices.set(device.serial, device);
|
|
@@ -70,7 +70,7 @@ export class MatterbridgePlatform {
|
|
|
70
70
|
return;
|
|
71
71
|
});
|
|
72
72
|
this.log.debug(`Loading selectEntity for plugin ${this.config.name}`);
|
|
73
|
-
this.#selectEntityContextReady = this
|
|
73
|
+
this.#selectEntityContextReady = this.#storage.createStorage('selectEntity').then(async (context) => {
|
|
74
74
|
const selectEntity = await context.get('selectEntity', []);
|
|
75
75
|
for (const entity of selectEntity)
|
|
76
76
|
this.#selectEntities.set(entity.name, entity);
|
|
@@ -91,7 +91,7 @@ export class MatterbridgePlatform {
|
|
|
91
91
|
this.#registeredEndpoints.clear();
|
|
92
92
|
await this.context?.close();
|
|
93
93
|
this.context = undefined;
|
|
94
|
-
await this
|
|
94
|
+
await this.#storage?.close();
|
|
95
95
|
this.#server.close();
|
|
96
96
|
if (this.#verbose)
|
|
97
97
|
this.log.debug(`Destroyed MatterbridgePlatform for plugin ${this.config.name}`);
|
|
@@ -250,13 +250,13 @@ export class MatterbridgePlatform {
|
|
|
250
250
|
this.#registeredEndpoints.clear();
|
|
251
251
|
}
|
|
252
252
|
async saveSelects() {
|
|
253
|
-
if (this
|
|
253
|
+
if (this.#storage) {
|
|
254
254
|
this.log.debug(`Saving ${this.#selectDevices.size} selectDevice...`);
|
|
255
|
-
const selectDevice = await this
|
|
255
|
+
const selectDevice = await this.#storage.createStorage('selectDevice');
|
|
256
256
|
await selectDevice.set('selectDevice', Array.from(this.#selectDevices.values()));
|
|
257
257
|
await selectDevice.close();
|
|
258
258
|
this.log.debug(`Saving ${this.#selectEntities.size} selectEntity...`);
|
|
259
|
-
const selectEntity = await this
|
|
259
|
+
const selectEntity = await this.#storage.createStorage('selectEntity');
|
|
260
260
|
await selectEntity.set('selectEntity', Array.from(this.#selectEntities.values()));
|
|
261
261
|
await selectEntity.close();
|
|
262
262
|
}
|
|
@@ -393,11 +393,13 @@ export class MatterbridgePlatform {
|
|
|
393
393
|
}
|
|
394
394
|
return true;
|
|
395
395
|
}
|
|
396
|
+
async clearEndpointNumbers() {
|
|
397
|
+
const context = await this.#storage.createStorage('endpointNumbers');
|
|
398
|
+
await context.set('endpointMap', []);
|
|
399
|
+
}
|
|
396
400
|
async checkEndpointNumbers() {
|
|
397
|
-
if (!this.storage)
|
|
398
|
-
return -1;
|
|
399
401
|
this.log.debug('Checking endpoint numbers...');
|
|
400
|
-
const context = await this
|
|
402
|
+
const context = await this.#storage.createStorage('endpointNumbers');
|
|
401
403
|
const separator = '|.|';
|
|
402
404
|
const endpointMap = new Map(await context.get('endpointMap', []));
|
|
403
405
|
for (const device of this.getDevices()) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "3.4.0-dev-
|
|
3
|
+
"version": "3.4.0-dev-20251121-a354bec",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "3.4.0-dev-
|
|
9
|
+
"version": "3.4.0-dev-20251121-a354bec",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "0.15.6",
|
package/package.json
CHANGED