@matterbridge/core 3.7.6-dev-20260428-956dcc7 → 3.7.6-dev-20260429-f05fd2a

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.
@@ -3,7 +3,7 @@ import { BroadcastServer } from '@matterbridge/thread';
3
3
  import { hasParameter } from '@matterbridge/utils/cli';
4
4
  import { inspectError } from '@matterbridge/utils/error';
5
5
  import { isValidNumber, isValidString } from '@matterbridge/utils/validate';
6
- import { withTimeout } from '@matterbridge/utils/wait';
6
+ import { fireAndForget, withTimeout } from '@matterbridge/utils/wait';
7
7
  import { AnsiLogger, CYAN, debugStringify, nf } from 'node-ansi-logger';
8
8
  import { WebSocket, WebSocketServer } from 'ws';
9
9
  if (hasParameter('loader'))
@@ -63,7 +63,7 @@ export class BackendsWsServer {
63
63
  this.log.debug(`WebSocketServer logger global callback set to ${callbackLogLevel}`);
64
64
  websocket.on('message', (data) => {
65
65
  this.log.debug(`WebSocket client ${CYAN}${clientIp}${nf} sent a message`);
66
- this.wsMessageHandler(websocket, data);
66
+ fireAndForget(this.wsMessageHandler(websocket, data), this.log, `Error handling message from WebSocket client ${clientIp}`);
67
67
  });
68
68
  websocket.on('ping', () => {
69
69
  this.log.debug(`WebSocket client ${CYAN}${clientIp}${nf} ping received`);
@@ -21,7 +21,7 @@ export class BatteryStorage extends MatterbridgeEndpoint {
21
21
  .createDefaultDeviceEnergyManagementClusterServer(DeviceEnergyManagement.EsaType.BatteryStorage, true, DeviceEnergyManagement.EsaState.Online, absMinPower, absMaxPower)
22
22
  .createDefaultDeviceEnergyManagementModeClusterServer()
23
23
  .addRequiredClusterServers();
24
- this.addFixedLabel('composed', 'Battery Storage');
24
+ void this.addFixedLabel('composed', 'Battery Storage').catch(() => { });
25
25
  const battery = this.addChildDeviceType('Battery', [powerSource, electricalSensor], {
26
26
  tagList: [getSemtag(PowerSourceTag.Battery)],
27
27
  })
@@ -8,7 +8,7 @@ export class Cooktop extends MatterbridgeEndpoint {
8
8
  this.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Cooktop');
9
9
  this.createDefaultPowerSourceWiredClusterServer();
10
10
  this.createOffOnlyOnOffClusterServer(true);
11
- this.addFixedLabel('composed', 'Cooktop');
11
+ void this.addFixedLabel('composed', 'Cooktop').catch(() => { });
12
12
  }
13
13
  addSurface(name, tagList, selectedTemperatureLevel = 2, supportedTemperatureLevels = ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5']) {
14
14
  const surface = this.addChildDeviceType(name, cookSurface, { tagList });
@@ -16,7 +16,7 @@ export class Evse extends MatterbridgeEndpoint {
16
16
  .createDefaultEnergyEvseModeClusterServer(currentMode, supportedModes)
17
17
  .createDefaultTemperatureMeasurementClusterServer(24_00)
18
18
  .addRequiredClusterServers();
19
- this.addFixedLabel('composed', 'EVSE');
19
+ void this.addFixedLabel('composed', 'EVSE').catch(() => { });
20
20
  this.addChildDeviceType('PowerSource', powerSource).createDefaultPowerSourceWiredClusterServer().addRequiredClusterServers();
21
21
  this.addChildDeviceType('ElectricalSensor', electricalSensor)
22
22
  .createDefaultPowerTopologyClusterServer()
@@ -10,26 +10,26 @@ export class ExtractorHood extends MatterbridgeEndpoint {
10
10
  this.createBaseFanControlClusterServer();
11
11
  this.createDefaultHepaFilterMonitoringClusterServer(hepaCondition, hepaChangeIndication, hepaInPlaceIndicator, hepaLastChangedTime, hepaReplacementProductList);
12
12
  this.createDefaultActivatedCarbonFilterMonitoringClusterServer(activatedCarbonCondition, activatedCarbonChangeIndication, activatedCarbonInPlaceIndicator, activatedCarbonLastChangedTime, activatedCarbonReplacementProductList);
13
- this.subscribeAttribute('fanControl', 'fanMode', (newValue, oldValue, context) => {
13
+ void this.subscribeAttribute('fanControl', 'fanMode', (newValue, oldValue, context) => {
14
14
  if (context.offline === true)
15
15
  return;
16
16
  this.log.info(`Fan control fanMode attribute changed: ${newValue}`);
17
- });
18
- this.subscribeAttribute('fanControl', 'percentSetting', (newValue, oldValue, context) => {
17
+ }).catch(() => { });
18
+ void this.subscribeAttribute('fanControl', 'percentSetting', (newValue, oldValue, context) => {
19
19
  if (context.offline === true)
20
20
  return;
21
21
  this.log.info(`Fan control percentSetting attribute changed: ${newValue}`);
22
- this.setAttribute('fanControl', 'percentCurrent', newValue, this.log);
23
- });
24
- this.subscribeAttribute('hepaFilterMonitoring', 'lastChangedTime', (newValue, oldValue, context) => {
22
+ void this.setAttribute('fanControl', 'percentCurrent', newValue, this.log).catch(() => { });
23
+ }).catch(() => { });
24
+ void this.subscribeAttribute('hepaFilterMonitoring', 'lastChangedTime', (newValue, oldValue, context) => {
25
25
  if (context.offline === true)
26
26
  return;
27
27
  this.log.info(`Hepa filter monitoring lastChangedTime attribute changed: ${newValue}`);
28
- });
29
- this.subscribeAttribute('activatedCarbonFilterMonitoring', 'lastChangedTime', (newValue, oldValue, context) => {
28
+ }).catch(() => { });
29
+ void this.subscribeAttribute('activatedCarbonFilterMonitoring', 'lastChangedTime', (newValue, oldValue, context) => {
30
30
  if (context.offline === true)
31
31
  return;
32
32
  this.log.info(`Activated carbon filter monitoring lastChangedTime attribute changed: ${newValue}`);
33
- });
33
+ }).catch(() => { });
34
34
  }
35
35
  }
@@ -33,12 +33,14 @@ export class HeatPump extends MatterbridgeEndpoint {
33
33
  })
34
34
  .createDefaultThermostatClusterServer()
35
35
  .addRequiredClusterServers()
36
- .addUserLabel('room', 'Living Room');
36
+ .addUserLabel('room', 'Living Room')
37
+ .catch(() => { });
37
38
  this.addChildDeviceType('BedroomThermostat', thermostatDevice, {
38
39
  tagList: [getSemtag(NumberTag.Two, 'BedroomThermostat'), getSemtag(AreaNamespaceTag.Bedroom)],
39
40
  })
40
41
  .createDefaultThermostatClusterServer()
41
42
  .addRequiredClusterServers()
42
- .addUserLabel('room', 'Bedroom');
43
+ .addUserLabel('room', 'Bedroom')
44
+ .catch(() => { });
43
45
  }
44
46
  }
@@ -13,7 +13,7 @@ export class Oven extends MatterbridgeEndpoint {
13
13
  this.createDefaultIdentifyClusterServer();
14
14
  this.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Oven');
15
15
  this.createDefaultPowerSourceWiredClusterServer();
16
- this.addFixedLabel('composed', 'Oven');
16
+ void this.addFixedLabel('composed', 'Oven').catch(() => { });
17
17
  }
18
18
  addCabinet(name, tagList, currentMode = 2, supportedModes = [
19
19
  { label: 'Bake', mode: 1, modeTags: [{ value: OvenMode.ModeTag.Bake }] },
@@ -16,7 +16,7 @@ export class Refrigerator extends MatterbridgeEndpoint {
16
16
  this.createDefaultIdentifyClusterServer();
17
17
  this.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Refrigerator');
18
18
  this.createDefaultPowerSourceWiredClusterServer();
19
- this.addFixedLabel('composed', 'Refrigerator');
19
+ void this.addFixedLabel('composed', 'Refrigerator').catch(() => { });
20
20
  this.createDefaultRefrigeratorAndTemperatureControlledCabinetModeClusterServer(this, currentMode, supportedModes);
21
21
  this.createDefaultRefrigeratorAlarmClusterServer(this, false);
22
22
  }
@@ -27,7 +27,7 @@ export class SolarPower extends MatterbridgeEndpoint {
27
27
  .createDefaultElectricalPowerMeasurementClusterServer(voltage, current, power)
28
28
  .createDefaultElectricalEnergyMeasurementClusterServer(0, energyExported)
29
29
  .addRequiredClusterServers();
30
- panel.addUserLabel('panel', name.slice(0, 16));
30
+ void panel.addUserLabel('panel', name.slice(0, 16)).catch(() => { });
31
31
  return panel;
32
32
  }
33
33
  }
@@ -15,7 +15,7 @@ export class WaterHeater extends MatterbridgeEndpoint {
15
15
  .createDefaultHeatingThermostatClusterServer(waterTemperature, targetWaterTemperature, minHeatSetpointLimit, maxHeatSetpointLimit)
16
16
  .createDefaultWaterHeaterManagementClusterServer(heaterTypes, {}, tankPercentage)
17
17
  .createDefaultWaterHeaterModeClusterServer();
18
- this.addFixedLabel('composed', 'Water Heater');
18
+ void this.addFixedLabel('composed', 'Water Heater').catch(() => { });
19
19
  this.addChildDeviceType('PowerSource', powerSource).createDefaultPowerSourceWiredClusterServer().addRequiredClusterServers();
20
20
  this.addChildDeviceType('ElectricalSensor', electricalSensor)
21
21
  .createDefaultPowerTopologyClusterServer()
package/dist/frontend.js CHANGED
@@ -13,7 +13,7 @@ import { getParameter, hasParameter } from '@matterbridge/utils/cli';
13
13
  import { inspectError } from '@matterbridge/utils/error';
14
14
  import { formatBytes, formatPercent, formatUptime } from '@matterbridge/utils/format';
15
15
  import { isValidArray, isValidBoolean, isValidNumber, isValidObject, isValidString } from '@matterbridge/utils/validate';
16
- import { wait, withTimeout } from '@matterbridge/utils/wait';
16
+ import { fireAndForget, wait, withTimeout } from '@matterbridge/utils/wait';
17
17
  import { AnsiLogger, CYAN, db, debugStringify, er, nf, nt, rs, stringify, UNDERLINE, UNDERLINEOFF, YELLOW } from 'node-ansi-logger';
18
18
  import { cliEmitter, lastOsCpuUsage, lastProcessCpuUsage } from './cliEmitter.js';
19
19
  import { generateHistoryPage } from './cliHistory.js';
@@ -210,7 +210,7 @@ export class Frontend extends EventEmitter {
210
210
  this.log.debug(`WebSocketServer logger global callback set to ${callbackLogLevel}`);
211
211
  this.log.info(`WebSocketServer client "${clientIp}" connected to Matterbridge`);
212
212
  ws.on('message', (message) => {
213
- this.wsMessageHandler(ws, message);
213
+ fireAndForget(this.wsMessageHandler(ws, message), this.log, `Error handling message from WebSocket client ${clientIp}`);
214
214
  });
215
215
  ws.on('ping', () => {
216
216
  this.log.debug('WebSocket client ping received');
@@ -1454,7 +1454,7 @@ export class Frontend extends EventEmitter {
1454
1454
  this.log.info(`Saving config for plugin ${plg}${data.params.pluginName}${nf}...`);
1455
1455
  const plugin = this.matterbridge.plugins.get(data.params.pluginName);
1456
1456
  if (plugin) {
1457
- this.matterbridge.plugins.saveConfigFromJson(plugin, data.params.formData, true);
1457
+ fireAndForget(this.matterbridge.plugins.saveConfigFromJson(plugin, data.params.formData, true), this.log, `Save config for plugin ${plugin.name}`);
1458
1458
  this.wssSendSnackbarMessage(`Saved config for plugin ${data.params.pluginName}`);
1459
1459
  this.wssSendRestartRequired();
1460
1460
  sendResponse({ id: data.id, method: data.method, src: 'Matterbridge', dst: data.src, success: true });
package/dist/helpers.js CHANGED
@@ -45,14 +45,8 @@ export async function addVirtualDevice(aggregatorEndpoint, name, type, callback)
45
45
  });
46
46
  device.events.onOff.onOff$Changed.on((value) => {
47
47
  if (value) {
48
- callback();
49
- process.nextTick(async () => {
50
- try {
51
- await device.setStateOf(OnOffServer, { onOff: false });
52
- }
53
- catch (_error) {
54
- }
55
- });
48
+ void callback().catch(() => { });
49
+ void device.setStateOf(OnOffServer, { onOff: false }).catch(() => { });
56
50
  }
57
51
  });
58
52
  await aggregatorEndpoint.add(device);
@@ -1428,7 +1428,7 @@ export class Matterbridge extends EventEmitter {
1428
1428
  this.reachabilityTimeout = setTimeout(() => {
1429
1429
  this.log.info(`Setting reachability to true for ${plg}Matterbridge${db}`);
1430
1430
  if (this.aggregatorNode)
1431
- this.setAggregatorReachability(this.aggregatorNode, true);
1431
+ fireAndForget(this.setAggregatorReachability(this.aggregatorNode, true), this.log, `Set aggregator node reachability for Matterbridge`);
1432
1432
  }, 60 * 1000).unref();
1433
1433
  this.emit('bridge_started');
1434
1434
  this.log.notice('Matterbridge bridge started successfully');
@@ -1447,7 +1447,7 @@ export class Matterbridge extends EventEmitter {
1447
1447
  for (const plugin of this.plugins.array().filter((p) => p.enabled && !p.error)) {
1448
1448
  if (plugin.type === 'DynamicPlatform')
1449
1449
  await this.createDynamicPlugin(plugin);
1450
- this.plugins.start(plugin, 'Matterbridge is starting');
1450
+ fireAndForget(this.plugins.start(plugin, 'Matterbridge is starting'), this.log, `Start plugin ${plugin.name} in childbridge mode`);
1451
1451
  }
1452
1452
  this.log.debug('Starting start matter interval in childbridge mode...');
1453
1453
  this.frontend.wssSendSnackbarMessage(`The bridge is starting...`, 0, 'info');
@@ -1532,7 +1532,7 @@ export class Matterbridge extends EventEmitter {
1532
1532
  plugin.reachabilityTimeout = setTimeout(() => {
1533
1533
  this.log.info(`Setting reachability to true for ${plg}${plugin.name}${nf}`);
1534
1534
  if (plugin.type === 'DynamicPlatform' && plugin.aggregatorNode)
1535
- this.setAggregatorReachability(plugin.aggregatorNode, true);
1535
+ fireAndForget(this.setAggregatorReachability(plugin.aggregatorNode, true), this.log, `Set aggregator node reachability for plugin ${plugin.name}`);
1536
1536
  }, 60 * 1000).unref();
1537
1537
  }
1538
1538
  for (const device of this.devices.array()) {
@@ -335,12 +335,7 @@ export class MatterbridgeEndpoint extends Endpoint {
335
335
  return child;
336
336
  if (this.lifecycle.isInstalled) {
337
337
  this.log.debug(`- with lifecycle installed`);
338
- try {
339
- this.add(child);
340
- }
341
- catch (error) {
342
- inspectError(this.log, `addChildDeviceType: error adding (with lifecycle installed) child endpoint ${CYAN}${endpointName}${db}`, error);
343
- }
338
+ void this.add(child).catch((error) => { inspectError(this.log, `addChildDeviceType: error adding (with lifecycle installed) child endpoint ${CYAN}${endpointName}${db}`, error); });
344
339
  }
345
340
  else {
346
341
  this.log.debug(`- with lifecycle NOT installed`);
@@ -407,12 +402,7 @@ export class MatterbridgeEndpoint extends Endpoint {
407
402
  return child;
408
403
  if (this.lifecycle.isInstalled) {
409
404
  this.log.debug(`- with lifecycle installed`);
410
- try {
411
- this.add(child);
412
- }
413
- catch (error) {
414
- inspectError(this.log, `addChildDeviceType: error adding (with lifecycle installed) child endpoint ${CYAN}${endpointName}${db}`, error);
415
- }
405
+ void this.add(child).catch((error) => { inspectError(this.log, `addChildDeviceTypeWithClusterServer: error adding (with lifecycle installed) child endpoint ${CYAN}${endpointName}${db}`, error); });
416
406
  }
417
407
  else {
418
408
  this.log.debug(`- with lifecycle NOT installed`);
@@ -420,7 +410,7 @@ export class MatterbridgeEndpoint extends Endpoint {
420
410
  this.parts.add(child);
421
411
  }
422
412
  catch (error) {
423
- inspectError(this.log, `addChildDeviceType: error adding (with lifecycle NOT installed) child endpoint ${CYAN}${endpointName}${db}`, error);
413
+ inspectError(this.log, `addChildDeviceTypeWithClusterServer: error adding (with lifecycle NOT installed) child endpoint ${CYAN}${endpointName}${db}`, error);
424
414
  }
425
415
  }
426
416
  return child;
@@ -6,6 +6,7 @@ import { Descriptor } from '@matter/types/clusters/descriptor';
6
6
  import { BroadcastServer } from '@matterbridge/thread/server';
7
7
  import { hasParameter } from '@matterbridge/utils/cli';
8
8
  import { isValidArray, isValidObject, isValidString } from '@matterbridge/utils/validate';
9
+ import { fireAndForget } from '@matterbridge/utils/wait';
9
10
  import { CYAN, db, er, nf, wr } from 'node-ansi-logger';
10
11
  import { NodeStorageManager } from 'node-persist-manager';
11
12
  import { bridgedNode } from './matterbridgeDeviceTypes.js';
@@ -353,7 +354,7 @@ export class MatterbridgePlatform {
353
354
  };
354
355
  if (!compareVersions(this.matterbridge.matterbridgeVersion, requiredVersion)) {
355
356
  if (destroy)
356
- this.destroy();
357
+ fireAndForget(this.destroy(), this.log, `Destroy platform due to incompatible Matterbridge version`);
357
358
  return false;
358
359
  }
359
360
  return true;
@@ -5,6 +5,7 @@ import { BroadcastServer } from '@matterbridge/thread/server';
5
5
  import { plg, typ } from '@matterbridge/types';
6
6
  import { hasParameter } from '@matterbridge/utils/cli';
7
7
  import { inspectError, logError } from '@matterbridge/utils/error';
8
+ import { fireAndForget } from '@matterbridge/utils/wait';
8
9
  import { AnsiLogger, BLUE, CYAN, db, debugStringify, er, nf, nt, rs, UNDERLINE, UNDERLINEOFF, wr } from 'node-ansi-logger';
9
10
  import { isMatterbridgeAccessoryPlatform } from './matterbridgeAccessoryPlatform.js';
10
11
  import { isMatterbridgeDynamicPlatform } from './matterbridgeDynamicPlatform.js';
@@ -232,7 +233,7 @@ export class PluginManager extends EventEmitter {
232
233
  {
233
234
  const plugin = this.get(msg.params.name);
234
235
  if (plugin) {
235
- this.saveConfigFromJson(plugin, msg.params.config, msg.params.restartRequired);
236
+ fireAndForget(this.saveConfigFromJson(plugin, msg.params.config, msg.params.restartRequired), this.log, `Save config for plugin ${plugin.name}`);
236
237
  this.server.respond({ ...msg, result: { success: true } });
237
238
  }
238
239
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matterbridge/core",
3
- "version": "3.7.6-dev-20260428-956dcc7",
3
+ "version": "3.7.6-dev-20260429-f05fd2a",
4
4
  "description": "Matterbridge core library",
5
5
  "author": "https://github.com/Luligu",
6
6
  "homepage": "https://matterbridge.io/",
@@ -130,10 +130,10 @@
130
130
  ],
131
131
  "dependencies": {
132
132
  "@matter/main": "0.16.11",
133
- "@matterbridge/dgram": "3.7.6-dev-20260428-956dcc7",
134
- "@matterbridge/thread": "3.7.6-dev-20260428-956dcc7",
135
- "@matterbridge/types": "3.7.6-dev-20260428-956dcc7",
136
- "@matterbridge/utils": "3.7.6-dev-20260428-956dcc7",
133
+ "@matterbridge/dgram": "3.7.6-dev-20260429-f05fd2a",
134
+ "@matterbridge/thread": "3.7.6-dev-20260429-f05fd2a",
135
+ "@matterbridge/types": "3.7.6-dev-20260429-f05fd2a",
136
+ "@matterbridge/utils": "3.7.6-dev-20260429-f05fd2a",
137
137
  "escape-html": "1.0.3",
138
138
  "express": "5.2.1",
139
139
  "express-rate-limit": "8.4.1",