matterbridge 1.6.6-dev.5 → 1.6.6-dev.6

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 CHANGED
@@ -18,7 +18,10 @@ Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord
18
18
 
19
19
  ### Added
20
20
 
21
- - [deviceTypes]: Add device type airConditioner.
21
+ - [frontend]: Add the possibility to install a specific version or the dev of any plugin (i.e. you can install matterbridge-hass@dev or matterbridge-hass@0.0.3).
22
+ It is also possible to use the install plugin to install a specific version of matterbridge (i.e. you can install matterbridge@dev or matterbridge@1.6.5)
23
+ - [frontend]: Add the possibility to set the matter port for commissioning (you can always override passing **-port [PORT]** on the command line).
24
+ - [deviceTypes]: Add device type airConditioner (not supported by the Apple Home).
22
25
  - [docker]: Add matterbridge-hass to docker dev.
23
26
  - [platform]: Added validateDeviceWhiteBlackList and validateEntityBlackList to be use consistently by all plugins.
24
27
 
@@ -68,6 +68,7 @@ export class Matterbridge extends EventEmitter {
68
68
  mattermdnsinterface: undefined,
69
69
  matteripv4address: undefined,
70
70
  matteripv6address: undefined,
71
+ matterPort: 5540,
71
72
  restartRequired: false,
72
73
  refreshRequired: false,
73
74
  };
@@ -151,9 +152,6 @@ export class Matterbridge extends EventEmitter {
151
152
  await wait(1000, 'Wait for the global node_modules and matterbridge version', false);
152
153
  }
