matterbridge 3.0.5-dev-20250607-353b662 → 3.0.5

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 (171) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/cli.d.ts +29 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +79 -5
  5. package/dist/cli.js.map +1 -0
  6. package/dist/cluster/export.d.ts +2 -0
  7. package/dist/cluster/export.d.ts.map +1 -0
  8. package/dist/cluster/export.js +2 -0
  9. package/dist/cluster/export.js.map +1 -0
  10. package/dist/defaultConfigSchema.d.ts +27 -0
  11. package/dist/defaultConfigSchema.d.ts.map +1 -0
  12. package/dist/defaultConfigSchema.js +23 -0
  13. package/dist/defaultConfigSchema.js.map +1 -0
  14. package/dist/deviceManager.d.ts +114 -0
  15. package/dist/deviceManager.d.ts.map +1 -0
  16. package/dist/deviceManager.js +94 -1
  17. package/dist/deviceManager.js.map +1 -0
  18. package/dist/evse.d.ts +63 -0
  19. package/dist/evse.d.ts.map +1 -0
  20. package/dist/evse.js +79 -26
  21. package/dist/evse.js.map +1 -0
  22. package/dist/frontend.d.ts +256 -0
  23. package/dist/frontend.d.ts.map +1 -0
  24. package/dist/frontend.js +374 -16
  25. package/dist/frontend.js.map +1 -0
  26. package/dist/helpers.d.ts +47 -0
  27. package/dist/helpers.d.ts.map +1 -0
  28. package/dist/helpers.js +51 -0
  29. package/dist/helpers.js.map +1 -0
  30. package/dist/index.d.ts +37 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +28 -1
  33. package/dist/index.js.map +1 -0
  34. package/dist/laundryWasher.d.ts +243 -0
  35. package/dist/laundryWasher.d.ts.map +1 -0
  36. package/dist/laundryWasher.js +92 -7
  37. package/dist/laundryWasher.js.map +1 -0
  38. package/dist/logger/export.d.ts +2 -0
  39. package/dist/logger/export.d.ts.map +1 -0
  40. package/dist/logger/export.js +1 -0
  41. package/dist/logger/export.js.map +1 -0
  42. package/dist/matter/behaviors.d.ts +2 -0
  43. package/dist/matter/behaviors.d.ts.map +1 -0
  44. package/dist/matter/behaviors.js +2 -0
  45. package/dist/matter/behaviors.js.map +1 -0
  46. package/dist/matter/clusters.d.ts +2 -0
  47. package/dist/matter/clusters.d.ts.map +1 -0
  48. package/dist/matter/clusters.js +2 -0
  49. package/dist/matter/clusters.js.map +1 -0
  50. package/dist/matter/devices.d.ts +2 -0
  51. package/dist/matter/devices.d.ts.map +1 -0
  52. package/dist/matter/devices.js +2 -0
  53. package/dist/matter/devices.js.map +1 -0
  54. package/dist/matter/endpoints.d.ts +2 -0
  55. package/dist/matter/endpoints.d.ts.map +1 -0
  56. package/dist/matter/endpoints.js +2 -0
  57. package/dist/matter/endpoints.js.map +1 -0
  58. package/dist/matter/export.d.ts +5 -0
  59. package/dist/matter/export.d.ts.map +1 -0
  60. package/dist/matter/export.js +2 -0
  61. package/dist/matter/export.js.map +1 -0
  62. package/dist/matter/types.d.ts +3 -0
  63. package/dist/matter/types.d.ts.map +1 -0
  64. package/dist/matter/types.js +2 -0
  65. package/dist/matter/types.js.map +1 -0
  66. package/dist/matterbridge.d.ts +449 -0
  67. package/dist/matterbridge.d.ts.map +1 -0
  68. package/dist/matterbridge.js +747 -47
  69. package/dist/matterbridge.js.map +1 -0
  70. package/dist/matterbridgeAccessoryPlatform.d.ts +40 -0
  71. package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
  72. package/dist/matterbridgeAccessoryPlatform.js +34 -0
  73. package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
  74. package/dist/matterbridgeBehaviors.d.ts +1379 -0
  75. package/dist/matterbridgeBehaviors.d.ts.map +1 -0
  76. package/dist/matterbridgeBehaviors.js +49 -1
  77. package/dist/matterbridgeBehaviors.js.map +1 -0
  78. package/dist/matterbridgeDeviceTypes.d.ts +644 -0
  79. package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
  80. package/dist/matterbridgeDeviceTypes.js +578 -15
  81. package/dist/matterbridgeDeviceTypes.js.map +1 -0
  82. package/dist/matterbridgeDynamicPlatform.d.ts +40 -0
  83. package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
  84. package/dist/matterbridgeDynamicPlatform.js +34 -0
  85. package/dist/matterbridgeDynamicPlatform.js.map +1 -0
  86. package/dist/matterbridgeEndpoint.d.ts +1079 -0
  87. package/dist/matterbridgeEndpoint.d.ts.map +1 -0
  88. package/dist/matterbridgeEndpoint.js +924 -24
  89. package/dist/matterbridgeEndpoint.js.map +1 -0
  90. package/dist/matterbridgeEndpointHelpers.d.ts +2749 -0
  91. package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
  92. package/dist/matterbridgeEndpointHelpers.js +172 -10
  93. package/dist/matterbridgeEndpointHelpers.js.map +1 -0
  94. package/dist/matterbridgePlatform.d.ts +294 -0
  95. package/dist/matterbridgePlatform.d.ts.map +1 -0
  96. package/dist/matterbridgePlatform.js +225 -7
  97. package/dist/matterbridgePlatform.js.map +1 -0
  98. package/dist/matterbridgeTypes.d.ts +196 -0
  99. package/dist/matterbridgeTypes.d.ts.map +1 -0
  100. package/dist/matterbridgeTypes.js +24 -0
  101. package/dist/matterbridgeTypes.js.map +1 -0
  102. package/dist/pluginManager.d.ts +273 -0
  103. package/dist/pluginManager.d.ts.map +1 -0
  104. package/dist/pluginManager.js +264 -3
  105. package/dist/pluginManager.js.map +1 -0
  106. package/dist/roboticVacuumCleaner.d.ts +102 -0
  107. package/dist/roboticVacuumCleaner.d.ts.map +1 -0
  108. package/dist/roboticVacuumCleaner.js +81 -6
  109. package/dist/roboticVacuumCleaner.js.map +1 -0
  110. package/dist/shelly.d.ts +153 -0
  111. package/dist/shelly.d.ts.map +1 -0
  112. package/dist/shelly.js +155 -7
  113. package/dist/shelly.js.map +1 -0
  114. package/dist/storage/export.d.ts +2 -0
  115. package/dist/storage/export.d.ts.map +1 -0
  116. package/dist/storage/export.js +1 -0
  117. package/dist/storage/export.js.map +1 -0
  118. package/dist/update.d.ts +58 -0
  119. package/dist/update.d.ts.map +1 -0
  120. package/dist/update.js +53 -0
  121. package/dist/update.js.map +1 -0
  122. package/dist/utils/colorUtils.d.ts +61 -0
  123. package/dist/utils/colorUtils.d.ts.map +1 -0
  124. package/dist/utils/colorUtils.js +205 -2
  125. package/dist/utils/colorUtils.js.map +1 -0
  126. package/dist/utils/commandLine.d.ts +58 -0
  127. package/dist/utils/commandLine.d.ts.map +1 -0
  128. package/dist/utils/commandLine.js +53 -0
  129. package/dist/utils/commandLine.js.map +1 -0
  130. package/dist/utils/copyDirectory.d.ts +32 -0
  131. package/dist/utils/copyDirectory.d.ts.map +1 -0
  132. package/dist/utils/copyDirectory.js +37 -1
  133. package/dist/utils/copyDirectory.js.map +1 -0
  134. package/dist/utils/createZip.d.ts +38 -0
  135. package/dist/utils/createZip.d.ts.map +1 -0
  136. package/dist/utils/createZip.js +42 -2
  137. package/dist/utils/createZip.js.map +1 -0
  138. package/dist/utils/deepCopy.d.ts +31 -0
  139. package/dist/utils/deepCopy.d.ts.map +1 -0
  140. package/dist/utils/deepCopy.js +38 -0
  141. package/dist/utils/deepCopy.js.map +1 -0
  142. package/dist/utils/deepEqual.d.ts +53 -0
  143. package/dist/utils/deepEqual.d.ts.map +1 -0
  144. package/dist/utils/deepEqual.js +71 -1
  145. package/dist/utils/deepEqual.js.map +1 -0
  146. package/dist/utils/export.d.ts +11 -0
  147. package/dist/utils/export.d.ts.map +1 -0
  148. package/dist/utils/export.js +1 -0
  149. package/dist/utils/export.js.map +1 -0
  150. package/dist/utils/hex.d.ts +48 -0
  151. package/dist/utils/hex.d.ts.map +1 -0
  152. package/dist/utils/hex.js +57 -0
  153. package/dist/utils/hex.js.map +1 -0
  154. package/dist/utils/isvalid.d.ts +102 -0
  155. package/dist/utils/isvalid.d.ts.map +1 -0
  156. package/dist/utils/isvalid.js +100 -0
  157. package/dist/utils/isvalid.js.map +1 -0
  158. package/dist/utils/network.d.ts +69 -0
  159. package/dist/utils/network.d.ts.map +1 -0
  160. package/dist/utils/network.js +76 -5
  161. package/dist/utils/network.js.map +1 -0
  162. package/dist/utils/wait.d.ts +52 -0
  163. package/dist/utils/wait.d.ts.map +1 -0
  164. package/dist/utils/wait.js +58 -9
  165. package/dist/utils/wait.js.map +1 -0
  166. package/dist/waterHeater.d.ts +90 -0
  167. package/dist/waterHeater.d.ts.map +1 -0
  168. package/dist/waterHeater.js +62 -2
  169. package/dist/waterHeater.js.map +1 -0
  170. package/npm-shrinkwrap.json +17 -8
  171. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -12,7 +12,7 @@ If you like this project and find it useful, please consider giving it a star on
