matterbridge 1.3.13 → 1.4.0
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 +29 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +10 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/matterbridge.d.ts +157 -261
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +1411 -1627
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -1
- package/dist/matterbridgeAccessoryPlatform.js +1 -0
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +2 -1
- package/dist/matterbridgeDevice.js.map +1 -1
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -1
- package/dist/matterbridgeDynamicPlatform.js +1 -0
- package/dist/matterbridgeDynamicPlatform.js.map +1 -1
- package/dist/matterbridgeTypes.d.ts +111 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -0
- package/dist/matterbridgeTypes.js +2 -0
- package/dist/matterbridgeTypes.js.map +1 -0
- package/dist/plugins.d.ts +102 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +674 -0
- package/dist/plugins.js.map +1 -0
- package/dist/utils/export.d.ts +3 -0
- package/dist/utils/export.d.ts.map +1 -0
- package/dist/utils/export.js +3 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/utils/utils.d.ts +37 -2
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +79 -7
- package/dist/utils/utils.js.map +1 -1
- package/frontend/build/asset-manifest.json +6 -6
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/css/{main.b4d28450.css → main.df840158.css} +2 -2
- package/frontend/build/static/css/main.df840158.css.map +1 -0
- package/frontend/build/static/js/{main.42130514.js → main.2a46688a.js} +3 -3
- package/frontend/build/static/js/main.2a46688a.js.map +1 -0
- package/package.json +25 -20
- package/__mocks__/@project-chip/matter-node.js/util.js +0 -41
- package/dist/utils.d.ts +0 -94
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -291
- package/dist/utils.js.map +0 -1
- package/frontend/build/static/css/main.b4d28450.css.map +0 -1
- package/frontend/build/static/js/main.42130514.js.map +0 -1
- /package/frontend/build/static/js/{main.42130514.js.LICENSE.txt → main.2a46688a.js.LICENSE.txt} +0 -0
package/dist/matterbridge.d.ts
CHANGED
|
@@ -20,100 +20,9 @@
|
|
|
20
20
|
* See the License for the specific language governing permissions and
|
|
21
21
|
* limitations under the License. *
|
|
22
22
|
*/
|
|
23
|
-
import { NodeStorage } from 'node-persist-manager';
|
|
24
23
|
import EventEmitter from 'events';
|
|
25
24
|
import { MatterbridgeDevice } from './matterbridgeDevice.js';
|
|
26
|
-
import {
|
|
27
|
-
import { CommissioningServer } from '@project-chip/matter-node.js';
|
|
28
|
-
import { FabricIndex, VendorId } from '@project-chip/matter-node.js/datatype';
|
|
29
|
-
import { Aggregator } from '@project-chip/matter-node.js/device';
|
|
30
|
-
import { StorageContext } from '@project-chip/matter-node.js/storage';
|
|
31
|
-
export interface RegisteredPlugin extends BaseRegisteredPlugin {
|
|
32
|
-
nodeContext?: NodeStorage;
|
|
33
|
-
storageContext?: StorageContext;
|
|
34
|
-
commissioningServer?: CommissioningServer;
|
|
35
|
-
aggregator?: Aggregator;
|
|
36
|
-
device?: MatterbridgeDevice;
|
|
37
|
-
platform?: MatterbridgePlatform;
|
|
38
|
-
}
|
|
39
|
-
export interface BaseRegisteredPlugin {
|
|
40
|
-
path: string;
|
|
41
|
-
type: string;
|
|
42
|
-
name: string;
|
|
43
|
-
version: string;
|
|
44
|
-
description: string;
|
|
45
|
-
author: string;
|
|
46
|
-
latestVersion?: string;
|
|
47
|
-
locked?: boolean;
|
|
48
|
-
error?: boolean;
|
|
49
|
-
enabled?: boolean;
|
|
50
|
-
loaded?: boolean;
|
|
51
|
-
started?: boolean;
|
|
52
|
-
configured?: boolean;
|
|
53
|
-
paired?: boolean;
|
|
54
|
-
connected?: boolean;
|
|
55
|
-
fabricInformations?: SanitizedExposedFabricInformation[];
|
|
56
|
-
sessionInformations?: SanitizedSessionInformation[];
|
|
57
|
-
registeredDevices?: number;
|
|
58
|
-
addedDevices?: number;
|
|
59
|
-
qrPairingCode?: string;
|
|
60
|
-
manualPairingCode?: string;
|
|
61
|
-
configJson?: PlatformConfig;
|
|
62
|
-
schemaJson?: PlatformSchema;
|
|
63
|
-
}
|
|
64
|
-
interface SystemInformation {
|
|
65
|
-
interfaceName: string;
|
|
66
|
-
macAddress: string;
|
|
67
|
-
ipv4Address: string;
|
|
68
|
-
ipv6Address: string;
|
|
69
|
-
nodeVersion: string;
|
|
70
|
-
hostname: string;
|
|
71
|
-
user: string;
|
|
72
|
-
osType: string;
|
|
73
|
-
osRelease: string;
|
|
74
|
-
osPlatform: string;
|
|
75
|
-
osArch: string;
|
|
76
|
-
totalMemory: string;
|
|
77
|
-
freeMemory: string;
|
|
78
|
-
systemUptime: string;
|
|
79
|
-
}
|
|
80
|
-
interface MatterbridgeInformation {
|
|
81
|
-
homeDirectory: string;
|
|
82
|
-
rootDirectory: string;
|
|
83
|
-
matterbridgeDirectory: string;
|
|
84
|
-
matterbridgePluginDirectory: string;
|
|
85
|
-
globalModulesDirectory: string;
|
|
86
|
-
matterbridgeVersion: string;
|
|
87
|
-
matterbridgeLatestVersion: string;
|
|
88
|
-
matterbridgeFabricInformations: SanitizedExposedFabricInformation[];
|
|
89
|
-
matterbridgeSessionInformations: SanitizedSessionInformation[];
|
|
90
|
-
matterbridgePaired: boolean;
|
|
91
|
-
matterbridgeConnected: boolean;
|
|
92
|
-
bridgeMode: string;
|
|
93
|
-
restartMode: string;
|
|
94
|
-
debugEnabled: boolean;
|
|
95
|
-
matterLoggerLevel: number;
|
|
96
|
-
}
|
|
97
|
-
interface SanitizedExposedFabricInformation {
|
|
98
|
-
fabricIndex: FabricIndex;
|
|
99
|
-
fabricId: string;
|
|
100
|
-
nodeId: string;
|
|
101
|
-
rootNodeId: string;
|
|
102
|
-
rootVendorId: VendorId;
|
|
103
|
-
rootVendorName: string;
|
|
104
|
-
label: string;
|
|
105
|
-
}
|
|
106
|
-
interface SanitizedSessionInformation {
|
|
107
|
-
name: string;
|
|
108
|
-
nodeId: string;
|
|
109
|
-
peerNodeId: string;
|
|
110
|
-
fabric?: SanitizedExposedFabricInformation;
|
|
111
|
-
isPeerActive: boolean;
|
|
112
|
-
secure: boolean;
|
|
113
|
-
lastInteractionTimestamp?: number;
|
|
114
|
-
lastActiveTimestamp?: number;
|
|
115
|
-
numberOfActiveSubscriptions: number;
|
|
116
|
-
}
|
|
25
|
+
import { MatterbridgeInformation, SanitizedExposedFabricInformation, SanitizedSessionInformation, SystemInformation } from './matterbridgeTypes.js';
|
|
117
26
|
/**
|
|
118
27
|
* Represents the Matterbridge application.
|
|
119
28
|
*/
|
|
@@ -128,27 +37,38 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
128
37
|
matterbridgeVersion: string;
|
|
129
38
|
matterbridgeLatestVersion: string;
|
|
130
39
|
matterbridgeFabricInformations: SanitizedExposedFabricInformation[];
|
|
40
|
+
matterbridgeSessionInformations: SanitizedSessionInformation[];
|
|
131
41
|
matterbridgePaired: boolean;
|
|
132
42
|
matterbridgeConnected: boolean;
|
|
133
|
-
matterbridgeSessionInformations: SanitizedSessionInformation[];
|
|
134
|
-
private checkUpdateInterval?;
|
|
135
43
|
bridgeMode: 'bridge' | 'childbridge' | 'controller' | '';
|
|
136
44
|
restartMode: 'service' | 'docker' | '';
|
|
137
45
|
debugEnabled: boolean;
|
|
138
|
-
|
|
139
|
-
private port;
|
|
140
|
-
private passcode?;
|
|
141
|
-
private discriminator?;
|
|
46
|
+
profile: string | undefined;
|
|
142
47
|
private log;
|
|
143
|
-
private
|
|
144
|
-
private registeredPlugins;
|
|
48
|
+
private plugins;
|
|
145
49
|
private registeredDevices;
|
|
146
50
|
private nodeStorage;
|
|
147
51
|
private nodeContext;
|
|
52
|
+
private matterStorageName;
|
|
53
|
+
private nodeStorageName;
|
|
54
|
+
private hasCleanupStarted;
|
|
55
|
+
private initialized;
|
|
56
|
+
private execRunningCount;
|
|
57
|
+
private cleanupTimeout1;
|
|
58
|
+
private cleanupTimeout2;
|
|
59
|
+
private checkUpdateInterval;
|
|
60
|
+
private configureTimeout;
|
|
61
|
+
private reachabilityTimeout;
|
|
62
|
+
private sigintHandler;
|
|
63
|
+
private sigtermHandler;
|
|
148
64
|
private expressApp;
|
|
149
65
|
private httpServer;
|
|
150
66
|
private httpsServer;
|
|
151
67
|
private webSocketServer;
|
|
68
|
+
private mdnsInterface;
|
|
69
|
+
private port;
|
|
70
|
+
private passcode?;
|
|
71
|
+
private discriminator?;
|
|
152
72
|
private storageManager;
|
|
153
73
|
private matterbridgeContext;
|
|
154
74
|
private mattercontrollerContext;
|
|
@@ -158,6 +78,9 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
158
78
|
private commissioningController;
|
|
159
79
|
private static instance;
|
|
160
80
|
private constructor();
|
|
81
|
+
/** ***********************************************************************************************************************************/
|
|
82
|
+
/** loadInstance() and cleanup() methods */
|
|
83
|
+
/** ***********************************************************************************************************************************/
|
|
161
84
|
/**
|
|
162
85
|
* Loads an instance of the Matterbridge class.
|
|
163
86
|
* If an instance already exists, return that instance.
|
|
@@ -167,32 +90,11 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
167
90
|
*/
|
|
168
91
|
static loadInstance(initialize?: boolean): Promise<Matterbridge>;
|
|
169
92
|
/**
|
|
170
|
-
* Call
|
|
171
|
-
* @deprecated This method is deprecated and is only used for jest.
|
|
93
|
+
* Call cleanup().
|
|
94
|
+
* @deprecated This method is deprecated and is only used for jest tests.
|
|
172
95
|
*
|
|
173
96
|
*/
|
|
174
97
|
destroyInstance(): Promise<void>;
|
|
175
|
-
/**
|
|
176
|
-
* Initializes the Matterbridge instance as extension for zigbee2mqtt.
|
|
177
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
178
|
-
*
|
|
179
|
-
* @returns A Promise that resolves when the initialization is complete.
|
|
180
|
-
*/
|
|
181
|
-
startExtension(dataPath: string, debugEnabled: boolean, extensionVersion: string, port?: number): Promise<boolean>;
|
|
182
|
-
/**
|
|
183
|
-
* Close the Matterbridge instance as extension for zigbee2mqtt.
|
|
184
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
185
|
-
*
|
|
186
|
-
* @returns A Promise that resolves when the initialization is complete.
|
|
187
|
-
*/
|
|
188
|
-
stopExtension(): Promise<void>;
|
|
189
|
-
/**
|
|
190
|
-
* Checks if the extension is commissioned.
|
|
191
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
192
|
-
*
|
|
193
|
-
* @returns {boolean} Returns true if the extension is commissioned, false otherwise.
|
|
194
|
-
*/
|
|
195
|
-
isExtensionCommissioned(): boolean;
|
|
196
98
|
/**
|
|
197
99
|
* Initializes the Matterbridge application.
|
|
198
100
|
*
|
|
@@ -210,28 +112,49 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
210
112
|
* @returns {Promise<void>} A promise that resolves when the command line arguments have been processed, or the process exits.
|
|
211
113
|
*/
|
|
212
114
|
private parseCommandLine;
|
|
213
|
-
private savePluginsToStorage;
|
|
214
|
-
private loadPluginsFromStorage;
|
|
215
115
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* @returns The path to the resolved package.json file, or null if the package.json file is not found or does not contain a name.
|
|
116
|
+
* Registers the signal handlers for SIGINT and SIGTERM.
|
|
117
|
+
* When either of these signals are received, the cleanup method is called with an appropriate message.
|
|
219
118
|
*/
|
|
220
|
-
private
|
|
119
|
+
private registerSignalHandlers;
|
|
221
120
|
/**
|
|
222
|
-
*
|
|
223
|
-
* @param packageJsonPath - The path to the package.json file of the plugin.
|
|
224
|
-
* @param mode - The mode of operation. Possible values are 'add', 'remove', 'enable', 'disable'.
|
|
225
|
-
* @returns A Promise that resolves when the plugin is loaded successfully, or rejects with an error if loading fails.
|
|
121
|
+
* Deregisters the SIGINT and SIGTERM signal handlers.
|
|
226
122
|
*/
|
|
227
|
-
private
|
|
123
|
+
private deregisterSignalHandlers;
|
|
228
124
|
/**
|
|
229
|
-
*
|
|
230
|
-
* When either of these signals are received, the cleanup method is called with an appropriate message.
|
|
125
|
+
* Logs the node and system information.
|
|
231
126
|
*/
|
|
232
|
-
private
|
|
127
|
+
private logNodeAndSystemInfo;
|
|
233
128
|
/**
|
|
234
|
-
*
|
|
129
|
+
* Retrieves the latest version of a package from the npm registry.
|
|
130
|
+
* @param packageName - The name of the package.
|
|
131
|
+
* @returns A Promise that resolves to the latest version of the package.
|
|
132
|
+
*/
|
|
133
|
+
private getLatestVersion;
|
|
134
|
+
/**
|
|
135
|
+
* Retrieves the path to the global Node.js modules directory.
|
|
136
|
+
* @returns A promise that resolves to the path of the global Node.js modules directory.
|
|
137
|
+
*/
|
|
138
|
+
private getGlobalNodeModules;
|
|
139
|
+
/**
|
|
140
|
+
* Retrieves the latest version of Matterbridge and performs necessary actions based on the version comparison.
|
|
141
|
+
* @private
|
|
142
|
+
* @returns {Promise<void>} A promise that resolves when the latest version is retrieved and actions are performed.
|
|
143
|
+
*/
|
|
144
|
+
private getMatterbridgeLatestVersion;
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves the latest version of a plugin and updates the plugin's latestVersion property.
|
|
147
|
+
* If the plugin's version is different from the latest version, logs a warning message.
|
|
148
|
+
* If the plugin's version is the same as the latest version, logs an info message.
|
|
149
|
+
* If there is an error retrieving the latest version, logs an error message.
|
|
150
|
+
*
|
|
151
|
+
* @private
|
|
152
|
+
* @param {RegisteredPlugin} plugin - The plugin for which to retrieve the latest version.
|
|
153
|
+
* @returns {Promise<void>} A promise that resolves when the latest version is retrieved and actions are performed.
|
|
154
|
+
*/
|
|
155
|
+
private getPluginLatestVersion;
|
|
156
|
+
/**
|
|
157
|
+
* Update matterbridge and cleanup.
|
|
235
158
|
*/
|
|
236
159
|
private updateProcess;
|
|
237
160
|
/**
|
|
@@ -282,26 +205,6 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
282
205
|
* @returns A promise that resolves when all devices have been removed.
|
|
283
206
|
*/
|
|
284
207
|
removeAllBridgedDevices(pluginName: string): Promise<void>;
|
|
285
|
-
/**
|
|
286
|
-
* Starts the storage process based on the specified storage type and name.
|
|
287
|
-
* @param {string} storageType - The type of storage to start (e.g., 'disk', 'json').
|
|
288
|
-
* @param {string} storageName - The name of the storage file.
|
|
289
|
-
* @returns {Promise<void>} - A promise that resolves when the storage process is started.
|
|
290
|
-
*/
|
|
291
|
-
private startStorage;
|
|
292
|
-
/**
|
|
293
|
-
* Makes a backup copy of the specified JSON storage file.
|
|
294
|
-
*
|
|
295
|
-
* @param storageName - The name of the JSON storage file to be backed up.
|
|
296
|
-
* @param backupName - The name of the backup file to be created.
|
|
297
|
-
*/
|
|
298
|
-
private backupJsonStorage;
|
|
299
|
-
/**
|
|
300
|
-
* Stops the storage.
|
|
301
|
-
* @returns {Promise<void>} A promise that resolves when the storage is stopped.
|
|
302
|
-
*/
|
|
303
|
-
private stopStorage;
|
|
304
|
-
private testStartMatterBridge;
|
|
305
208
|
/**
|
|
306
209
|
* Loads the schema for a plugin.
|
|
307
210
|
* If the schema file exists in the plugin directory, it reads the file and returns the parsed JSON data and delete the schema form .matterbridge.
|
|
@@ -311,13 +214,6 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
311
214
|
* @returns A promise that resolves to the loaded or created schema.
|
|
312
215
|
*/
|
|
313
216
|
private loadPluginSchema;
|
|
314
|
-
/**
|
|
315
|
-
* Saves the plugin configuration to a JSON file.
|
|
316
|
-
* @param plugin - The registered plugin.
|
|
317
|
-
* @param config - The platform configuration.
|
|
318
|
-
* @returns A promise that resolves when the configuration is saved successfully, or with an error logged.
|
|
319
|
-
*/
|
|
320
|
-
private savePluginConfigFromJson;
|
|
321
217
|
/**
|
|
322
218
|
* Loads the configuration for a plugin.
|
|
323
219
|
* If the configuration file exists, it reads the file and returns the parsed JSON data.
|
|
@@ -343,6 +239,15 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
343
239
|
* @returns {Promise<void>} - A promise that resolves when the data is successfully written to the file.
|
|
344
240
|
*/
|
|
345
241
|
private writeFile;
|
|
242
|
+
/**
|
|
243
|
+
* Loads a plugin and returns the corresponding MatterbridgePlatform instance.
|
|
244
|
+
* @param plugin - The plugin to load.
|
|
245
|
+
* @param start - Optional flag indicating whether to start the plugin after loading. Default is false.
|
|
246
|
+
* @param message - Optional message to pass to the plugin when starting.
|
|
247
|
+
* @returns A Promise that resolves to the loaded MatterbridgePlatform instance.
|
|
248
|
+
* @throws An error if the plugin is not enabled, already loaded, or fails to load.
|
|
249
|
+
*/
|
|
250
|
+
private loadPlugin;
|
|
346
251
|
/**
|
|
347
252
|
* Starts a plugin.
|
|
348
253
|
*
|
|
@@ -359,50 +264,76 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
359
264
|
* @returns {Promise<void>} A promise that resolves when the plugin is configured successfully, or rejects with an error if configuration fails.
|
|
360
265
|
*/
|
|
361
266
|
private configurePlugin;
|
|
267
|
+
private startTest;
|
|
362
268
|
/**
|
|
363
|
-
*
|
|
364
|
-
* @
|
|
365
|
-
* @returns A
|
|
269
|
+
* Starts the Matterbridge in bridge mode.
|
|
270
|
+
* @private
|
|
271
|
+
* @returns {Promise<void>} A promise that resolves when the Matterbridge is started.
|
|
366
272
|
*/
|
|
367
|
-
private
|
|
273
|
+
private startBridge;
|
|
368
274
|
/**
|
|
369
|
-
*
|
|
370
|
-
* @
|
|
371
|
-
* @
|
|
372
|
-
* @param message - Optional message to pass to the plugin when starting.
|
|
373
|
-
* @returns A Promise that resolves to the loaded MatterbridgePlatform instance.
|
|
374
|
-
* @throws An error if the plugin is not enabled, already loaded, or fails to load.
|
|
275
|
+
* Starts the Matterbridge in childbridge mode.
|
|
276
|
+
* @private
|
|
277
|
+
* @returns {Promise<void>} A promise that resolves when the Matterbridge is started.
|
|
375
278
|
*/
|
|
376
|
-
private
|
|
279
|
+
private startChildbridge;
|
|
377
280
|
/**
|
|
378
281
|
* Starts the Matterbridge controller.
|
|
379
282
|
* @private
|
|
380
283
|
* @returns {Promise<void>} A promise that resolves when the Matterbridge is started.
|
|
381
284
|
*/
|
|
382
|
-
private
|
|
285
|
+
private startController;
|
|
286
|
+
/** ***********************************************************************************************************************************/
|
|
287
|
+
/** Matter.js methods */
|
|
288
|
+
/** ***********************************************************************************************************************************/
|
|
383
289
|
/**
|
|
384
|
-
* Starts the
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
290
|
+
* Starts the matter storage process based on the specified storage type and name.
|
|
291
|
+
* @param {string} storageType - The type of storage to start (e.g., 'disk', 'json').
|
|
292
|
+
* @param {string} storageName - The name of the storage file.
|
|
293
|
+
* @returns {Promise<void>} - A promise that resolves when the storage process is started.
|
|
294
|
+
*/
|
|
295
|
+
private startStorage;
|
|
296
|
+
/**
|
|
297
|
+
* Makes a backup copy of the specified matter JSON storage file.
|
|
298
|
+
*
|
|
299
|
+
* @param storageName - The name of the JSON storage file to be backed up.
|
|
300
|
+
* @param backupName - The name of the backup file to be created.
|
|
301
|
+
*/
|
|
302
|
+
private backupJsonStorage;
|
|
303
|
+
/**
|
|
304
|
+
* Stops the matter storage.
|
|
305
|
+
* @returns {Promise<void>} A promise that resolves when the storage is stopped.
|
|
306
|
+
*/
|
|
307
|
+
private stopStorage;
|
|
308
|
+
/**
|
|
309
|
+
* Creates a Matter server using the provided storage manager and the provided mdnsInterface.
|
|
310
|
+
* @param storageManager The storage manager to be used by the Matter server.
|
|
311
|
+
*
|
|
391
312
|
*/
|
|
392
|
-
private
|
|
313
|
+
private createMatterServer;
|
|
393
314
|
/**
|
|
394
315
|
* Starts the Matter server.
|
|
395
316
|
* If the Matter server is not initialized, it logs an error and performs cleanup.
|
|
396
317
|
*/
|
|
397
318
|
private startMatterServer;
|
|
398
319
|
/**
|
|
399
|
-
*
|
|
400
|
-
* @param pluginName - The name of the plugin.
|
|
401
|
-
* @param device - The MatterbridgeDevice object representing the device.
|
|
402
|
-
* @returns The commissioning server context.
|
|
403
|
-
* @throws Error if the BasicInformationCluster is not found.
|
|
320
|
+
* Stops the Matter server, commissioningServer and commissioningController.
|
|
404
321
|
*/
|
|
405
|
-
private
|
|
322
|
+
private stopMatterServer;
|
|
323
|
+
/**
|
|
324
|
+
* Creates a Matter Aggregator.
|
|
325
|
+
* @param {StorageContext} context - The storage context.
|
|
326
|
+
* @returns {Aggregator} - The created Matter Aggregator.
|
|
327
|
+
*/
|
|
328
|
+
private createMatterAggregator;
|
|
329
|
+
/**
|
|
330
|
+
* Creates a matter commissioning server.
|
|
331
|
+
*
|
|
332
|
+
* @param {StorageContext} context - The storage context.
|
|
333
|
+
* @param {string} pluginName - The name of the commissioning server.
|
|
334
|
+
* @returns {CommissioningServer} The created commissioning server.
|
|
335
|
+
*/
|
|
336
|
+
private createCommisioningServer;
|
|
406
337
|
/**
|
|
407
338
|
* Creates a commissioning server storage context.
|
|
408
339
|
*
|
|
@@ -423,11 +354,19 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
423
354
|
*/
|
|
424
355
|
private createCommissioningServerContext;
|
|
425
356
|
/**
|
|
426
|
-
*
|
|
357
|
+
* Imports the commissioning server context for a specific plugin and device.
|
|
358
|
+
* @param pluginName - The name of the plugin.
|
|
359
|
+
* @param device - The MatterbridgeDevice object representing the device.
|
|
360
|
+
* @returns The commissioning server context.
|
|
361
|
+
* @throws Error if the BasicInformationCluster is not found.
|
|
362
|
+
*/
|
|
363
|
+
private importCommissioningServerContext;
|
|
364
|
+
/**
|
|
365
|
+
* Shows the commissioning server QR code for a given plugin.
|
|
427
366
|
* @param {CommissioningServer} commissioningServer - The commissioning server instance.
|
|
428
367
|
* @param {StorageContext} storageContext - The storage context instance.
|
|
429
368
|
* @param {NodeStorage} nodeContext - The node storage instance.
|
|
430
|
-
* @param {string} pluginName - The name of the plugin.
|
|
369
|
+
* @param {string} pluginName - The name of the plugin of Matterbridge in bridge mode.
|
|
431
370
|
* @returns {Promise<void>} - A promise that resolves when the QR code is shown.
|
|
432
371
|
*/
|
|
433
372
|
private showCommissioningQRCode;
|
|
@@ -445,13 +384,6 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
445
384
|
* @returns An array of sanitized session information objects.
|
|
446
385
|
*/
|
|
447
386
|
private sanitizeSessionInformation;
|
|
448
|
-
/**
|
|
449
|
-
* Finds a plugin by its name.
|
|
450
|
-
*
|
|
451
|
-
* @param pluginName - The name of the plugin to find.
|
|
452
|
-
* @returns The found plugin, or undefined if not found.
|
|
453
|
-
*/
|
|
454
|
-
private findPlugin;
|
|
455
387
|
/**
|
|
456
388
|
* Sets the reachability of a commissioning server and trigger.
|
|
457
389
|
*
|
|
@@ -474,65 +406,9 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
474
406
|
private setDeviceReachability;
|
|
475
407
|
private getVendorIdName;
|
|
476
408
|
/**
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* @
|
|
480
|
-
* @param {string} pluginName - The name of the commissioning server.
|
|
481
|
-
* @returns {CommissioningServer} The created commissioning server.
|
|
482
|
-
*/
|
|
483
|
-
private createCommisioningServer;
|
|
484
|
-
/**
|
|
485
|
-
* Creates a Matter server using the provided storage manager and the provided mdnsInterface.
|
|
486
|
-
* @param storageManager The storage manager to be used by the Matter server.
|
|
487
|
-
*
|
|
488
|
-
*/
|
|
489
|
-
private createMatterServer;
|
|
490
|
-
/**
|
|
491
|
-
* Creates a Matter Aggregator.
|
|
492
|
-
* @param {StorageContext} context - The storage context.
|
|
493
|
-
* @returns {Aggregator} - The created Matter Aggregator.
|
|
494
|
-
*/
|
|
495
|
-
private createMatterAggregator;
|
|
496
|
-
/**
|
|
497
|
-
* Stops the Matter server and associated controllers.
|
|
498
|
-
*/
|
|
499
|
-
private stopMatter;
|
|
500
|
-
/**
|
|
501
|
-
* Retrieves the latest version of a package from the npm registry.
|
|
502
|
-
* @param packageName - The name of the package.
|
|
503
|
-
* @returns A Promise that resolves to the latest version of the package.
|
|
504
|
-
*/
|
|
505
|
-
private getLatestVersion;
|
|
506
|
-
/**
|
|
507
|
-
* Retrieves the path to the global Node.js modules directory.
|
|
508
|
-
* @returns A promise that resolves to the path of the global Node.js modules directory.
|
|
509
|
-
*/
|
|
510
|
-
private getGlobalNodeModules;
|
|
511
|
-
/**
|
|
512
|
-
* Logs the node and system information.
|
|
513
|
-
*/
|
|
514
|
-
private logNodeAndSystemInfo;
|
|
515
|
-
/**
|
|
516
|
-
* Retrieves the latest version of Matterbridge and performs necessary actions based on the version comparison.
|
|
517
|
-
* @private
|
|
518
|
-
* @returns {Promise<void>} A promise that resolves when the latest version is retrieved and actions are performed.
|
|
519
|
-
*/
|
|
520
|
-
private getMatterbridgeLatestVersion;
|
|
521
|
-
/**
|
|
522
|
-
* Retrieves the latest version of a plugin and updates the plugin's latestVersion property.
|
|
523
|
-
* If the plugin's version is different from the latest version, logs a warning message.
|
|
524
|
-
* If the plugin's version is the same as the latest version, logs an info message.
|
|
525
|
-
* If there is an error retrieving the latest version, logs an error message.
|
|
526
|
-
*
|
|
527
|
-
* @private
|
|
528
|
-
* @param {RegisteredPlugin} plugin - The plugin for which to retrieve the latest version.
|
|
529
|
-
* @returns {Promise<void>} A promise that resolves when the latest version is retrieved and actions are performed.
|
|
530
|
-
*/
|
|
531
|
-
private getPluginLatestVersion;
|
|
532
|
-
/**
|
|
533
|
-
* Retrieves an array of base registered plugins.
|
|
534
|
-
*
|
|
535
|
-
* @returns {BaseRegisteredPlugin[]} An array of base registered plugins.
|
|
409
|
+
* Retrieves the base registered plugins sanitized for res.json().
|
|
410
|
+
* @param {boolean} includeAll - Whether to include all information for each plugin.
|
|
411
|
+
* @returns {BaseRegisteredPlugin[]} A promise that resolves to an array of BaseRegisteredPlugin objects.
|
|
536
412
|
*/
|
|
537
413
|
private getBaseRegisteredPlugins;
|
|
538
414
|
/**
|
|
@@ -553,7 +429,7 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
553
429
|
/**
|
|
554
430
|
* Initializes the frontend of Matterbridge.
|
|
555
431
|
*
|
|
556
|
-
* @param port The port number to run the frontend server on. Default is
|
|
432
|
+
* @param port The port number to run the frontend server on. Default is 8283.
|
|
557
433
|
*/
|
|
558
434
|
initializeFrontend(port?: number): Promise<void>;
|
|
559
435
|
/**
|
|
@@ -562,6 +438,26 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
562
438
|
* @returns The attributes of the cluster servers in the device.
|
|
563
439
|
*/
|
|
564
440
|
private getClusterTextFromDevice;
|
|
441
|
+
/**
|
|
442
|
+
* Initializes the Matterbridge instance as extension for zigbee2mqtt.
|
|
443
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
444
|
+
*
|
|
445
|
+
* @returns A Promise that resolves when the initialization is complete.
|
|
446
|
+
*/
|
|
447
|
+
startExtension(dataPath: string, debugEnabled: boolean, extensionVersion: string, port?: number): Promise<boolean>;
|
|
448
|
+
/**
|
|
449
|
+
* Close the Matterbridge instance as extension for zigbee2mqtt.
|
|
450
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
451
|
+
*
|
|
452
|
+
* @returns A Promise that resolves when the initialization is complete.
|
|
453
|
+
*/
|
|
454
|
+
stopExtension(): Promise<void>;
|
|
455
|
+
/**
|
|
456
|
+
* Checks if the extension is commissioned.
|
|
457
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
458
|
+
*
|
|
459
|
+
* @returns {boolean} Returns true if the extension is commissioned, false otherwise.
|
|
460
|
+
*/
|
|
461
|
+
isExtensionCommissioned(): boolean;
|
|
565
462
|
}
|
|
566
|
-
export {};
|
|
567
463
|
//# sourceMappingURL=matterbridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAUH,OAAO,YAAY,MAAM,QAAQ,CAAC;AAOlC,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;AAK3F,OAAO,EAAwB,uBAAuB,EAAsC,iCAAiC,EAAE,2BAA2B,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAqBlO;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IACrC,iBAAiB,EAAE,iBAAiB,CAezC;IAEK,uBAAuB,EAAE,uBAAuB,CAgBrD;IAEK,aAAa,SAAM;IACnB,aAAa,SAAM;IACnB,qBAAqB,SAAM;IAC3B,2BAA2B,SAAM;IACjC,sBAAsB,SAAM;IAC5B,mBAAmB,SAAM;IACzB,yBAAyB,SAAM;IAC/B,8BAA8B,EAAE,iCAAiC,EAAE,CAAM;IACzE,+BAA+B,EAAE,2BAA2B,EAAE,CAAM;IACpE,kBAAkB,UAAS;IAC3B,qBAAqB,UAAS;IAC9B,UAAU,EAAE,QAAQ,GAAG,aAAa,GAAG,YAAY,GAAG,EAAE,CAAM;IAC9D,WAAW,EAAE,SAAS,GAAG,QAAQ,GAAG,EAAE,CAAM;IAC5C,YAAY,UAAS;IACrB,OAAO,qBAA2B;IAEzC,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,WAAW,CAA0B;IAC7C,OAAO,CAAC,iBAAiB,CAA6F;IACtH,OAAO,CAAC,eAAe,CAA8E;IAGrG,OAAO,C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