matterbridge 2.2.6-dev.1 → 2.2.6-dev.2

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
@@ -39,13 +39,14 @@ Features:
39
39
 
40
40
  ### Changed
41
41
 
42
+ - [commissionig]: If the bridge is not paired, when the advertising stops (after 15 minutes from start) the QR code is hidden and a notification is displayed.
42
43
  - [package]: Update dependencies.
43
44
  - [package]: Update matter.js to 0.12.6.
44
45
 
45
46
  ### Fixed
46
47
 
47
48
  - [ipv6address]: The ipv6address can be entered in the frontend with the scopeid. On Windows the format is ipv6%scopeid (i.e. fe80::5a71:b2f6:7bc8:d00b%8). On Linux the format is ipv6%interfaceName (i.e. fe80::5a71:b2f6:7bc8:d00b%eth0)
48
- - [onOff]: The onOff cluster created from createOnOffClusterServer() is not correct (no Lighting feature).
49
+ - [onOff]: The onOff cluster created from createOnOffClusterServer() is now correct (no Lighting feature).
49
50
 
50
51
  <a href="https://www.buymeacoffee.com/luligugithub">
51
52
  <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
@@ -1464,6 +1464,23 @@ export class Matterbridge extends EventEmitter {
1464
1464
  }
1465
1465
  }
1466
1466
  }
1467
+ setTimeout(() => {
1468
+ if (this.bridgeMode === 'bridge') {
1469
+ this.matterbridgeQrPairingCode = undefined;
1470
+ this.matterbridgeManualPairingCode = undefined;
1471
+ }
1472
+ if (this.bridgeMode === 'childbridge') {
1473
+ const plugin = this.plugins.get(storeId);
1474
+ if (plugin) {
1475
+ plugin.qrPairingCode = undefined;
1476
+ plugin.manualPairingCode = undefined;
1477
+ this.frontend.wssSendRefreshRequired('plugins');
1478
+ }
1479
+ }
1480
+ this.frontend.wssSendRefreshRequired('settings');
1481
+ this.frontend.wssSendSnackbarMessage(`Advertising on server node for ${storeId} stopped. Restart to commission.`, 0);
1482
+ this.log.notice(`Advertising on server node for ${storeId} stopped. Restart to commission.`);
1483
+ }, 15 * 60 * 1000).unref();
1467
1484
  }
1468
1485
  else {
1469
1486
  this.log.notice(`Server node for ${storeId} is already commissioned. Waiting for controllers to connect ...`);
@@ -843,34 +843,34 @@ export class MatterbridgeEndpoint extends Endpoint {
843
843
  return false;
844
844
  }
845
845
  if (event === 'Single') {
846
+ log?.info(`${db}Trigger endpoint ${or}${this.id}:${this.number}${db} event ${hk}Switch.SinglePress${db}`);
846
847
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 1, log);
847
- this.triggerEvent(Switch.Cluster.id, 'initialPress', { newPosition: 1 }, log);
848
+ await this.triggerEvent(Switch.Cluster.id, 'initialPress', { newPosition: 1 }, log);
848
849
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 0, log);
849
- this.triggerEvent(Switch.Cluster.id, 'shortRelease', { previousPosition: 1 }, log);
850
+ await this.triggerEvent(Switch.Cluster.id, 'shortRelease', { previousPosition: 1 }, log);
850
851
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 0, log);
851
- this.triggerEvent(Switch.Cluster.id, 'multiPressComplete', { previousPosition: 1, totalNumberOfPressesCounted: 1 }, log);
852
- log?.info(`${db}Trigger endpoint ${or}${this.id}:${this.number}${db} event ${hk}Switch.SinglePress${db}`);
852
+ await this.triggerEvent(Switch.Cluster.id, 'multiPressComplete', { previousPosition: 1, totalNumberOfPressesCounted: 1 }, log);
853
853
  }
