matterbridge 3.4.1-dev-20251129-ff1e22f → 3.4.1-dev-20251130-ae6b492
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 +1 -0
- package/dist/deviceManager.js +2 -1
- package/dist/frontend.js +3 -2
- package/dist/matterbridge.js +1 -1
- package/dist/pluginManager.js +11 -10
- package/frontend/build/assets/index.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/scripts/fetch-chip.mjs +14 -12
- package/dist/defaultConfigSchema.js +0 -61
package/CHANGELOG.md
CHANGED
|
@@ -35,6 +35,7 @@ Advantages:
|
|
|
35
35
|
- [matterbridge]: Added addVirtualEndpoint() to match Matterbridge thread module.
|
|
36
36
|
- [BroadcastServer]: Backport BroadcastServer v.2.0.0 from Matterbridge thread module.
|
|
37
37
|
- [MatterbridgePrefix]: Added worker thread to get global node_modules.
|
|
38
|
+
- [PluginManager]: Improved the resolve method to resolve automatically also in the plugin directory Usefull for developing with DevContainer.
|
|
38
39
|
|
|
39
40
|
### Changed
|
|
40
41
|
|
package/dist/deviceManager.js
CHANGED
|
@@ -41,10 +41,11 @@ export class DeviceManager {
|
|
|
41
41
|
this.log.debug('Matterbridge device manager started');
|
|
42
42
|
}
|
|
43
43
|
destroy() {
|
|
44
|
+
this.server.off('broadcast_message', this.msgHandler.bind(this));
|
|
44
45
|
this.server.close();
|
|
45
46
|
}
|
|
46
47
|
async msgHandler(msg) {
|
|
47
|
-
if (this.server.isWorkerRequest(msg)
|
|
48
|
+
if (this.server.isWorkerRequest(msg)) {
|
|
48
49
|
if (this.verbose)
|
|
49
50
|
this.log.debug(`Received request message ${CYAN}${msg.type}${db} from ${CYAN}${msg.src}${db}: ${debugStringify(msg)}${db}`);
|
|
50
51
|
switch (msg.type) {
|
package/dist/frontend.js
CHANGED
|
@@ -43,10 +43,11 @@ export class Frontend extends EventEmitter {
|
|
|
43
43
|
this.server.on('broadcast_message', this.msgHandler.bind(this));
|
|
44
44
|
}
|
|
45
45
|
destroy() {
|
|
46
|
+
this.server.off('broadcast_message', this.msgHandler.bind(this));
|
|
46
47
|
this.server.close();
|
|
47
48
|
}
|
|
48
49
|
async msgHandler(msg) {
|
|
49
|
-
if (this.server.isWorkerRequest(msg)
|
|
50
|
+
if (this.server.isWorkerRequest(msg)) {
|
|
50
51
|
if (this.verbose)
|
|
51
52
|
this.log.debug(`Received broadcast request ${CYAN}${msg.type}${db} from ${CYAN}${msg.src}${db}: ${debugStringify(msg)}${db}`);
|
|
52
53
|
switch (msg.type) {
|
|
@@ -102,7 +103,7 @@ export class Frontend extends EventEmitter {
|
|
|
102
103
|
this.log.debug(`Unknown broadcast request ${CYAN}${msg.type}${db} from ${CYAN}${msg.src}${db}`);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
if (this.server.isWorkerResponse(msg) && msg.result
|
|
106
|
+
if (this.server.isWorkerResponse(msg) && msg.result) {
|
|
106
107
|
if (this.verbose)
|
|
107
108
|
this.log.debug(`Received broadcast response ${CYAN}${msg.type}${db} from ${CYAN}${msg.src}${db}: ${debugStringify(msg)}${db}`);
|
|
108
109
|
switch (msg.type) {
|
package/dist/matterbridge.js
CHANGED
|
@@ -827,7 +827,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
827
827
|
else {
|
|
828
828
|
this.log.debug(`Global node_modules Directory: ${this.globalModulesDirectory}`);
|
|
829
829
|
const { createESMWorker } = await import('./workers.js');
|
|
830
|
-
createESMWorker('NpmGlobalPrefix', '
|
|
830
|
+
createESMWorker('NpmGlobalPrefix', path.join(this.rootDirectory, 'dist/workerGlobalPrefix.js'));
|
|
831
831
|
}
|
|
832
832
|
this.log.debug(`Reading matterbridge package.json...`);
|
|
833
833
|
const packageJson = JSON.parse(await fs.promises.readFile(path.join(this.rootDirectory, 'package.json'), 'utf-8'));
|
package/dist/pluginManager.js
CHANGED
|
@@ -21,10 +21,11 @@ export class PluginManager extends EventEmitter {
|
|
|
21
21
|
this.log.debug('Matterbridge plugin manager started');
|
|
22
22
|
}
|
|
23
23
|
destroy() {
|
|
24
|
+
this.server.off('broadcast_message', this.msgHandler.bind(this));
|
|
24
25
|
this.server.close();
|
|
25
26
|
}
|
|
26
27
|
async msgHandler(msg) {
|
|
27
|
-
if (this.server.isWorkerRequest(msg)
|
|
28
|
+
if (this.server.isWorkerRequest(msg)) {
|
|
28
29
|
if (this.verbose)
|
|
29
30
|
this.log.debug(`Received request message ${CYAN}${msg.type}${db} from ${CYAN}${msg.src}${db}: ${debugStringify(msg)}${db}`);
|
|
30
31
|
switch (msg.type) {
|
|
@@ -364,6 +365,14 @@ export class PluginManager extends EventEmitter {
|
|
|
364
365
|
packageJsonPath = path.join(this.matterbridge.globalModulesDirectory, nameOrPath);
|
|
365
366
|
this.log.debug(`Trying at ${plg}${packageJsonPath}${db}`);
|
|
366
367
|
}
|
|
368
|
+
try {
|
|
369
|
+
await promises.access(packageJsonPath);
|
|
370
|
+
}
|
|
371
|
+
catch {
|
|
372
|
+
this.log.debug(`Package.json not found at ${plg}${packageJsonPath}${db}`);
|
|
373
|
+
packageJsonPath = path.join(this.matterbridge.matterbridgePluginDirectory, nameOrPath);
|
|
374
|
+
this.log.debug(`Trying at ${plg}${packageJsonPath}${db}`);
|
|
375
|
+
}
|
|
367
376
|
try {
|
|
368
377
|
const packageJson = JSON.parse(await promises.readFile(packageJsonPath, 'utf8'));
|
|
369
378
|
if (!packageJson.name) {
|
|
@@ -975,7 +984,6 @@ export class PluginManager extends EventEmitter {
|
|
|
975
984
|
async loadConfig(plugin) {
|
|
976
985
|
const { default: path } = await import('node:path');
|
|
977
986
|
const { promises } = await import('node:fs');
|
|
978
|
-
const { shelly_config, somfytahoma_config, zigbee2mqtt_config } = await import('./defaultConfigSchema.js');
|
|
979
987
|
const configFile = path.join(this.matterbridge.matterbridgeDirectory, `${plugin.name}.config.json`);
|
|
980
988
|
const defaultConfigFile = plugin.path.replace('package.json', `${plugin.name}.config.json`);
|
|
981
989
|
try {
|
|
@@ -1004,14 +1012,7 @@ export class PluginManager extends EventEmitter {
|
|
|
1004
1012
|
}
|
|
1005
1013
|
catch (_err) {
|
|
1006
1014
|
this.log.debug(`Default config file ${defaultConfigFile} for plugin ${plg}${plugin.name}${db} does not exist, creating new config file...`);
|
|
1007
|
-
|
|
1008
|
-
config = zigbee2mqtt_config;
|
|
1009
|
-
else if (plugin.name === 'matterbridge-somfy-tahoma')
|
|
1010
|
-
config = somfytahoma_config;
|
|
1011
|
-
else if (plugin.name === 'matterbridge-shelly')
|
|
1012
|
-
config = shelly_config;
|
|
1013
|
-
else
|
|
1014
|
-
config = { name: plugin.name, type: plugin.type, version: '1.0.0', debug: false, unregisterOnShutdown: false };
|
|
1015
|
+
config = { name: plugin.name, type: plugin.type, version: '1.0.0', debug: false, unregisterOnShutdown: false };
|
|
1015
1016
|
}
|
|
1016
1017
|
try {
|
|
1017
1018
|
await promises.writeFile(configFile, JSON.stringify(config, null, 2), 'utf8');
|