12
12
 
13
13
  ### Added
14
14
 
15
- - [cli]: Added takeHeapSnapshot() and triggerGarbageCollection().
15
+ - [cli]: Added takeHeapSnapshot() and triggerGarbageCollection() for internal testing.
16
16
  - [LaundryWasher]: Added Evse class and Jest test. Thanks Ludovic BOUÉ.
17
17
  - [LaundryWasher]: Added LaundryWasher class and Jest test.
18
18
  - [WaterHeater]: Added WaterHeater class and Jest test. Thanks Ludovic BOUÉ.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,29 @@
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
+ import { Matterbridge } from './matterbridge.js';
25
+ import { EventEmitter } from 'node:events';
26
+ export declare const cliEmitter: EventEmitter<[never]>;
27
+ export declare let instance: Matterbridge | undefined;
28
+ export declare let lastCpuUsage: number;
29
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AASjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,eAAO,MAAM,UAAU,uBAAqB,CAAC;AAE7C,eAAO,IAAI,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;AAS9C,eAAO,IAAI,YAAY,QAAI,CAAC"}
package/dist/cli.js CHANGED
@@ -1,19 +1,46 @@
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
2
25
  import { Matterbridge } from './matterbridge.js';
3
26
  import { getIntParameter, hasParameter } from './utils/export.js';
