matterbridge 2.2.0-dev.1 → 2.2.0-dev.3

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
@@ -41,11 +41,12 @@ matterbridge-hass v. 0.0.8
41
41
  - [platform]: Saving in the storage the selects for faster loading of plugins.
42
42
  - [icon]: Added matterbridge svg icon (thanks: https://github.com/robvanoostenrijk https://github.com/stuntguy3000).
43
43
  - [pluginManager]: Refactor PluginManager to optimize memory and load time.
44
- - [frontend]: Frontend v.2.4.3. Please refresh the frontend page after the update.
44
+ - [frontend]: Frontend v.2.4.5. Please refresh the frontend page after the update.
45
45
  - [frontend]: Added processUptime.
46
46
  - [frontend]: Added Share fabrics and Stop sharing to the menu. This allows to pair other controllers without the need to share from the first controller.
47
47
  - [frontend]: Added subscriptions to QRDiv.
48
48
  - [utils]: Optimized memory and loading time.
49
+ - [shelly]: Added all shelly api to be used when matterbridge is running on the shelly matterbridge board.
49
50
 
50
51
  ### Changed
51
52
 
@@ -55,6 +56,8 @@ matterbridge-hass v. 0.0.8
55
56
  - [package]: Update matter.js to 0.12.4-alpha.0-20250217-b0bba5179
56
57
  - [package]: Update matter.js to 0.12.4-alpha.0-20250223-1e0341a1a
57
58
  - [package]: Update matter.js to 0.12.4-alpha.0-20250224-46934b522
59
+ - [package]: Update matter.js to 0.12.4-alpha.0-20250225-52ac4166b
60
+ - [matterbridge]: The check for available updates now runs at restart and each 24 hours after.
58
61
 
59
62
  ### Fixed
60
63
 
package/dist/frontend.js CHANGED
@@ -1094,6 +1094,11 @@ export class Frontend {
1094
1094
  triggerShellyChangeNet(this.matterbridge, data.params);
1095
1095
  return;
1096
1096
  }
1097
+ else if (data.method === '/api/reboot') {
1098
+ const { triggerShellyReboot } = await import('./shelly.js');
1099
+ triggerShellyReboot(this.matterbridge);
1100
+ return;
1101
+ }
1097
1102
  else if (data.method === '/api/restart') {
1098
1103
  this.wssSendSnackbarMessage(`Restarting matterbridge...`, 0);
1099
1104
  await this.matterbridge.restartProcess();
@@ -14,9 +14,7 @@ import { Frontend } from './frontend.js';
14
14
  import { DeviceTypeId, Endpoint as EndpointNode, Logger, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, VendorId, StorageService, Environment, ServerNode } from '@matter/main';
15
15
  import { DeviceCommissioner, FabricAction, MdnsService, PaseClient } from '@matter/main/protocol';
16
16
  import { AggregatorEndpoint } from '@matter/main/endpoints';
17
- import { BasicInformationServer } from '@matter/main/behaviors/basic-information';
18
- import { BridgedDeviceBasicInformation } from '@matter/main/clusters/bridged-device-basic-information';
19
- import { BasicInformation } from '@matter/main/clusters/basic-information';
17
+ import { BridgedDeviceBasicInformationServer } from '@matter/main/behaviors/bridged-device-basic-information';
20
18
  const plg = '\u001B[38;5;33m';
21
19
  const dev = '\u001B[38;5;79m';
22
20
  const typ = '\u001B[38;5;207m';
@@ -1092,6 +1090,7 @@ export class Matterbridge extends EventEmitter {
1092
1090
  async createAccessoryPlugin(plugin, device, start = false) {
1093
1091
  if (!plugin.locked && device.deviceName && device.vendorId && device.productId && device.vendorName && device.productName) {
1094
1092
  plugin.locked = true;
1093
+ plugin.device = device;
1095
1094
  plugin.storageContext = await this.createServerNodeContext(plugin.name, device.deviceName, DeviceTypeId(device.deviceType), device.vendorId, device.vendorName, device.productId, device.productName);
1096
1095
  plugin.serverNode = await this.createServerNode(plugin.storageContext, this.port ? this.port++ : undefined, this.passcode ? this.passcode++ : undefined, this.discriminator ? this.discriminator++ : undefined);
1097
1096
  this.log.debug(`Adding ${plg}${plugin.name}${db}:${dev}${device.deviceName}${db} to ${plg}${plugin.name}${db} server node`);
@@ -1165,8 +1164,6 @@ export class Matterbridge extends EventEmitter {
1165
1164
  }, 30 * 1000);
1166
1165
  this.reachabilityTimeout = setTimeout(() => {
1167
1166
  this.log.info(`Setting reachability to true for ${plg}Matterbridge${db}`);
1168
- if (this.serverNode)
1169
- this.setServerNodeReachability(this.serverNode, true);
1170
1167
  if (this.aggregatorNode)
1171
1168
  this.setAggregatorReachability(this.aggregatorNode, true);
1172
1169
  this.frontend.wssSendRefreshRequired();
@@ -1251,11 +1248,7 @@ export class Matterbridge extends EventEmitter {
1251
1248
  }
1252
1249
  this.startServerNode(plugin.serverNode);
1253
1250
  plugin.reachabilityTimeout = setTimeout(() => {
1254
- this.log.info(`Setting reachability to true for ${plg}${plugin.name}${db}`);
1255
- if (plugin.serverNode)
1256
- this.setServerNodeReachability(plugin.serverNode, true);
1257
- if (plugin.type === 'AccessoryPlatform' && plugin.device)
1258
- this.setDeviceReachability(plugin.device, true);
1251
+ this.log.info(`Setting reachability to true for ${plg}${plugin.name}${db} type ${plugin.type} server node ${plugin.serverNode !== undefined} aggragator node ${plugin.aggregatorNode !== undefined} device ${plugin.device !== undefined}`);
1259
1252
  if (plugin.type === 'DynamicPlatform' && plugin.aggregatorNode)
1260
1253
  this.setAggregatorReachability(plugin.aggregatorNode, true);
1261
1254
  this.frontend.wssSendRefreshRequired();
@@ -1650,19 +1643,13 @@ export class Matterbridge extends EventEmitter {
1650
1643
  };
1651
1644
  });
1652
1645
  }
1653
- async setServerNodeReachability(serverNode, reachable) {
1654
- await serverNode.setStateOf(BasicInformationServer, { reachable });
1655
- }
1656
1646
  async setAggregatorReachability(aggregatorNode, reachable) {
1657
1647
  for (const child of aggregatorNode.parts) {
1658
- await child.setAttribute(BridgedDeviceBasicInformation.Cluster.id, 'reachable', reachable);
1659
- await child.triggerEvent(BridgedDeviceBasicInformation.Cluster.id, 'reachableChanged', { reachableNewValue: reachable });
1648
+ this.log.debug(`Setting reachability of ${child?.deviceName} to ${reachable}`);
1649
+ await child.setStateOf(BridgedDeviceBasicInformationServer, { reachable });
1650
+ child.act((agent) => child.eventsOf(BridgedDeviceBasicInformationServer).reachableChanged.emit({ reachableNewValue: true }, agent.context));
1660
1651
  }
1661
1652
  }
1662
- async setDeviceReachability(device, reachable) {
1663
- await device.setAttribute(BasicInformation.Cluster.id, 'reachable', reachable);
1664
- await device.triggerEvent(BasicInformation.Cluster.id, 'reachableChanged', { reachableNewValue: reachable });
1665
- }
1666
1653
  getVendorIdName = (vendorId) => {
1667
1654
  if (!vendorId)
1668
1655
  return '';
package/dist/shelly.js CHANGED
@@ -88,6 +88,20 @@ export async function triggerShellyChangeIp(matterbridge, config) {
88
88
  matterbridge.frontend.wssSendSnackbarMessage('Changed Shelly network configuration');
89
89
  });
90
90
  }
91
+ export async function triggerShellyReboot(matterbridge) {
92
+ matterbridge.log.debug(`Triggering Shelly system reboot`);
93
+ postShelly('/api/system/reboot', {}, 60 * 1000)
94
+ .then(async () => {
95
+ matterbridge.log.debug(`Triggered Shelly system reboot`);
96
+ })
97
+ .catch((error) => {
98
+ matterbridge.log.debug(`****Error triggering Shelly system reboot: ${error instanceof Error ? error.message : error}`);
99
+ })
100
+ .finally(() => {
101
+ matterbridge.log.notice(`Rebooting Shelly board...`);
102
+ matterbridge.frontend.wssSendSnackbarMessage('Rebooting Shelly board...');
103
+ });
104
+ }
91
105
  async function getShelly(api, timeout = 60000) {
92
106
  const http = await import('node:http');
93
107
  return new Promise((resolve, reject) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.cf25d33e.css",
4
- "main.js": "./static/js/main.fed77626.js",
4
+ "main.js": "./static/js/main.a462621b.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.cf25d33e.css.map": "./static/css/main.cf25d33e.css.map",
64
- "main.fed77626.js.map": "./static/js/main.fed77626.js.map",
64
+ "main.a462621b.js.map": "./static/js/main.a462621b.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.cf25d33e.css",
69
- "static/js/main.fed77626.js"
69
+ "static/js/main.a462621b.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.fed77626.js"></script><link href="./static/css/main.cf25d33e.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.a462621b.js"></script><link href="./static/css/main.cf25d33e.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>