matterbridge 1.6.6-dev.5 → 1.6.6-dev.7

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,12 +18,18 @@ 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 discriminator for commissioning (you can always override passing **-discriminator [DISCRIMINATOR]** on the command line).
24
+ - [frontend]: Add the possibility to set the matter passcode for commissioning (you can always override passing **-passcode [PASSCODE]** on the command line).
25
+ - [frontend]: Add the possibility to set the matter port for commissioning (you can always override passing **-port [PORT]** on the command line).
26
+ - [deviceTypes]: Add device type airConditioner (not supported by the Apple Home).
22
27
  - [docker]: Add matterbridge-hass to docker dev.
23
28
  - [platform]: Added validateDeviceWhiteBlackList and validateEntityBlackList to be use consistently by all plugins.
24
29
 
25
30
  ### Changed
26
31
 
32
+ - [package]: Update matter.js to 0.11.9-alpha.0-20241206-22f23333.
27
33
  - [plugin]: Removed check on package types since we are moving to production plugins.
28
34
  - [package]: Set required node version to 18, 20 and 22.
29
35
  - [package]: Update dependencies.
@@ -68,6 +68,9 @@ export class Matterbridge extends EventEmitter {
68
68
  mattermdnsinterface: undefined,
69
69
  matteripv4address: undefined,
70
70
  matteripv6address: undefined,
71
+ matterPort: 5540,
72
+ matterDiscriminator: undefined,
73
+ matterPasscode: undefined,
71
74
  restartRequired: false,
72
75
  refreshRequired: false,
73
76
  };
@@ -151,9 +154,6 @@ export class Matterbridge extends EventEmitter {
151
154
  await wait(1000, 'Wait for the global node_modules and matterbridge version', false);
152
155
  }