854
854
  if (event === 'Double') {
855
+ log?.info(`${db}Trigger endpoint ${or}${this.id}:${this.number}${db} event ${hk}Switch.DoublePress${db}`);
855
856
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 1, log);
856
- this.triggerEvent(Switch.Cluster.id, 'initialPress', { newPosition: 1 }, log);
857
+ await this.triggerEvent(Switch.Cluster.id, 'initialPress', { newPosition: 1 }, log);
857
858
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 0, log);
858
- this.triggerEvent(Switch.Cluster.id, 'shortRelease', { previousPosition: 1 }, log);
859
+ await this.triggerEvent(Switch.Cluster.id, 'shortRelease', { previousPosition: 1 }, log);
859
860
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 1, log);
860
- this.triggerEvent(Switch.Cluster.id, 'initialPress', { newPosition: 1 }, log);
861
- this.triggerEvent(Switch.Cluster.id, 'multiPressOngoing', { newPosition: 1, currentNumberOfPressesCounted: 2 }, log);
861
+ await this.triggerEvent(Switch.Cluster.id, 'initialPress', { newPosition: 1 }, log);
862
+ await this.triggerEvent(Switch.Cluster.id, 'multiPressOngoing', { newPosition: 1, currentNumberOfPressesCounted: 2 }, log);
862
863
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 0, log);
863
- this.triggerEvent(Switch.Cluster.id, 'shortRelease', { previousPosition: 1 }, log);
864
- this.triggerEvent(Switch.Cluster.id, 'multiPressComplete', { previousPosition: 1, totalNumberOfPressesCounted: 2 }, log);
865
- log?.info(`${db}Trigger endpoint ${or}${this.id}:${this.number}${db} event ${hk}Switch.DoublePress${db}`);
864
+ await this.triggerEvent(Switch.Cluster.id, 'shortRelease', { previousPosition: 1 }, log);
865
+ await this.triggerEvent(Switch.Cluster.id, 'multiPressComplete', { previousPosition: 1, totalNumberOfPressesCounted: 2 }, log);
866
866
  }
867
867
  if (event === 'Long') {
868
+ log?.info(`${db}Trigger endpoint ${or}${this.id}:${this.number}${db} event ${hk}Switch.LongPress${db}`);
868
869
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 1, log);
869
- this.triggerEvent(Switch.Cluster.id, 'initialPress', { newPosition: 1 }, log);
870
- this.triggerEvent(Switch.Cluster.id, 'longPress', { newPosition: 1 }, log);
870
+ await this.triggerEvent(Switch.Cluster.id, 'initialPress', { newPosition: 1 }, log);
871
+ await this.triggerEvent(Switch.Cluster.id, 'longPress', { newPosition: 1 }, log);
871
872
  await this.setAttribute(Switch.Cluster.id, 'currentPosition', 0, log);
872
- this.triggerEvent(Switch.Cluster.id, 'longRelease', { previousPosition: 1 }, log);
873
- log?.info(`${db}Trigger endpoint ${or}${this.id}:${this.number}${db} event ${hk}Switch.LongPress${db}`);
873
+ await this.triggerEvent(Switch.Cluster.id, 'longRelease', { previousPosition: 1 }, log);
874
874
  }
875
875
  }
876
876
  if (['Press', 'Release'].includes(event)) {
@@ -879,14 +879,14 @@ export class MatterbridgeEndpoint extends Endpoint {
879
879
  return false;
880
880
  }
881
881
  if (event === 'Press') {
882
- await this.setAttribute(Switch.Cluster.id, 'currentPosition', 1, log);
883
- this.triggerEvent(Switch.Cluster.id, 'switchLatched', { newPosition: 1 }, log);
884
882
  log?.info(`${db}Trigger endpoint ${or}${this.id}:${this.number}${db} event ${hk}Switch.Press${db}`);
883
+ await this.setAttribute(Switch.Cluster.id, 'currentPosition', 1, log);
884
+ await this.triggerEvent(Switch.Cluster.id, 'switchLatched', { newPosition: 1 }, log);
885
885
  }
886
886
  if (event === 'Release') {
887
- await this.setAttribute(Switch.Cluster.id, 'currentPosition', 0, log);
888
- this.triggerEvent(Switch.Cluster.id, 'switchLatched', { newPosition: 0 }, log);
889
887
  log?.info(`${db}Trigger endpoint ${or}${this.id}:${this.number}${db} event ${hk}Switch.Release${db}`);
888
+ await this.setAttribute(Switch.Cluster.id, 'currentPosition', 0, log);
889
+ await this.triggerEvent(Switch.Cluster.id, 'switchLatched', { newPosition: 0 }, log);
890
890
  }
891
891
  }
892
892
  return true;
@@ -137,6 +137,10 @@ export class MatterbridgePlatform {
137
137
  this.selectEntity.clear();
138
138
  await this.saveSelects();
139
139
  }
140
+ async clearDeviceSelect(device) {
141
+ this.selectDevice.delete(device);
142
+ await this.saveSelects();
143
+ }
140
144
  setSelectDevice(serial, name, configUrl, icon, entities) {
141
145
  const device = this.selectDevice.get(serial);
142
146
  if (device) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "2.2.6-dev.1",
3
+ "version": "2.2.6-dev.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge",
9
- "version": "2.2.6-dev.1",
9
+ "version": "2.2.6-dev.2",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@matter/main": "0.12.6",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "2.2.6-dev.1",
3
+ "version": "2.2.6-dev.2",
4
4
  "description": "Matterbridge plugin manager for Matter",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",