153
154
  async initialize() {
154
- this.port = getIntParameter('port') ?? 5540;
155
- this.passcode = getIntParameter('passcode');
156
- this.discriminator = getIntParameter('discriminator');
157
155
  if (hasParameter('service'))
158
156
  this.restartMode = 'service';
159
157
  if (hasParameter('docker'))
@@ -200,6 +198,9 @@ export class Matterbridge extends EventEmitter {
200
198
  this.log.fatal('Fatal error creating node storage manager and context for matterbridge');
201
199
  throw new Error('Fatal error creating node storage manager and context for matterbridge');
202
200
  }
201
+ this.port = getIntParameter('port') ?? (await this.nodeContext.get('matterport', 5540)) ?? 5540;
202
+ this.passcode = getIntParameter('passcode');
203
+ this.discriminator = getIntParameter('discriminator');
203
204
  if (hasParameter('logger')) {
204
205
  const level = getParameter('logger');
205
206
  if (level === 'debug') {
@@ -1646,7 +1647,7 @@ export class Matterbridge extends EventEmitter {
1646
1647
  this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with uniqueId ${uniqueId} serialNumber ${serialNumber}`);
1647
1648
  this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with softwareVersion ${softwareVersion} softwareVersionString ${softwareVersionString}`);
1648
1649
  this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with hardwareVersion ${hardwareVersion} hardwareVersionString ${hardwareVersionString}`);
1649
- this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with nodeLabel '${productName}' port ${this.port} passcode ${this.passcode} discriminator ${this.discriminator}`);
1650
+ this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with nodeLabel '${productName}' port ${CYAN}${this.port}${db} passcode ${CYAN}${this.passcode}${db} discriminator ${CYAN}${this.discriminator}${db}`);
1650
1651
  if (this.ipv4address) {
1651
1652
  const networkInterfaces = os.networkInterfaces();
1652
1653
  const availableAddresses = Object.values(networkInterfaces)
@@ -2312,6 +2313,7 @@ export class Matterbridge extends EventEmitter {
2312
2313
  this.matterbridgeInformation.mattermdnsinterface = (await this.nodeContext?.get('mattermdnsinterface', '')) || '';
2313
2314
  this.matterbridgeInformation.matteripv4address = (await this.nodeContext?.get('matteripv4address', '')) || '';
2314
2315
  this.matterbridgeInformation.matteripv6address = (await this.nodeContext?.get('matteripv6address', '')) || '';
2316
+ this.matterbridgeInformation.matterPort = (await this.nodeContext?.get('matterport', 5540)) || 5540;
2315
2317
  this.matterbridgeInformation.matterbridgePaired = this.matterbridgePaired;
2316
2318
  this.matterbridgeInformation.matterbridgeConnected = this.matterbridgeConnected;
2317
2319
  this.matterbridgeInformation.matterbridgeQrPairingCode = this.matterbridgeQrPairingCode;
@@ -2629,6 +2631,14 @@ export class Matterbridge extends EventEmitter {
2629
2631
  res.json({ message: 'Command received' });
2630
2632
  return;
2631
2633
  }
2634
+ if (command === 'setmatterport') {
2635
+ const port = Math.min(Math.max(parseInt(param), 5540), 5560);
2636
+ this.matterbridgeInformation.matterPort = port;
2637
+ this.log.debug(`Set matter.js port to ${port}`);
2638
+ await this.nodeContext?.set('matterport', port);
2639
+ res.json({ message: 'Command received' });
2640
+ return;
2641
+ }
2632
2642
  if (command === 'setmblogfile') {
2633
2643
  this.log.debug('Matterbridge file log:', param);
2634
2644
  this.matterbridgeInformation.fileLogger = param === 'true';
@@ -2732,6 +2742,11 @@ export class Matterbridge extends EventEmitter {
2732
2742
  this.log.error(`Error installing plugin ${plg}${param}${er}`);
2733
2743
  }
2734
2744
  this.wssSendRestartRequired();
2745
+ param = param.split('@')[0];
2746
+ if (param === 'matterbridge') {
2747
+ res.json({ message: 'Command received' });
2748
+ return;
2749
+ }
2735
2750
  }
2736
2751
  if (command === 'addplugin' || command === 'installplugin') {
2737
2752
  param = param.replace(/\*/g, '\\');
@@ -81,6 +81,7 @@ export async function wsMessageHandler(client, message) {
81
81
  this.matterbridgeInformation.mattermdnsinterface = (await this.nodeContext?.get('mattermdnsinterface', '')) || '';
82
82
  this.matterbridgeInformation.matteripv4address = (await this.nodeContext?.get('matteripv4address', '')) || '';
83
83
  this.matterbridgeInformation.matteripv6address = (await this.nodeContext?.get('matteripv6address', '')) || '';
84
+ this.matterbridgeInformation.matterPort = (await this.nodeContext?.get('matterport', 5540)) || 5540;
84
85
  this.matterbridgeInformation.matterbridgePaired = this.matterbridgePaired;
85
86
  this.matterbridgeInformation.matterbridgeConnected = this.matterbridgeConnected;
86
87
  this.matterbridgeInformation.matterbridgeQrPairingCode = this.matterbridgeQrPairingCode;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.823e08b6.css",
4
- "main.js": "./static/js/main.0ab89802.js",
4
+ "main.js": "./static/js/main.1bf53a29.js",
5
5
  "static/js/453.abd36b29.chunk.js": "./static/js/453.abd36b29.chunk.js",
6
6
  "static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.4535474e1cf8598695ad.woff2",
7
7
  "static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.7077203b1982951ecf76.woff2",
@@ -61,11 +61,11 @@
61
61
  "static/media/roboto-greek-ext-400-normal.woff": "./static/media/roboto-greek-ext-400-normal.16eb83b4a3b1ea994243.woff",
62
62
  "index.html": "./index.html",
63
63
  "main.823e08b6.css.map": "./static/css/main.823e08b6.css.map",
64
- "main.0ab89802.js.map": "./static/js/main.0ab89802.js.map",
64
+ "main.1bf53a29.js.map": "./static/js/main.1bf53a29.js.map",
65
65
  "453.abd36b29.chunk.js.map": "./static/js/453.abd36b29.chunk.js.map"
66
66
  },
67
67
  "entrypoints": [
68
68
  "static/css/main.823e08b6.css",
69
- "static/js/main.0ab89802.js"
69
+ "static/js/main.1bf53a29.js"
70
70
  ]
71
71
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.0ab89802.js"></script><link href="./static/css/main.823e08b6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.1bf53a29.js"></script><link href="./static/css/main.823e08b6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>