27
+ // AnsiLogger module
4
28
  import { AnsiLogger, BRIGHT, CYAN, db, YELLOW } from './logger/export.js';
29
+ import os from 'node:os';
5
30
  import { EventEmitter } from 'node:events';
6
31
  import { inspect } from 'node:util';
7
32
  export const cliEmitter = new EventEmitter();
8
33
  export let instance;
34
+ // Inspectop
9
35
  let session;
10
36
  let snapshotInterval;
37
+ // Cpu and memory check
11
38
  let memoryCheckInterval;
12
39
  let prevCpus;
13
40
  export let lastCpuUsage = 0;
14
41
  let peakCpu = 0;
15
42
  let peakRss = 0;
16
- const log = new AnsiLogger({ logName: 'Cli', logTimestampFormat: 4, logLevel: hasParameter('debug') ? "debug" : "info" });
43
+ const log = new AnsiLogger({ logName: 'Cli', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: hasParameter('debug') ? "debug" /* LogLevel.DEBUG */ : "info" /* LogLevel.INFO */ });
17
44
  const formatMemoryUsage = (bytes) => {
18
45
  if (bytes >= 1024 ** 3) {
19
46
  return `${(bytes / 1024 ** 3).toFixed(2)} GB`;
@@ -41,14 +68,16 @@ const formatOsUpTime = (seconds) => {
41
68
  return `${seconds} second${seconds !== 1 ? 's' : ''}`;
42
69
  };
43
70
  async function startCpuMemoryCheck() {
44
- const os = await import('node:os');
71
+ // const os = await import('node:os');
45
72
  log.debug(`Cpu memory check started`);
46
73
  prevCpus = os.cpus();
47
74
  clearInterval(memoryCheckInterval);
48
75
  const interval = () => {
76
+ // Get the os uptime
49
77
  const systemUptime = formatOsUpTime(Math.floor(os.uptime()));
50
78
  const processUptime = formatOsUpTime(Math.floor(process.uptime()));
51
79
  cliEmitter.emit('uptime', systemUptime, processUptime);
80
+ // Get the memory usage
52
81
  const totalMememory = formatMemoryUsage(os.totalmem());
53
82
  const freeMemory = formatMemoryUsage(os.freemem());
54
83
  const memoryUsageRaw = process.memoryUsage();
@@ -60,10 +89,12 @@ async function startCpuMemoryCheck() {
60
89
  if (memoryUsageRaw.rss > peakRss)
61
90
  peakRss = memoryUsageRaw.rss;
62
91
  cliEmitter.emit('memory', totalMememory, freeMemory, rss, heapTotal, heapUsed, external, arrayBuffers);
92
+ // Get the cpu usage
63
93
  const currCpus = os.cpus();
94
+ // log.debug(`Cpus: ${JSON.stringify(currCpus)}`);
64
95
  let cpuUsageLog;
65
96
  if (currCpus.length !== prevCpus.length) {
66
- prevCpus = currCpus;
97
+ prevCpus = currCpus; // Reset the previous cpus
67
98
  log.debug(`Cpu check length failed, resetting previous cpus`);
68
99
  return;
69
100
  }
@@ -89,19 +120,26 @@ async function startCpuMemoryCheck() {
89
120
  cliEmitter.emit('cpu', lastCpuUsage);
90
121
  }
91
122
  prevCpus = currCpus;
123
+ // Show the cpu and memory usage
92
124
  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}`);
93
125
  };
94
126
  interval();
95
- memoryCheckInterval = setInterval(interval, getIntParameter('memoryinterval') ?? 10 * 1000);
127
+ clearInterval(memoryCheckInterval);
128
+ memoryCheckInterval = setInterval(interval, getIntParameter('memoryinterval') ?? 10 * 1000).unref();
96
129
  }
97
130
  async function stopCpuMemoryCheck() {
98
131
  log.debug(`***Cpu memory check stopped. Peak cpu: ${CYAN}${peakCpu.toFixed(2)} %${db}. Peak rss: ${CYAN}${formatMemoryUsage(peakRss)}${db}.`);
99
132
  clearInterval(memoryCheckInterval);
100
133
  }
134
+ /**
135
+ * Starts the inspector for heap sampling.
136
+ * This function is called when the -inspect parameter is passed.
137
+ */
101
138
  async function startInspector() {
102
139
  const { Session } = await import('node:inspector');
103
140
  const { mkdirSync } = await import('node:fs');
104
141
  log.debug(`***Starting heap sampling...`);
142
+ // Create the heap snapshots directory if it doesn't exist
105
143
  mkdirSync('heap_profile', { recursive: true });
106
144
  try {
107
145
  session = new Session();
@@ -110,12 +148,15 @@ async function startInspector() {
110
148
  session?.post('HeapProfiler.startSampling', (err) => (err ? reject(err) : resolve()));
111
149
  });
112
150
  log.debug(`***Started heap sampling`);
151
+ // Set an interval to take heap snapshots
113
152
  const interval = getIntParameter('snapshotinterval');
114
153
  if (interval && interval >= 30000) {
115
154
  log.debug(`***Started heap snapshot interval of ${CYAN}${interval}${db} ms`);
155
+ clearInterval(snapshotInterval);
116
156
  snapshotInterval = setInterval(async () => {
157
+ log.debug(`Run heap snapshot interval`);
117
158
  await takeHeapSnapshot();
118
- }, interval);
159
+ }, interval).unref();
119
160
  }
120
161
  }
121
162
  catch (err) {
@@ -125,13 +166,19 @@ async function startInspector() {
125
166
  return;
126
167
  }
127
168
  }
169
+ /**
170
+ * Stops the heap sampling and saves the profile to a file.
171
+ * This function is called when the inspector is stopped.
172
+ */
128
173
  async function stopInspector() {
129
174
  const { writeFileSync } = await import('node:fs');
130
175
  const path = await import('node:path');
131
176
  log.debug(`***Stopping heap sampling...`);
132
177
  if (snapshotInterval) {
133
178
  log.debug(`***Clearing heap snapshot interval...`);
179
+ // Clear the snapshot interval if it exists
134
180
  clearInterval(snapshotInterval);
181
+ // Take a final heap snapshot before stopping
135
182
  await takeHeapSnapshot();
136
183
  }
137
184
  if (!session) {
@@ -139,6 +186,7 @@ async function stopInspector() {
139
186
  return;
140
187
  }
141
188
  try {
189
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
142
190
  const result = await new Promise((resolve, reject) => {
143
191
  session?.post('HeapProfiler.stopSampling', (err, result) => (err ? reject(err) : resolve(result)));
144
192
  });
@@ -156,6 +204,13 @@ async function stopInspector() {
156
204
  log.debug(`***Stopped heap sampling`);
157
205
  }
158
206
  }
207
+ /**
208
+ * Takes a heap snapshot and saves it to the file name Heap-snapshot-<timestamp>.heapsnapshot.
209
+ * This function is called periodically based on the -snapshotinterval parameter.
210
+ * The -snapshotinterval parameter must at least 30000 ms.
211
+ * The snapshot is saved in the heap_profile directory that is created in the current working directory.
212
+ * The snapshot can be analyzed using vscode or Chrome DevTools or other tools that support heap snapshots.
213
+ */
159
214
  async function takeHeapSnapshot() {
160
215
  const { writeFileSync } = await import('node:fs');
161
216
  const path = await import('node:path');
@@ -164,6 +219,7 @@ async function takeHeapSnapshot() {
164
219
  log.error('No active inspector session.');
165
220
  return;
166
221
  }
222
+ log.debug(`Taking heap snapshot...`);
167
223
  const chunks = [];
168
224
  const chunksListener = (notification) => {
169
225
  chunks.push(Buffer.from(notification.params.chunk));
@@ -186,6 +242,10 @@ async function takeHeapSnapshot() {
186
242
  });
187
243
  });
188
244
  }
245
+ /**
246
+ * Triggers a manual garbage collection.
247
+ * This function is working only if the process is started with --expose-gc.
248
+ */
189
249
  function triggerGarbageCollection() {
190
250
  if (typeof global.gc === 'function') {
191
251
  global.gc();
@@ -207,6 +267,14 @@ function registerHandlers() {
207
267
  instance.on('startmemorycheck', async () => start());
208
268
  if (instance)
209
269
  instance.on('stopmemorycheck', async () => stop());
270
+ if (instance)
271
+ instance.on('startinspector', async () => startInspector());
272
+ if (instance)
273
+ instance.on('stopinspector', async () => stopInspector());
274
+ if (instance)
275
+ instance.on('takeheapsnapshot', async () => takeHeapSnapshot());
276
+ if (instance)
277
+ instance.on('triggergarbagecollection', async () => triggerGarbageCollection());
210
278
  log.debug('Registered event handlers');
211
279
  }
212
280
  async function shutdown() {
@@ -214,6 +282,7 @@ async function shutdown() {
214
282
  if (hasParameter('inspect'))
215
283
  await stopInspector();
216
284
  await stopCpuMemoryCheck();
285
+ cliEmitter.emit('shutdown');
217
286
  process.exit(0);
218
287
  }
219
288
  async function restart() {
@@ -223,6 +292,7 @@ async function restart() {
223
292
  }
224
293
  async function update() {
225
294
  log.debug('Received update event, updating...');
295
+ // TODO: Implement update logic outside of matterbridge
226
296
  instance = await Matterbridge.loadInstance(true);
227
297
  registerHandlers();
228
298
  }
@@ -242,16 +312,20 @@ async function main() {
242
312
  log.debug(`***Matterbridge.loadInstance(true) called`);
243
313
  instance = await Matterbridge.loadInstance(true);
244
314
  log.debug(`***Matterbridge.loadInstance(true) exited`);
315
+ // Check if the instance needs to shut down from parseCommandLine()
245
316
  if (!instance || instance.shutdown) {
246
317
  shutdown();
247
318
  }
248
319
  else {
249
320
  registerHandlers();
321
+ cliEmitter.emit('ready');
250
322
  }
251
323
  }
324
+ // Run the main function
252
325
  process.title = 'matterbridge';
253
326
  main().catch((error) => {
254
327
  const errorMessage = error instanceof Error ? error.message : error;
255
328
  const errorInspect = inspect(error, { depth: 10 });
256
329
  log.error(`Matterbridge.loadInstance() failed with error: ${errorMessage}\nstack: ${errorInspect}`);
257
330
  });
331
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAe;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE,oBAAoB;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAA6B,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIrG,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,YAAY,EAAE,CAAC;AAE7C,MAAM,CAAC,IAAI,QAAkC,CAAC;AAE9C,YAAY;AACZ,IAAI,OAA4B,CAAC;AACjC,IAAI,gBAAgC,CAAC;AAErC,uBAAuB;AACvB,IAAI,mBAAmC,CAAC;AACxC,IAAI,QAAsB,CAAC;AAC3B,MAAM,CAAC,IAAI,YAAY,GAAG,CAAC,CAAC;AAC5B,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,IAAI,OAAO,GAAG,CAAC,CAAC;AAEhB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,kBAAkB,qCAA6B,EAAE,QAAQ,EAAE,Y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GAAG,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAEvD,QAAQ,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAEjD,GAAG,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAEvD,mEAAmE;IACnE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACnC,QAAQ,EAAE,CAAC;IACb,CAAC;SAAM,CAAC;QACN,gBAAgB,EAAE,CAAC;QACnB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,wBAAwB;AACxB,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC;AAC/B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IACpE,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACnD,GAAG,CAAC,KAAK,CAAC,kDAAkD,YAAY,YAAY,YAAY,EAAE,CAAC,CAAC;AACtG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/cluster/export.ts"],"names":[],"mappings":""}
@@ -1 +1,3 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/cluster/export.ts"],"names":[],"mappings":";AAAA,oGAAoG"}
@@ -0,0 +1,27 @@
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
+ import { PlatformConfig } from './matterbridgePlatform.js';
24
+ export declare const zigbee2mqtt_config: PlatformConfig;
25
+ export declare const somfytahoma_config: PlatformConfig;
26
+ export declare const shelly_config: PlatformConfig;
27
+ //# sourceMappingURL=defaultConfigSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultConfigSchema.d.ts","sourceRoot":"","sources":["../src/defaultConfigSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,eAAO,MAAM,kBAAkB,EAAE,cAiBhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAWhC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cA2B3B,CAAC"}
@@ -1,3 +1,25 @@
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
+ */
1
23
  export const zigbee2mqtt_config = {
2
24
  name: 'matterbridge-zigbee2mqtt',
3
25
  type: 'DynamicPlatform',
@@ -56,3 +78,4 @@ export const shelly_config = {
56
78
  debugWs: false,
57
79
  unregisterOnShutdown: false,
58
80
  };
81
+ //# sourceMappingURL=defaultConfigSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultConfigSchema.js","sourceRoot":"","sources":["../src/defaultConfigSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAmB;IAChD,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,gBAAgB,EAAE,EAAE;IACpB,sBAAsB,EAAE,EAAE;IAC1B,KAAK,EAAE,KAAK;IACZ,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAmB;IAChD,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;IACb,gBAAgB,EAAE,EAAE;IACpB,KAAK,EAAE,KAAK;IACZ,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,gBAAgB,EAAE,EAAE;IACpB,kBAAkB,EAAE,EAAE;IACtB,iBAAiB,EAAE,EAAE;IACrB,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;IACb,eAAe,EAAE,EAAE;IACnB,qBAAqB,EAAE,EAAE;IACzB,WAAW,EAAE,EAAE;IACf,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,oBAAoB,EAAE,KAAK;IAC3B,iBAAiB,EAAE,IAAI;IACvB,aAAa,EAAE,CAAC;IAChB,OAAO,EAAE,EAAE;IACX,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,KAAK;IACd,oBAAoB,EAAE,KAAK;CAC5B,CAAC"}
@@ -0,0 +1,114 @@
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.10
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
+ import { LogLevel } from './logger/export.js';
24
+ import { NodeStorage } from './storage/export.js';
25
+ import { Matterbridge } from './matterbridge.js';
26
+ import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
27
+ /**
28
+ * Manages Matterbridge devices.
29
+ */
30
+ export declare class DeviceManager {
31
+ private readonly _devices;
32
+ private readonly matterbridge;
33
+ private readonly nodeContext;
34
+ private readonly log;
35
+ /**
36
+ * Creates an instance of DeviceManager.
37
+ *
38
+ * @param {Matterbridge} matterbridge - The Matterbridge instance.
39
+ * @param {NodeStorage} nodeContext - The node storage context.
40
+ */
41
+ constructor(matterbridge: Matterbridge, nodeContext: NodeStorage);
42
+ /**
43
+ * Gets the number of devices.
44
+ *
45
+ * @returns {number} The number of devices.
46
+ */
47
+ get length(): number;
48
+ /**
49
+ * Gets the number of devices.
50
+ *
51
+ * @returns {number} The number of devices.
52
+ */
53
+ get size(): number;
54
+ /**
55
+ * Checks if a device with the specified unique ID exists.
56
+ *
57
+ * @param {string} uniqueId - The unique ID of the device.
58
+ * @returns {boolean} True if the device exists, false otherwise.
59
+ */
60
+ has(uniqueId: string): boolean;
61
+ /**
62
+ * Gets a device by its unique ID.
63
+ *
64
+ * @param {string} uniqueId - The unique ID of the device.
65
+ * @returns {MatterbridgeEndpoint | undefined} The device, or undefined if not found.
66
+ */
67
+ get(uniqueId: string): MatterbridgeEndpoint | undefined;
68
+ /**
69
+ * Adds a device to the manager.
70
+ *
71
+ * @param {MatterbridgeEndpoint} device - The device to add.
72
+ * @returns {MatterbridgeEndpoint} The added device.
73
+ * @throws {Error} If the device does not have a unique ID.
74
+ */
75
+ set(device: MatterbridgeEndpoint): MatterbridgeEndpoint;
76
+ /**
77
+ * Removes a device from the manager.
78
+ *
79
+ * @param {MatterbridgeEndpoint} device - The device to remove.
80
+ * @returns {boolean} True if the device was removed, false otherwise.
81
+ * @throws {Error} If the device does not have a unique ID.
82
+ */
83
+ remove(device: MatterbridgeEndpoint): boolean;
84
+ /**
85
+ * Clears all devices from the manager.
86
+ */
87
+ clear(): void;
88
+ /**
89
+ * Gets an array of all devices.
90
+ *
91
+ * @returns {MatterbridgeEndpoint[]} An array of all devices.
92
+ */
93
+ array(): MatterbridgeEndpoint[];
94
+ /**
95
+ * Iterates over all devices.
96
+ *
97
+ * @returns {IterableIterator<MatterbridgeEndpoint>} An iterator for the devices.
98
+ */
99
+ [Symbol.iterator](): MapIterator<MatterbridgeEndpoint>;
100
+ /**
101
+ * Asynchronously iterates over each device and calls the provided callback function.
102
+ *
103
+ * @param {(device: MatterbridgeEndpoint) => Promise<void>} callback - The callback function to call with each device.
104
+ * @returns {Promise<void>} A promise that resolves when all callbacks have been called.
105
+ */
106
+ forEach(callback: (device: MatterbridgeEndpoint) => Promise<void>): Promise<void>;
107
+ /**
108
+ * Sets the log level.
109
+ *
110
+ * @param {LogLevel} logLevel - The log level to set.
111
+ */
112
+ set logLevel(logLevel: LogLevel);
113
+ }
114
+ //# sourceMappingURL=deviceManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceManager.d.ts","sourceRoot":"","sources":["../src/deviceManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAwB,QAAQ,EAAmB,MAAM,oBAAoB,CAAC;AAGrF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IACpE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;IAEjC;;;;;OAKG;gBACS,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW;IAOhE;;;;OAIG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;OAKG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI9B;;;;;OAKG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAIvD;;;;;;OAMG;IACH,GAAG,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB;IAOvD;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO;IAM7C;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;;;OAIG;IACH,KAAK,IAAI,oBAAoB,EAAE;IAI/B;;;;OAIG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;;;OAKG;IACG,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAavF;;;;OAIG;IACH,IAAI,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAE9B;CACF"}
@@ -1,28 +1,89 @@
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.10
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
1
24
  import { AnsiLogger, BLUE, er } from './logger/export.js';
2
25
  import { dev } from './matterbridgeTypes.js';
26
+ /**
27
+ * Manages Matterbridge devices.
28
+ */
3
29
  export class DeviceManager {
4
30
  _devices = new Map();
5
31
  matterbridge;
6
32
  nodeContext;
7
33
  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
+ */
8
40
  constructor(matterbridge, nodeContext) {
9
41
  this.matterbridge = matterbridge;
10
42
  this.nodeContext = nodeContext;
11
- this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4, logLevel: matterbridge.log.logLevel });
43
+ this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: matterbridge.log.logLevel });
12
44
  this.log.debug('Matterbridge device manager starting...');
13
45
  }
46
+ /**
47
+ * Gets the number of devices.
48
+ *
49
+ * @returns {number} The number of devices.
50
+ */
14
51
  get length() {
15
52
  return this._devices.size;
16
53
  }
54
+ /**
55
+ * Gets the number of devices.
56
+ *
57
+ * @returns {number} The number of devices.
58
+ */
17
59
  get size() {
18
60
  return this._devices.size;
19
61
  }
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
+ */
20
68
  has(uniqueId) {
21
69
  return this._devices.has(uniqueId);
22
70
  }
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
+ */
23
77
  get(uniqueId) {
24
78
  return this._devices.get(uniqueId);
25
79
  }
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
+ */
26
87
  set(device) {
27
88
  if (!device.uniqueId)
28
89
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -31,6 +92,13 @@ export class DeviceManager {
31
92
  this._devices.set(device.uniqueId, device);
32
93
  return device;
33
94
  }
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
+ */
34
102
  remove(device) {
35
103
  if (!device.uniqueId)
36
104
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -38,15 +106,34 @@ export class DeviceManager {
38
106
  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`);
39
107
  return this._devices.delete(device.uniqueId);
40
108
  }
109
+ /**
110
+ * Clears all devices from the manager.
111
+ */
41
112
  clear() {
42
113
  this._devices.clear();
43
114
  }
115
+ /**
116
+ * Gets an array of all devices.
117
+ *
118
+ * @returns {MatterbridgeEndpoint[]} An array of all devices.
119
+ */
44
120
  array() {
45
121
  return Array.from(this._devices.values());
46
122
  }
123
+ /**
124
+ * Iterates over all devices.
125
+ *
126
+ * @returns {IterableIterator<MatterbridgeEndpoint>} An iterator for the devices.
127
+ */
47
128
  [Symbol.iterator]() {
48
129
  return this._devices.values();
49
130
  }
131
+ /**
132
+ * Asynchronously iterates over each device and calls the provided callback function.
133
+ *
134
+ * @param {(device: MatterbridgeEndpoint) => Promise<void>} callback - The callback function to call with each device.
135
+ * @returns {Promise<void>} A promise that resolves when all callbacks have been called.
136
+ */
50
137
  async forEach(callback) {
51
138
  if (this.size === 0)
52
139
  return;
@@ -60,7 +147,13 @@ export class DeviceManager {
60
147
  });
61
148
  await Promise.all(tasks);
62
149
  }
150
+ /**
151
+ * Sets the log level.
152
+ *
153
+ * @param {LogLevel} logLevel - The log level to set.
154
+ */
63
155
  set logLevel(logLevel) {
64
156
  this.log.logLevel = logLevel;
65
157
  }
66
158
  }
159
+ //# sourceMappingURL=deviceManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceManager.js","sourceRoot":"","sources":["../src/deviceManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,oBAAoB;AACpB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAA6B,MAAM,oBAAoB,CAAC;AAQrF,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAE7C;;GAEG;AACH,MAAM,OAAO,aAAa;IACP,QAAQ,GAAG,IAAI,GAAG,EAAgC,CAAC;IACnD,YAAY,CAAe;IAC3B,WAAW,CAAc;IACzB,GAAG,CAAa;IAEjC;;;;;OAKG;IACH,YAAY,YAA0B,EAAE,WAAwB;QAC9D,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,qCAA6B,EAAE,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9I,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,QAAgB;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,QAAgB;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ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