@matterbridge/core 3.10.10-dev-20260917-9fdf275 → 3.10.10-dev-20260917-332fed8
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/cli.js +1 -0
- package/dist/demoDevices.js +1 -0
- package/dist/frontend.js +1 -0
- package/dist/matterNode.js +9 -2
- package/dist/matterbridge.js +12 -1
- package/dist/pluginManager.js +5 -1
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -180,6 +180,7 @@ function help() {
|
|
|
180
180
|
--fixed_delay [seconds]: set a fixed delay in seconds before starting Matterbridge (default 120)
|
|
181
181
|
--no-ansi: disable ANSI color output in the logs
|
|
182
182
|
--reset-sessions: reset sessions and resumption records on shutdown (use only if your controller has issue reconnecting on restart)
|
|
183
|
+
--configuration-version: increment by one the configuration version of all the server nodes when they go online (add a value to set it instead, i.e. --configuration-version 5)
|
|
183
184
|
`);
|
|
184
185
|
process.exit(0);
|
|
185
186
|
}
|
package/dist/demoDevices.js
CHANGED
|
@@ -160,6 +160,7 @@ export async function createDemoDevices(matterbridge) {
|
|
|
160
160
|
author: 'https://github.com/Luligu',
|
|
161
161
|
enabled: false,
|
|
162
162
|
private: true,
|
|
163
|
+
configurationVersion: 1,
|
|
163
164
|
registeredDevices: 0,
|
|
164
165
|
configJson: demoPluginConfig,
|
|
165
166
|
schemaJson: demoPluginSchema,
|
package/dist/frontend.js
CHANGED
|
@@ -1268,6 +1268,7 @@ export class Frontend extends EventEmitter {
|
|
|
1268
1268
|
name: plugin.name,
|
|
1269
1269
|
version: plugin.version,
|
|
1270
1270
|
private: plugin.private,
|
|
1271
|
+
configurationVersion: plugin.configurationVersion,
|
|
1271
1272
|
description: plugin.description,
|
|
1272
1273
|
author: plugin.author,
|
|
1273
1274
|
homepage: plugin.homepage,
|
package/dist/matterNode.js
CHANGED
|
@@ -19,7 +19,7 @@ import { copyDirectory } from '@matterbridge/utils/copy-dir';
|
|
|
19
19
|
import { getErrorMessage, inspectError } from '@matterbridge/utils/error';
|
|
20
20
|
import { logModuleLoaded } from '@matterbridge/utils/loader';
|
|
21
21
|
import { isValidInteger, isValidString, parseVersionString } from '@matterbridge/utils/validate';
|
|
22
|
-
import { wait, withTimeout } from '@matterbridge/utils/wait';
|
|
22
|
+
import { fireAndForget, wait, withTimeout } from '@matterbridge/utils/wait';
|
|
23
23
|
import { AnsiLogger, BLUE, CYAN, db, debugStringify, er, nf, or, zb } from 'node-ansi-logger';
|
|
24
24
|
import { NodeStorageManager } from 'node-persist-manager';
|
|
25
25
|
import { toBaseDevice } from './deviceManager.js';
|
|
@@ -490,6 +490,13 @@ export class MatterNode extends EventEmitter {
|
|
|
490
490
|
});
|
|
491
491
|
serverNode.lifecycle.online.on(() => {
|
|
492
492
|
this.log.notice(`Server node for ${storeId} is online`);
|
|
493
|
+
this.log.info(`Configuration version for server node ${storeId} is ${serverNode.state.basicInformation.configurationVersion}`);
|
|
494
|
+
if (hasParameter('configuration-version')) {
|
|
495
|
+
let configurationVersion = getIntParameter('configuration-version') ?? serverNode.state.basicInformation.configurationVersion + 1;
|
|
496
|
+
configurationVersion = Math.min(Math.max(configurationVersion, 1), UINT32_MAX);
|
|
497
|
+
fireAndForget(serverNode.setStateOf(BasicInformationServer, { configurationVersion }), this.log, `Failed to set configuration version for server node ${storeId}`);
|
|
498
|
+
this.log.notice(`Configuration version for server node ${storeId} is now ${configurationVersion}`);
|
|
499
|
+
}
|
|
493
500
|
if (!serverNode.lifecycle.isCommissioned) {
|
|
494
501
|
this.log.notice(`Server node for ${storeId} is not commissioned. Pair to commission ...`);
|
|
495
502
|
this.advertisingNodes.set(storeId, Date.now());
|
|
@@ -640,7 +647,7 @@ export class MatterNode extends EventEmitter {
|
|
|
640
647
|
if (!plugin.locked) {
|
|
641
648
|
plugin.locked = true;
|
|
642
649
|
this.log.debug(`Creating dynamic plugin ${plg}${plugin.name}${db} server node...`);
|
|
643
|
-
this.matterStorageContext = await this.createServerNodeContext(plugin.name, plugin.description, this.aggregatorDeviceType, this.aggregatorVendorId, this.aggregatorVendorName, this.aggregatorProductId, this.aggregatorProductName, undefined, undefined, parseVersionString(this.matterbridge.matterbridgeVersion), this.matterbridge.matterbridgeVersion, parseVersionString(this.matterbridge.systemInformation.osRelease), this.matterbridge.systemInformation.osRelease, plugin.description, plugin.homepage ?? 'https://matterbridge.io',
|
|
650
|
+
this.matterStorageContext = await this.createServerNodeContext(plugin.name, plugin.description, this.aggregatorDeviceType, this.aggregatorVendorId, this.aggregatorVendorName, this.aggregatorProductId, this.aggregatorProductName, undefined, undefined, parseVersionString(this.matterbridge.matterbridgeVersion), this.matterbridge.matterbridgeVersion, parseVersionString(this.matterbridge.systemInformation.osRelease), this.matterbridge.systemInformation.osRelease, plugin.description, plugin.homepage ?? 'https://matterbridge.io', plugin.configurationVersion);
|
|
644
651
|
this.serverNode = await this.createServerNode(this.port ? this.port++ : undefined, this.passcode ? this.passcode++ : undefined, this.discriminator ? this.discriminator++ : undefined);
|
|
645
652
|
this.log.debug(`Creating dynamic plugin ${plg}${plugin.name}${db} aggregator node...`);
|
|
646
653
|
this.aggregatorNode = await this.createAggregatorNode();
|
package/dist/matterbridge.js
CHANGED
|
@@ -1248,6 +1248,10 @@ export class Matterbridge extends EventEmitter {
|
|
|
1248
1248
|
this.log.info('Unregistering all devices and shutting down...');
|
|
1249
1249
|
if (this.serverNode)
|
|
1250
1250
|
await this.serverNode.setStateOf(BasicInformationServer, { configurationVersion: this.serverNode.state.basicInformation.configurationVersion + 1 });
|
|
1251
|
+
for (const device of this.devices.array()) {
|
|
1252
|
+
if (device.serverNode)
|
|
1253
|
+
await device.serverNode.setStateOf(BasicInformationServer, { configurationVersion: device.serverNode.state.basicInformation.configurationVersion + 1 });
|
|
1254
|
+
}
|
|
1251
1255
|
for (const plugin of this.plugins.array()) {
|
|
1252
1256
|
if (plugin.error || !plugin.enabled)
|
|
1253
1257
|
continue;
|
|
@@ -1965,6 +1969,13 @@ export class Matterbridge extends EventEmitter {
|
|
|
1965
1969
|
});
|
|
1966
1970
|
serverNode.lifecycle.online.on(() => {
|
|
1967
1971
|
this.log.notice(`Server node for ${storeId} is online`);
|
|
1972
|
+
this.log.info(`Configuration version for server node ${storeId} is ${serverNode.state.basicInformation.configurationVersion}`);
|
|
1973
|
+
if (hasParameter('configuration-version')) {
|
|
1974
|
+
let configurationVersion = getIntParameter('configuration-version') ?? serverNode.state.basicInformation.configurationVersion + 1;
|
|
1975
|
+
configurationVersion = Math.min(Math.max(configurationVersion, 1), UINT32_MAX);
|
|
1976
|
+
fireAndForget(serverNode.setStateOf(BasicInformationServer, { configurationVersion }), this.log, `Failed to set configuration version for server node ${storeId}`);
|
|
1977
|
+
this.log.notice(`Configuration version for server node ${storeId} is now ${configurationVersion}`);
|
|
1978
|
+
}
|
|
1968
1979
|
if (serverNode.lifecycle.isCommissioned) {
|
|
1969
1980
|
this.log.notice(`Server node for ${storeId} is already commissioned.`);
|
|
1970
1981
|
this.advertisingNodes.delete(storeId);
|
|
@@ -2076,7 +2087,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2076
2087
|
if (!plugin.locked) {
|
|
2077
2088
|
plugin.locked = true;
|
|
2078
2089
|
this.log.debug(`Creating dynamic plugin ${plg}${plugin.name}${db} server node...`);
|
|
2079
|
-
plugin.storageContext = await this.createServerNodeContext(plugin.name, plugin.description, this.aggregatorDeviceType, this.aggregatorVendorId, this.aggregatorVendorName, this.aggregatorProductId, this.aggregatorProductName, undefined, undefined, parseVersionString(this.matterbridgeVersion), this.matterbridgeVersion, parseVersionString(this.systemInformation.osRelease), this.systemInformation.osRelease, plugin.description, plugin.homepage ?? 'https://matterbridge.io',
|
|
2090
|
+
plugin.storageContext = await this.createServerNodeContext(plugin.name, plugin.description, this.aggregatorDeviceType, this.aggregatorVendorId, this.aggregatorVendorName, this.aggregatorProductId, this.aggregatorProductName, undefined, undefined, parseVersionString(this.matterbridgeVersion), this.matterbridgeVersion, parseVersionString(this.systemInformation.osRelease), this.systemInformation.osRelease, plugin.description, plugin.homepage ?? 'https://matterbridge.io', plugin.configurationVersion);
|
|
2080
2091
|
plugin.serverNode = await this.createServerNode(plugin.storageContext, this.port ? this.port++ : undefined, this.passcode ? this.passcode++ : undefined, this.discriminator ? this.discriminator++ : undefined);
|
|
2081
2092
|
this.log.debug(`Creating dynamic plugin ${plg}${plugin.name}${db} aggregator node...`);
|
|
2082
2093
|
plugin.aggregatorNode = await this.createAggregatorNode(plugin.storageContext);
|
package/dist/pluginManager.js
CHANGED
|
@@ -357,6 +357,7 @@ export class PluginManager extends EventEmitter {
|
|
|
357
357
|
author: plugin.author,
|
|
358
358
|
enabled: plugin.enabled,
|
|
359
359
|
private: plugin.private,
|
|
360
|
+
configurationVersion: plugin.configurationVersion,
|
|
360
361
|
};
|
|
361
362
|
}
|
|
362
363
|
toApiPlugin(plugin) {
|
|
@@ -368,6 +369,7 @@ export class PluginManager extends EventEmitter {
|
|
|
368
369
|
path: plugin.path,
|
|
369
370
|
type: plugin.type,
|
|
370
371
|
private: plugin.private,
|
|
372
|
+
configurationVersion: plugin.configurationVersion,
|
|
371
373
|
latestVersion: plugin.latestVersion,
|
|
372
374
|
devVersion: plugin.devVersion,
|
|
373
375
|
homepage: plugin.homepage,
|
|
@@ -432,7 +434,7 @@ export class PluginManager extends EventEmitter {
|
|
|
432
434
|
}
|
|
433
435
|
const pluginsArray = await this.matterbridge.nodeContext.get('plugins', []);
|
|
434
436
|
for (const plugin of pluginsArray)
|
|
435
|
-
this._plugins.set(plugin.name, { ...plugin, private: plugin.private ?? false });
|
|
437
|
+
this._plugins.set(plugin.name, { ...plugin, private: plugin.private ?? false, configurationVersion: plugin.configurationVersion ?? 1 });
|
|
436
438
|
this.log.debug(`Loaded ${BLUE}${pluginsArray.length}${db} plugins from storage`);
|
|
437
439
|
return pluginsArray;
|
|
438
440
|
}
|
|
@@ -454,6 +456,7 @@ export class PluginManager extends EventEmitter {
|
|
|
454
456
|
enabled: plugin.enabled,
|
|
455
457
|
private: plugin.private,
|
|
456
458
|
tarballPath: plugin.tarballPath,
|
|
459
|
+
configurationVersion: plugin.configurationVersion,
|
|
457
460
|
});
|
|
458
461
|
}
|
|
459
462
|
await this.matterbridge.nodeContext.set('plugins', plugins);
|
|
@@ -823,6 +826,7 @@ export class PluginManager extends EventEmitter {
|
|
|
823
826
|
type: 'AnyPlatform',
|
|
824
827
|
version: packageJson.version,
|
|
825
828
|
private: packageJson.private || false,
|
|
829
|
+
configurationVersion: 1,
|
|
826
830
|
description: packageJson.description,
|
|
827
831
|
author: this.getAuthor(packageJson),
|
|
828
832
|
homepage: this.getHomepage(packageJson),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/core",
|
|
3
|
-
"version": "3.10.10-dev-20260917-
|
|
3
|
+
"version": "3.10.10-dev-20260917-332fed8",
|
|
4
4
|
"description": "Matterbridge core library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -136,10 +136,10 @@
|
|
|
136
136
|
},
|
|
137
137
|
"dependencies": {
|
|
138
138
|
"@matter/main": "0.17.9",
|
|
139
|
-
"@matterbridge/dgram": "3.10.10-dev-20260917-
|
|
140
|
-
"@matterbridge/thread": "3.10.10-dev-20260917-
|
|
141
|
-
"@matterbridge/types": "3.10.10-dev-20260917-
|
|
142
|
-
"@matterbridge/utils": "3.10.10-dev-20260917-
|
|
139
|
+
"@matterbridge/dgram": "3.10.10-dev-20260917-332fed8",
|
|
140
|
+
"@matterbridge/thread": "3.10.10-dev-20260917-332fed8",
|
|
141
|
+
"@matterbridge/types": "3.10.10-dev-20260917-332fed8",
|
|
142
|
+
"@matterbridge/utils": "3.10.10-dev-20260917-332fed8",
|
|
143
143
|
"escape-html": "1.0.3",
|
|
144
144
|
"express": "5.2.1",
|
|
145
145
|
"express-rate-limit": "8.7.0",
|