matterbridge 3.0.0 → 3.0.1-dev-20250501-4f463f9

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.
Files changed (153) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +22 -4
  3. package/dist/cli.js +2 -37
  4. package/dist/cluster/export.js +0 -2
  5. package/dist/defaultConfigSchema.js +0 -23
  6. package/dist/deviceManager.js +1 -94
  7. package/dist/frontend.js +19 -352
  8. package/dist/index.js +1 -28
  9. package/dist/logger/export.js +0 -1
  10. package/dist/matter/behaviors.js +0 -2
  11. package/dist/matter/clusters.js +0 -2
  12. package/dist/matter/devices.js +0 -2
  13. package/dist/matter/endpoints.js +0 -2
  14. package/dist/matter/export.js +0 -2
  15. package/dist/matter/types.js +0 -2
  16. package/dist/matterbridge.js +46 -747
  17. package/dist/matterbridgeAccessoryPlatform.js +0 -34
  18. package/dist/matterbridgeBehaviors.js +1 -33
  19. package/dist/matterbridgeDeviceTypes.js +12 -431
  20. package/dist/matterbridgeDynamicPlatform.js +0 -34
  21. package/dist/matterbridgeEndpoint.js +11 -794
  22. package/dist/matterbridgeEndpointHelpers.js +9 -142
  23. package/dist/matterbridgePlatform.js +7 -225
  24. package/dist/matterbridgeTypes.js +0 -24
  25. package/dist/pluginManager.js +3 -262
  26. package/dist/shelly.js +6 -146
  27. package/dist/storage/export.js +0 -1
  28. package/dist/update.js +0 -52
  29. package/dist/utils/colorUtils.js +2 -205
  30. package/dist/utils/copyDirectory.js +1 -37
  31. package/dist/utils/createZip.js +2 -42
  32. package/dist/utils/deepCopy.js +0 -40
  33. package/dist/utils/deepEqual.js +1 -65
  34. package/dist/utils/export.js +0 -1
  35. package/dist/utils/isvalid.js +0 -86
  36. package/dist/utils/network.js +5 -76
  37. package/dist/utils/parameter.js +0 -53
  38. package/dist/utils/wait.js +5 -48
  39. package/frontend/build/asset-manifest.json +3 -3
  40. package/frontend/build/index.html +1 -1
  41. package/frontend/build/static/js/{main.1d983660.js → main.356788d7.js} +3 -3
  42. package/frontend/build/static/js/{main.1d983660.js.map → main.356788d7.js.map} +1 -1
  43. package/npm-shrinkwrap.json +2 -2
  44. package/package.json +1 -2
  45. package/dist/cli.d.ts +0 -29
  46. package/dist/cli.d.ts.map +0 -1
  47. package/dist/cli.js.map +0 -1
  48. package/dist/cluster/export.d.ts +0 -2
  49. package/dist/cluster/export.d.ts.map +0 -1
  50. package/dist/cluster/export.js.map +0 -1
  51. package/dist/defaultConfigSchema.d.ts +0 -27
  52. package/dist/defaultConfigSchema.d.ts.map +0 -1
  53. package/dist/defaultConfigSchema.js.map +0 -1
  54. package/dist/deviceManager.d.ts +0 -114
  55. package/dist/deviceManager.d.ts.map +0 -1
  56. package/dist/deviceManager.js.map +0 -1
  57. package/dist/frontend.d.ts +0 -222
  58. package/dist/frontend.d.ts.map +0 -1
  59. package/dist/frontend.js.map +0 -1
  60. package/dist/index.d.ts +0 -35
  61. package/dist/index.d.ts.map +0 -1
  62. package/dist/index.js.map +0 -1
  63. package/dist/logger/export.d.ts +0 -2
  64. package/dist/logger/export.d.ts.map +0 -1
  65. package/dist/logger/export.js.map +0 -1
  66. package/dist/matter/behaviors.d.ts +0 -2
  67. package/dist/matter/behaviors.d.ts.map +0 -1
  68. package/dist/matter/behaviors.js.map +0 -1
  69. package/dist/matter/clusters.d.ts +0 -2
  70. package/dist/matter/clusters.d.ts.map +0 -1
  71. package/dist/matter/clusters.js.map +0 -1
  72. package/dist/matter/devices.d.ts +0 -2
  73. package/dist/matter/devices.d.ts.map +0 -1
  74. package/dist/matter/devices.js.map +0 -1
  75. package/dist/matter/endpoints.d.ts +0 -2
  76. package/dist/matter/endpoints.d.ts.map +0 -1
  77. package/dist/matter/endpoints.js.map +0 -1
  78. package/dist/matter/export.d.ts +0 -5
  79. package/dist/matter/export.d.ts.map +0 -1
  80. package/dist/matter/export.js.map +0 -1
  81. package/dist/matter/types.d.ts +0 -3
  82. package/dist/matter/types.d.ts.map +0 -1
  83. package/dist/matter/types.js.map +0 -1
  84. package/dist/matterbridge.d.ts +0 -431
  85. package/dist/matterbridge.d.ts.map +0 -1
  86. package/dist/matterbridge.js.map +0 -1
  87. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -40
  88. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  89. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  90. package/dist/matterbridgeBehaviors.d.ts +0 -1514
  91. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  92. package/dist/matterbridgeBehaviors.js.map +0 -1
  93. package/dist/matterbridgeDeviceTypes.d.ts +0 -494
  94. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  95. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  96. package/dist/matterbridgeDynamicPlatform.d.ts +0 -40
  97. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  98. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  99. package/dist/matterbridgeEndpoint.d.ts +0 -943
  100. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  101. package/dist/matterbridgeEndpoint.js.map +0 -1
  102. package/dist/matterbridgeEndpointHelpers.d.ts +0 -2706
  103. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  104. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  105. package/dist/matterbridgePlatform.d.ts +0 -294
  106. package/dist/matterbridgePlatform.d.ts.map +0 -1
  107. package/dist/matterbridgePlatform.js.map +0 -1
  108. package/dist/matterbridgeTypes.d.ts +0 -187
  109. package/dist/matterbridgeTypes.d.ts.map +0 -1
  110. package/dist/matterbridgeTypes.js.map +0 -1
  111. package/dist/pluginManager.d.ts +0 -271
  112. package/dist/pluginManager.d.ts.map +0 -1
  113. package/dist/pluginManager.js.map +0 -1
  114. package/dist/shelly.d.ts +0 -92
  115. package/dist/shelly.d.ts.map +0 -1
  116. package/dist/shelly.js.map +0 -1
  117. package/dist/storage/export.d.ts +0 -2
  118. package/dist/storage/export.d.ts.map +0 -1
  119. package/dist/storage/export.js.map +0 -1
  120. package/dist/update.d.ts +0 -32
  121. package/dist/update.d.ts.map +0 -1
  122. package/dist/update.js.map +0 -1
  123. package/dist/utils/colorUtils.d.ts +0 -61
  124. package/dist/utils/colorUtils.d.ts.map +0 -1
  125. package/dist/utils/colorUtils.js.map +0 -1
  126. package/dist/utils/copyDirectory.d.ts +0 -32
  127. package/dist/utils/copyDirectory.d.ts.map +0 -1
  128. package/dist/utils/copyDirectory.js.map +0 -1
  129. package/dist/utils/createZip.d.ts +0 -38
  130. package/dist/utils/createZip.d.ts.map +0 -1
  131. package/dist/utils/createZip.js.map +0 -1
  132. package/dist/utils/deepCopy.d.ts +0 -31
  133. package/dist/utils/deepCopy.d.ts.map +0 -1
  134. package/dist/utils/deepCopy.js.map +0 -1
  135. package/dist/utils/deepEqual.d.ts +0 -53
  136. package/dist/utils/deepEqual.d.ts.map +0 -1
  137. package/dist/utils/deepEqual.js.map +0 -1
  138. package/dist/utils/export.d.ts +0 -10
  139. package/dist/utils/export.d.ts.map +0 -1
  140. package/dist/utils/export.js.map +0 -1
  141. package/dist/utils/isvalid.d.ts +0 -87
  142. package/dist/utils/isvalid.d.ts.map +0 -1
  143. package/dist/utils/isvalid.js.map +0 -1
  144. package/dist/utils/network.d.ts +0 -69
  145. package/dist/utils/network.d.ts.map +0 -1
  146. package/dist/utils/network.js.map +0 -1
  147. package/dist/utils/parameter.d.ts +0 -58
  148. package/dist/utils/parameter.d.ts.map +0 -1
  149. package/dist/utils/parameter.js.map +0 -1
  150. package/dist/utils/wait.d.ts +0 -43
  151. package/dist/utils/wait.d.ts.map +0 -1
  152. package/dist/utils/wait.js.map +0 -1
  153. /package/frontend/build/static/js/{main.1d983660.js.LICENSE.txt → main.356788d7.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -55,6 +55,8 @@ Modified clusters:
55
55
  - [frontend]: Added support for appliances and robot in IconView.
56
56
  - [parameter]: Added getIntArrayParameter and getStringArrayParameter.
57
57
  - [frontend]: Added the view menu to load the logs directly in the browser.
58
+ - [docker]: Optimized the dockerfiles and reduced the image size by 30%.
59
+ - [docker]: The builder for the docker image with tag latest will run each day at 00:00 UTC. Inside the image all plugins with the latest release (as published on npm) are already loaded. You can just pull the new image and matterbridge with all plugins will be the latest.
58
60
 
59
61
  ### Changed
60
62
 
package/README.md CHANGED
@@ -282,7 +282,7 @@ An Accessory platform plugin only exposes one device.
282
282
 
283
283
  This is an example of a dynamic platform plugin.
284
284
 
285
- It exposes:
285
+ It exposes 38 devices:
286
286
 
287
287
  - a switch with onOff cluster
288
288
  - a light with onOff
@@ -298,13 +298,31 @@ It exposes:
298
298
  and relativeHumidityMeasurement cluster (to show how to create a composed device with sub endpoints)
299
299
  - a thermo heat only with two external temperature sensors (tagged like Indoor and Outdoor)
300
300
  - a thermo cool only
301
- - an airConditioner device
302
- - an airPurifier device with temperature and humidity sensor (supported by Apple Home)
303
301
  - a fan with FanControl cluster
304
302
  - a rainSensor device
305
303
  - a waterFreezeDetector device
306
304
  - a waterLeakDetector device
307
- - a smokeCoAlarm device
305
+ - a smokeCoAlarm (with smoke and co features) sensor (supported by Apple Home)
306
+ - a smokeCoAlarm (with smoke only feature) sensor (supported by Apple Home)
307
+ - a smokeCoAlarm (with co only feature) sensor (supported by Apple Home)
308
+ - an airConditioner device
309
+ - an airPurifier device with temperature and humidity sensor (supported by Apple Home)
310
+ - a pumpDevice device
311
+ - a waterValve device
312
+ - an airQuality device with all concentration measurements clusters (supported by Apple Home only without the concentration measurements)
313
+ - a momentary switch
314
+ - a latching switch
315
+ - a Robot Vacuum Cleaner device (supported by SmartThings, Alexa, Home Assistant and partially by Apple Home). Read also https://github.com/Luligu/matterbridge/discussions/264.
316
+ - a onOff Mounted Switch device (supported by SmartThings, Alexa, Home Assistant)
317
+ - a dimmer Mounted Switch device (supported by SmartThings, Alexa, Home Assistant)
318
+ - a laundry Washer device (supported by SmartThings, Alexa and Home Assistant)
319
+ - a laundry Dryer device (supported by SmartThings, Alexa and Home Assistant)
320
+ - a dishwasher device (supported by SmartThings, Alexa and Home Assistant)
321
+ - a refrigerator device (supported by SmartThings, Alexa and Home Assistant)
322
+ - an oven device (supported by SmartThings, Alexa and Home Assistant)
323
+ - a microwave Oven device (supported by SmartThings, Alexa and Home Assistant)
324
+ - an extractor Hood device (supported by SmartThings, Alexa and Home Assistant)
325
+ - a cooktop device (supported by SmartThings, Alexa and Home Assistant)
308
326
 
309
327
  All these virtual devices continuously change state and position. The plugin also shows how to use all the command handlers (you can control all the devices).
310
328
 
package/dist/cli.js CHANGED
@@ -1,44 +1,18 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * This file contains the CLI entry point of Matterbridge.
4
- *
5
- * @file cli.ts
6
- * @author Luca Liguori
7
- * @date 2023-12-29
8
- * @version 2.0.0
9
- *
10
- * Copyright 2023, 2024, 2025 Luca Liguori.
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License. *
23
- */
24
- // Matterbridge
25
2
  import { Matterbridge } from './matterbridge.js';
26
3
  import { getIntParameter, hasParameter } from './utils/export.js';
27
- // AnsiLogger module
28
4
  import { AnsiLogger, BRIGHT, CYAN, db, YELLOW } from './logger/export.js';
29
5
  import { EventEmitter } from 'node:events';
30
6
  import { inspect } from 'node:util';
31
7
  export const cliEmitter = new EventEmitter();
32
8
  export let instance;
33
- // Inspectop
34
9
  let session;
35
- // Cpu and memory check
36
10
  let memoryCheckInterval;
37
11
  let prevCpus;
38
12
  export let lastCpuUsage = 0;
39
13
  let peakCpu = 0;
40
14
  let peakRss = 0;
41
- const log = new AnsiLogger({ logName: 'Cli', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: hasParameter('debug') ? "debug" /* LogLevel.DEBUG */ : "info" /* LogLevel.INFO */ });
15
+ const log = new AnsiLogger({ logName: 'Cli', logTimestampFormat: 4, logLevel: hasParameter('debug') ? "debug" : "info" });
42
16
  const formatMemoryUsage = (bytes) => {
43
17
  if (bytes >= 1024 ** 3) {
44
18
  return `${(bytes / 1024 ** 3).toFixed(2)} GB`;
@@ -71,11 +45,9 @@ async function startCpuMemoryCheck() {
71
45
  prevCpus = os.cpus();
72
46
  clearInterval(memoryCheckInterval);
73
47
  const interval = () => {
74
- // Get the os uptime
75
48
  const systemUptime = formatOsUpTime(Math.floor(os.uptime()));
76
49
  const processUptime = formatOsUpTime(Math.floor(process.uptime()));
77
50
  cliEmitter.emit('uptime', systemUptime, processUptime);
78
- // Get the memory usage
79
51
  const totalMememory = formatMemoryUsage(os.totalmem());
80
52
  const freeMemory = formatMemoryUsage(os.freemem());
81
53
  const memoryUsageRaw = process.memoryUsage();
@@ -87,11 +59,10 @@ async function startCpuMemoryCheck() {
87
59
  if (memoryUsageRaw.rss > peakRss)
88
60
  peakRss = memoryUsageRaw.rss;
89
61
  cliEmitter.emit('memory', totalMememory, freeMemory, rss, heapTotal, heapUsed, external, arrayBuffers);
90
- // Get the cpu usage
91
62
  const currCpus = os.cpus();
92
63
  let cpuUsageLog;
93
64
  if (currCpus.length !== prevCpus.length) {
94
- prevCpus = currCpus; // Reset the previous cpus
65
+ prevCpus = currCpus;
95
66
  log.debug(`Cpu check length failed, resetting previous cpus`);
96
67
  return;
97
68
  }
@@ -117,7 +88,6 @@ async function startCpuMemoryCheck() {
117
88
  cliEmitter.emit('cpu', lastCpuUsage);
118
89
  }
119
90
  prevCpus = currCpus;
120
- // Show the cpu and memory usage
121
91
  log.debug(`***${YELLOW}${BRIGHT}Cpu usage:${db} ${CYAN}${cpuUsageLog.padStart(6, ' ')} %${db} ${YELLOW}${BRIGHT}Memory usage:${db} rss ${CYAN}${rss}${db} heapTotal ${CYAN}${heapTotal}${db} heapUsed ${CYAN}${heapUsed}${db} external ${external} arrayBuffers ${arrayBuffers}`);
122
92
  };
123
93
  interval();
@@ -145,7 +115,6 @@ async function stopInspector() {
145
115
  return;
146
116
  }
147
117
  try {
148
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
149
118
  const result = await new Promise((resolve, reject) => {
150
119
  session?.post('HeapProfiler.stopSampling', (err, result) => (err ? reject(err) : resolve(result)));
151
120
  });
@@ -190,7 +159,6 @@ async function restart() {
190
159
  }
191
160
  async function update() {
192
161
  log.debug('Received update event, updating...');
193
- // TODO: Implement update logic outside of matterbridge
194
162
  instance = await Matterbridge.loadInstance(true);
195
163
  registerHandlers();
196
164
  }
@@ -210,7 +178,6 @@ async function main() {
210
178
  log.debug(`***Matterbridge.loadInstance(true) called`);
211
179
  instance = await Matterbridge.loadInstance(true);
212
180
  log.debug(`***Matterbridge.loadInstance(true) exited`);
213
- // Check if the instance needs to shut down from parseCommandLine()
214
181
  if (!instance || instance.shutdown) {
215
182
  shutdown();
216
183
  }
@@ -218,11 +185,9 @@ async function main() {
218
185
  registerHandlers();
219
186
  }
220
187
  }
221
- // Run the main function
222
188
  process.title = 'matterbridge';
223
189
  main().catch((error) => {
224
190
  const errorMessage = error instanceof Error ? error.message : error;
225
191
  const errorInspect = inspect(error, { depth: 10 });
226
192
  log.error(`Matterbridge.loadInstance() failed with error: ${errorMessage}\nstack: ${errorInspect}`);
227
193
  });
228
- //# sourceMappingURL=cli.js.map
@@ -1,3 +1 @@
1
1
  export {};
2
- // Nothing to export right now, but this file is here to make it easier to add exports in the future
3
- //# sourceMappingURL=export.js.map
@@ -1,25 +1,3 @@
1
- /**
2
- * This file contains the default config for the plugins.
3
- *
4
- * @file defaultConfigSchema.ts
5
- * @author Luca Liguori
6
- * @date 2024-05-07
7
- * @version 1.0.1
8
- *
9
- * Copyright 2024, 2025, 2026 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License. *
22
- */
23
1
  export const zigbee2mqtt_config = {
24
2
  name: 'matterbridge-zigbee2mqtt',
25
3
  type: 'DynamicPlatform',
@@ -78,4 +56,3 @@ export const shelly_config = {
78
56
  debugWs: false,
79
57
  unregisterOnShutdown: false,
80
58
  };
81
- //# sourceMappingURL=defaultConfigSchema.js.map
@@ -1,89 +1,28 @@
1
- /**
2
- * This file contains the DeviceManager class.
3
- *
4
- * @file devices.ts
5
- * @author Luca Liguori
6
- * @date 2024-07-26
7
- * @version 1.0.9
8
- *
9
- * Copyright 2024, 2025, 2026 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License. *
22
- */
23
- // AnsiLogger module
24
1
  import { AnsiLogger, BLUE, er } from './logger/export.js';
25
2
  import { dev } from './matterbridgeTypes.js';
26
- /**
27
- * Manages Matterbridge devices.
28
- */
29
3
  export class DeviceManager {
30
4
  _devices = new Map();
31
5
  matterbridge;
32
6
  nodeContext;
33
7
  log;
34
- /**
35
- * Creates an instance of DeviceManager.
36
- *
37
- * @param {Matterbridge} matterbridge - The Matterbridge instance.
38
- * @param {NodeStorage} nodeContext - The node storage context.
39
- */
40
8
  constructor(matterbridge, nodeContext) {
41
9
  this.matterbridge = matterbridge;
42
10
  this.nodeContext = nodeContext;
43
- this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: matterbridge.log.logLevel });
11
+ this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4, logLevel: matterbridge.log.logLevel });
44
12
  this.log.debug('Matterbridge device manager starting...');
45
13
  }
46
- /**
47
- * Gets the number of devices.
48
- *
49
- * @returns {number} The number of devices.
50
- */
51
14
  get length() {
52
15
  return this._devices.size;
53
16
  }
54
- /**
55
- * Gets the number of devices.
56
- *
57
- * @returns {number} The number of devices.
58
- */
59
17
  get size() {
60
18
  return this._devices.size;
61
19
  }
62
- /**
63
- * Checks if a device with the specified unique ID exists.
64
- *
65
- * @param {string} uniqueId - The unique ID of the device.
66
- * @returns {boolean} True if the device exists, false otherwise.
67
- */
68
20
  has(uniqueId) {
69
21
  return this._devices.has(uniqueId);
70
22
  }
71
- /**
72
- * Gets a device by its unique ID.
73
- *
74
- * @param {string} uniqueId - The unique ID of the device.
75
- * @returns {MatterbridgeEndpoint | undefined} The device, or undefined if not found.
76
- */
77
23
  get(uniqueId) {
78
24
  return this._devices.get(uniqueId);
79
25
  }
80
- /**
81
- * Adds a device to the manager.
82
- *
83
- * @param {MatterbridgeEndpoint} device - The device to add.
84
- * @returns {MatterbridgeEndpoint} The added device.
85
- * @throws {Error} If the device does not have a unique ID.
86
- */
87
26
  set(device) {
88
27
  if (!device.uniqueId)
89
28
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -92,13 +31,6 @@ export class DeviceManager {
92
31
  this._devices.set(device.uniqueId, device);
93
32
  return device;
94
33
  }
95
- /**
96
- * Removes a device from the manager.
97
- *
98
- * @param {MatterbridgeEndpoint} device - The device to remove.
99
- * @returns {boolean} True if the device was removed, false otherwise.
100
- * @throws {Error} If the device does not have a unique ID.
101
- */
102
34
  remove(device) {
103
35
  if (!device.uniqueId)
104
36
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -106,34 +38,15 @@ export class DeviceManager {
106
38
  this.log.error(`The device ${dev}${device.deviceName}${er} with uniqueId ${BLUE}${device.uniqueId}${er} serialNumber ${BLUE}${device.serialNumber}${er} is not registered in the device manager`);
107
39
  return this._devices.delete(device.uniqueId);
108
40
  }
109
- /**
110
- * Clears all devices from the manager.
111
- */
112
41
  clear() {
113
42
  this._devices.clear();
114
43
  }
115
- /**
116
- * Gets an array of all devices.
117
- *
118
- * @returns {MatterbridgeEndpoint[]} An array of all devices.
119
- */
120
44
  array() {
121
45
  return Array.from(this._devices.values());
122
46
  }
123
- /**
124
- * Iterates over all devices.
125
- *
126
- * @returns {IterableIterator<MatterbridgeEndpoint>} An iterator for the devices.
127
- */
128
47
  [Symbol.iterator]() {
129
48
  return this._devices.values();
130
49
  }
131
- /**
132
- * Asynchronously iterates over each device and calls the provided callback function.
133
- *
134
- * @param {Function} callback - The callback function to call with each device.
135
- * @returns {Promise<void>} A promise that resolves when all callbacks have been called.
136
- */
137
50
  async forEach(callback) {
138
51
  if (this.size === 0)
139
52
  return;
@@ -147,13 +60,7 @@ export class DeviceManager {
147
60
  });
148
61
  await Promise.all(tasks);
149
62
  }
150
- /**
151
- * Sets the log level.
152
- *
153
- * @param {LogLevel} logLevel - The log level to set.
154
- */
155
63
  set logLevel(logLevel) {
156
64
  this.log.logLevel = logLevel;
157
65
  }
158
66
  }
159
- //# sourceMappingURL=deviceManager.js.map