153
156
  async initialize() {
154
- this.port = getIntParameter('port') ?? 5540;
155
- this.passcode = getIntParameter('passcode');
156
- this.discriminator = getIntParameter('discriminator');
157
157
  if (hasParameter('service'))
158
158
  this.restartMode = 'service';
159
159
  if (hasParameter('docker'))
@@ -200,6 +200,9 @@ export class Matterbridge extends EventEmitter {
200
200
  this.log.fatal('Fatal error creating node storage manager and context for matterbridge');
201
201
  throw new Error('Fatal error creating node storage manager and context for matterbridge');
202
202
  }
203
+ this.port = getIntParameter('port') ?? (await this.nodeContext.get('matterport', 5540)) ?? 5540;
204
+ this.passcode = getIntParameter('passcode') ?? (await this.nodeContext.get('matterpasscode'));
205
+ this.discriminator = getIntParameter('discriminator') ?? (await this.nodeContext.get('matterdiscriminator'));
203
206
  if (hasParameter('logger')) {
204
207
  const level = getParameter('logger');
205
208
  if (level === 'debug') {
@@ -1646,7 +1649,7 @@ export class Matterbridge extends EventEmitter {
1646
1649
  this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with uniqueId ${uniqueId} serialNumber ${serialNumber}`);
1647
1650
  this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with softwareVersion ${softwareVersion} softwareVersionString ${softwareVersionString}`);
1648
1651
  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}`);
1652
+ this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with nodeLabel '${productName}' port ${CYAN}${this.port}${db} discriminator ${CYAN}${this.discriminator}${db} passcode ${CYAN}${this.passcode}${db} `);
1650
1653
  if (this.ipv4address) {
1651
1654
  const networkInterfaces = os.networkInterfaces();
1652
1655
  const availableAddresses = Object.values(networkInterfaces)
@@ -2312,6 +2315,9 @@ export class Matterbridge extends EventEmitter {
2312
2315
  this.matterbridgeInformation.mattermdnsinterface = (await this.nodeContext?.get('mattermdnsinterface', '')) || '';
2313
2316
  this.matterbridgeInformation.matteripv4address = (await this.nodeContext?.get('matteripv4address', '')) || '';
2314
2317
  this.matterbridgeInformation.matteripv6address = (await this.nodeContext?.get('matteripv6address', '')) || '';
2318
+ this.matterbridgeInformation.matterPort = (await this.nodeContext?.get('matterport', 5540)) ?? 5540;
2319
+ this.matterbridgeInformation.matterDiscriminator = await this.nodeContext?.get('matterdiscriminator');
2320
+ this.matterbridgeInformation.matterPasscode = await this.nodeContext?.get('matterpasscode');
2315
2321
  this.matterbridgeInformation.matterbridgePaired = this.matterbridgePaired;
2316
2322
  this.matterbridgeInformation.matterbridgeConnected = this.matterbridgeConnected;
2317
2323
  this.matterbridgeInformation.matterbridgeQrPairingCode = this.matterbridgeQrPairingCode;
@@ -2629,6 +2635,30 @@ export class Matterbridge extends EventEmitter {
2629
2635
  res.json({ message: 'Command received' });
2630
2636
  return;
2631
2637
  }
2638
+ if (command === 'setmatterport') {
2639
+ const port = Math.min(Math.max(parseInt(param), 5540), 5560);
2640
+ this.matterbridgeInformation.matterPort = port;
2641
+ this.log.debug(`Set matter commissioning port to ${CYAN}${port}${db}`);
2642
+ await this.nodeContext?.set('matterport', port);
2643
+ res.json({ message: 'Command received' });
2644
+ return;
2645
+ }
2646
+ if (command === 'setmatterdiscriminator') {
2647
+ const discriminator = Math.min(Math.max(parseInt(param), 1000), 4095);
2648
+ this.matterbridgeInformation.matterDiscriminator = discriminator;
2649
+ this.log.debug(`Set matter commissioning discriminator to ${CYAN}${discriminator}${db}`);
2650
+ await this.nodeContext?.set('matterdiscriminator', discriminator);
2651
+ res.json({ message: 'Command received' });
2652
+ return;
2653
+ }
2654
+ if (command === 'setmatterpasscode') {
2655
+ const passcode = Math.min(Math.max(parseInt(param), 10000000), 90000000);
2656
+ this.matterbridgeInformation.matterPasscode = passcode;
2657
+ this.log.debug(`Set matter commissioning passcode to ${CYAN}${passcode}${db}`);
2658
+ await this.nodeContext?.set('matterpasscode', passcode);
2659
+ res.json({ message: 'Command received' });
2660
+ return;
2661
+ }
2632
2662
  if (command === 'setmblogfile') {
2633
2663
  this.log.debug('Matterbridge file log:', param);
2634
2664
  this.matterbridgeInformation.fileLogger = param === 'true';
@@ -2732,6 +2762,11 @@ export class Matterbridge extends EventEmitter {
2732
2762
  this.log.error(`Error installing plugin ${plg}${param}${er}`);
2733
2763
  }
2734
2764
  this.wssSendRestartRequired();
2765
+ param = param.split('@')[0];
2766
+ if (param === 'matterbridge') {
2767
+ res.json({ message: 'Command received' });
2768
+ return;
2769
+ }
2735
2770
  }
2736
2771
  if (command === 'addplugin' || command === 'installplugin') {
2737
2772
  param = param.replace(/\*/g, '\\');
@@ -9,7 +9,7 @@ import { copyDirectory, getParameter, hasParameter } from './utils/utils.js';
9
9
  import { DeviceTypeId, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, VendorId, EndpointServer } from '@matter/main';
10
10
  import { ServerNode, Endpoint as EndpointNode, Environment, StorageService } from '@matter/main';
11
11
  import { BasicInformationCluster } from '@matter/main/clusters';
12
- import { FabricAction, MdnsService } from '@matter/main/protocol';
12
+ import { FabricAction, MdnsService, PaseClient } from '@matter/main/protocol';
13
13
  import { GenericSwitchDevice } from '@matter/main/devices';
14
14
  import { AggregatorEndpoint } from '@matter/main/endpoints';
15
15
  import { BridgedDeviceBasicInformationServer, SwitchServer } from '@matter/main/behaviors';
@@ -49,8 +49,8 @@ export class MatterbridgeEdge extends Matterbridge {
49
49
  if (this.mdnsInterface)
50
50
  this.environment.vars.set('mdns.networkInterface', this.mdnsInterface);
51
51
  this.port = 5540;
52
- this.passcode = 20242025;
53
- this.discriminator = 3840;
52
+ this.passcode = PaseClient.generateRandomPasscode();
53
+ this.discriminator = PaseClient.generateRandomDiscriminator();
54
54
  }
55
55
  async startMatterStorage(storageType, storageName) {
56
56
  this.log.info(`Starting matter node storage...`);
@@ -81,6 +81,9 @@ 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;
85
+ this.matterbridgeInformation.matterDiscriminator = await this.nodeContext?.get('matterdiscriminator');
86
+ this.matterbridgeInformation.matterPasscode = await this.nodeContext?.get('matterpasscode');
84
87
  this.matterbridgeInformation.matterbridgePaired = this.matterbridgePaired;
85
88
  this.matterbridgeInformation.matterbridgeConnected = this.matterbridgeConnected;
86
89
  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.cb537856.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.cb537856.js.map": "./static/js/main.cb537856.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.cb537856.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.cb537856.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>