matterbridge 2.0.0-edge1 → 2.0.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 +15 -2
- package/dist/cli.d.ts +25 -0
- package/dist/cli.js +0 -0
- package/dist/cluster/export.d.ts +2 -0
- package/dist/defaultConfigSchema.d.ts +27 -0
- package/dist/deviceManager.d.ts +3 -3
- package/dist/deviceManager.d.ts.map +1 -1
- package/dist/deviceManager.js +2 -2
- package/dist/deviceManager.js.map +1 -1
- package/dist/frontend.d.ts +3 -3
- package/dist/frontend.d.ts.map +1 -1
- package/dist/frontend.js +60 -21
- package/dist/frontend.js.map +1 -1
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/logger/export.d.ts +2 -0
- package/dist/matter/export.d.ts +10 -0
- package/dist/matterbridge.d.ts +21 -22
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +68 -54
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeAccessoryPlatform.d.ts +39 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -1
- package/dist/matterbridgeBehaviors.d.ts +870 -30
- package/dist/matterbridgeBehaviors.d.ts.map +1 -1
- package/dist/matterbridgeBehaviors.js +18 -3
- package/dist/matterbridgeBehaviors.js.map +1 -1
- package/dist/matterbridgeDeviceTypes.d.ts +72 -4
- package/dist/matterbridgeDeviceTypes.d.ts.map +1 -1
- package/dist/matterbridgeDeviceTypes.js +110 -3
- package/dist/matterbridgeDeviceTypes.js.map +1 -1
- package/dist/matterbridgeDynamicPlatform.d.ts +39 -0
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -1
- package/dist/matterbridgeEndpoint.d.ts +9155 -68
- package/dist/matterbridgeEndpoint.d.ts.map +1 -1
- package/dist/matterbridgeEndpoint.js +115 -23
- package/dist/matterbridgeEndpoint.js.map +1 -1
- package/dist/matterbridgeEndpointDefault.d.ts +2 -0
- package/dist/matterbridgeEndpointDefault.d.ts.map +1 -0
- package/dist/matterbridgeEndpointDefault.js +159 -0
- package/dist/matterbridgeEndpointDefault.js.map +1 -0
- package/dist/matterbridgePlatform.d.ts +26 -16
- package/dist/matterbridgePlatform.d.ts.map +1 -1
- package/dist/matterbridgePlatform.js +8 -7
- package/dist/matterbridgePlatform.js.map +1 -1
- package/dist/matterbridgeTypes.d.ts +167 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -1
- package/dist/pluginManager.d.ts +2 -2
- package/dist/pluginManager.d.ts.map +1 -1
- package/dist/pluginManager.js +9 -16
- package/dist/pluginManager.js.map +1 -1
- package/dist/storage/export.d.ts +2 -0
- package/dist/utils/colorUtils.d.ts +61 -0
- package/dist/utils/export.d.ts +3 -0
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +8 -9
- package/dist/utils/utils.js.map +1 -1
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.ea28015b.js → main.6df4ebe4.js} +3 -3
- package/frontend/build/static/js/{main.ea28015b.js.map → main.6df4ebe4.js.map} +1 -1
- package/npm-shrinkwrap.json +16 -13
- package/package.json +2 -2
- /package/frontend/build/static/js/{main.ea28015b.js.LICENSE.txt → main.6df4ebe4.js.LICENSE.txt} +0 -0
package/dist/matterbridge.js
CHANGED
|
@@ -29,19 +29,19 @@ import os from 'os';
|
|
|
29
29
|
import path from 'path';
|
|
30
30
|
import { randomBytes } from 'crypto';
|
|
31
31
|
// NodeStorage and AnsiLogger modules
|
|
32
|
-
import { NodeStorageManager } from '
|
|
33
|
-
import { AnsiLogger,
|
|
32
|
+
import { NodeStorageManager } from './storage/export.js';
|
|
33
|
+
import { AnsiLogger, UNDERLINE, UNDERLINEOFF, YELLOW, db, debugStringify, BRIGHT, RESET, er, nf, rs, wr, RED, GREEN, zb, CYAN, nt } from './logger/export.js';
|
|
34
34
|
// Matterbridge
|
|
35
35
|
import { logInterfaces, wait, waiter, copyDirectory, getParameter, getIntParameter, hasParameter } from './utils/utils.js';
|
|
36
36
|
import { PluginManager } from './pluginManager.js';
|
|
37
37
|
import { DeviceManager } from './deviceManager.js';
|
|
38
38
|
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
39
39
|
import { bridge } from './matterbridgeDeviceTypes.js';
|
|
40
|
+
import { Frontend } from './frontend.js';
|
|
40
41
|
// @matter
|
|
41
42
|
import { DeviceTypeId, Endpoint as EndpointNode, Logger, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, VendorId, StorageService, Environment, ServerNode } from '@matter/main';
|
|
42
43
|
import { FabricAction, PaseClient } from '@matter/main/protocol';
|
|
43
44
|
import { AggregatorEndpoint } from '@matter/main/endpoints';
|
|
44
|
-
import { Frontend } from './frontend.js';
|
|
45
45
|
// Default colors
|
|
46
46
|
const plg = '\u001B[38;5;33m';
|
|
47
47
|
const dev = '\u001B[38;5;79m';
|
|
@@ -79,12 +79,11 @@ export class Matterbridge extends EventEmitter {
|
|
|
79
79
|
matterbridgeFabricInformations: [],
|
|
80
80
|
matterbridgeSessionInformations: [],
|
|
81
81
|
matterbridgePaired: false,
|
|
82
|
-
matterbridgeConnected: false,
|
|
83
82
|
bridgeMode: '',
|
|
84
83
|
restartMode: '',
|
|
85
84
|
readOnly: hasParameter('readonly'),
|
|
86
85
|
profile: getParameter('profile'),
|
|
87
|
-
loggerLevel: LogLevel.INFO
|
|
86
|
+
loggerLevel: "info" /* LogLevel.INFO */,
|
|
88
87
|
fileLogger: false,
|
|
89
88
|
matterLoggerLevel: MatterLogLevel.INFO,
|
|
90
89
|
matterFileLogger: false,
|
|
@@ -109,7 +108,6 @@ export class Matterbridge extends EventEmitter {
|
|
|
109
108
|
matterbridgeFabricInformations = [];
|
|
110
109
|
matterbridgeSessionInformations = [];
|
|
111
110
|
matterbridgePaired = false;
|
|
112
|
-
matterbridgeConnected = false;
|
|
113
111
|
bridgeMode = '';
|
|
114
112
|
restartMode = '';
|
|
115
113
|
profile = getParameter('profile');
|
|
@@ -145,12 +143,12 @@ export class Matterbridge extends EventEmitter {
|
|
|
145
143
|
matterbridgeContext;
|
|
146
144
|
mattercontrollerContext;
|
|
147
145
|
// Matter parameters
|
|
148
|
-
mdnsInterface; // matter server mdnsInterface: e.g. 'eth0' or 'wlan0' or 'WiFi'
|
|
149
|
-
ipv4address; // matter
|
|
150
|
-
ipv6address; // matter
|
|
151
|
-
port; // first
|
|
152
|
-
passcode; // first
|
|
153
|
-
discriminator; // first
|
|
146
|
+
mdnsInterface; // matter server node mdnsInterface: e.g. 'eth0' or 'wlan0' or 'WiFi'
|
|
147
|
+
ipv4address; // matter server node listeningAddressIpv4
|
|
148
|
+
ipv6address; // matter server node listeningAddressIpv6
|
|
149
|
+
port; // first server node port
|
|
150
|
+
passcode; // first server node passcode
|
|
151
|
+
discriminator; // first server node discriminator
|
|
154
152
|
serverNode;
|
|
155
153
|
aggregatorNode;
|
|
156
154
|
aggregatorVendorId = VendorId(getIntParameter('vendorId') ?? 0xfff1);
|
|
@@ -233,7 +231,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
233
231
|
this.environment.vars.set('runtime.signals', false);
|
|
234
232
|
this.environment.vars.set('runtime.exitcode', false);
|
|
235
233
|
// Create matterbridge logger
|
|
236
|
-
this.log = new AnsiLogger({ logName: 'Matterbridge', logTimestampFormat: TimestampFormat.TIME_MILLIS
|
|
234
|
+
this.log = new AnsiLogger({ logName: 'Matterbridge', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: hasParameter('debug') ? "debug" /* LogLevel.DEBUG */ : "info" /* LogLevel.INFO */ });
|
|
237
235
|
// Register process handlers
|
|
238
236
|
this.registerProcessHandlers();
|
|
239
237
|
// Initialize nodeStorage and nodeContext
|
|
@@ -294,30 +292,30 @@ export class Matterbridge extends EventEmitter {
|
|
|
294
292
|
if (hasParameter('logger')) {
|
|
295
293
|
const level = getParameter('logger');
|
|
296
294
|
if (level === 'debug') {
|
|
297
|
-
this.log.logLevel = LogLevel.DEBUG
|
|
295
|
+
this.log.logLevel = "debug" /* LogLevel.DEBUG */;
|
|
298
296
|
}
|
|
299
297
|
else if (level === 'info') {
|
|
300
|
-
this.log.logLevel = LogLevel.INFO
|
|
298
|
+
this.log.logLevel = "info" /* LogLevel.INFO */;
|
|
301
299
|
}
|
|
302
300
|
else if (level === 'notice') {
|
|
303
|
-
this.log.logLevel = LogLevel.NOTICE
|
|
301
|
+
this.log.logLevel = "notice" /* LogLevel.NOTICE */;
|
|
304
302
|
}
|
|
305
303
|
else if (level === 'warn') {
|
|
306
|
-
this.log.logLevel = LogLevel.WARN
|
|
304
|
+
this.log.logLevel = "warn" /* LogLevel.WARN */;
|
|
307
305
|
}
|
|
308
306
|
else if (level === 'error') {
|
|
309
|
-
this.log.logLevel = LogLevel.ERROR
|
|
307
|
+
this.log.logLevel = "error" /* LogLevel.ERROR */;
|
|
310
308
|
}
|
|
311
309
|
else if (level === 'fatal') {
|
|
312
|
-
this.log.logLevel = LogLevel.FATAL
|
|
310
|
+
this.log.logLevel = "fatal" /* LogLevel.FATAL */;
|
|
313
311
|
}
|
|
314
312
|
else {
|
|
315
313
|
this.log.warn(`Invalid matterbridge logger level: ${level}. Using default level "info".`);
|
|
316
|
-
this.log.logLevel = LogLevel.INFO
|
|
314
|
+
this.log.logLevel = "info" /* LogLevel.INFO */;
|
|
317
315
|
}
|
|
318
316
|
}
|
|
319
317
|
else {
|
|
320
|
-
this.log.logLevel = await this.nodeContext.get('matterbridgeLogLevel', LogLevel.INFO);
|
|
318
|
+
this.log.logLevel = await this.nodeContext.get('matterbridgeLogLevel', "info" /* LogLevel.INFO */);
|
|
321
319
|
}
|
|
322
320
|
MatterbridgeEndpoint.logLevel = this.log.logLevel;
|
|
323
321
|
// Create the file logger for matterbridge (context: matterbridgeFileLog)
|
|
@@ -675,7 +673,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
675
673
|
continue;
|
|
676
674
|
}
|
|
677
675
|
// Check if the plugin has a new version
|
|
678
|
-
this.getPluginLatestVersion(plugin); // No await do it asyncronously
|
|
676
|
+
// this.getPluginLatestVersion(plugin); // No await do it asyncronously
|
|
679
677
|
if (!plugin.enabled) {
|
|
680
678
|
this.log.info(`Plugin ${plg}${plugin.name}${nf} not enabled`);
|
|
681
679
|
continue;
|
|
@@ -685,7 +683,6 @@ export class Matterbridge extends EventEmitter {
|
|
|
685
683
|
plugin.loaded = false;
|
|
686
684
|
plugin.started = false;
|
|
687
685
|
plugin.configured = false;
|
|
688
|
-
plugin.connected = undefined;
|
|
689
686
|
plugin.registeredDevices = undefined;
|
|
690
687
|
plugin.addedDevices = undefined;
|
|
691
688
|
plugin.qrPairingCode = undefined;
|
|
@@ -819,7 +816,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
819
816
|
this.log.debug(`Root Directory: ${this.rootDirectory}`);
|
|
820
817
|
// Global node_modules directory
|
|
821
818
|
if (this.nodeContext)
|
|
822
|
-
this.globalModulesDirectory = await this.nodeContext.get('globalModulesDirectory', '');
|
|
819
|
+
this.globalModulesDirectory = this.matterbridgeInformation.globalModulesDirectory = await this.nodeContext.get('globalModulesDirectory', '');
|
|
823
820
|
// First run of Matterbridge so the node storage is empty
|
|
824
821
|
if (this.globalModulesDirectory === '') {
|
|
825
822
|
try {
|
|
@@ -832,18 +829,21 @@ export class Matterbridge extends EventEmitter {
|
|
|
832
829
|
this.log.error(`Error getting global node_modules directory: ${error}`);
|
|
833
830
|
}
|
|
834
831
|
}
|
|
832
|
+
else
|
|
833
|
+
this.log.debug(`Global node_modules Directory: ${this.globalModulesDirectory}`);
|
|
834
|
+
/* removed cause is too expensive for the shelly board and not really needed. Why should it change the globalModulesDirectory?
|
|
835
835
|
else {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
836
|
+
this.getGlobalNodeModules()
|
|
837
|
+
.then(async (globalModulesDirectory) => {
|
|
838
|
+
this.globalModulesDirectory = globalModulesDirectory;
|
|
839
|
+
this.matterbridgeInformation.globalModulesDirectory = this.globalModulesDirectory;
|
|
840
|
+
this.log.debug(`Global node_modules Directory: ${this.globalModulesDirectory}`);
|
|
841
|
+
await this.nodeContext?.set<string>('globalModulesDirectory', this.globalModulesDirectory);
|
|
842
842
|
})
|
|
843
|
-
|
|
844
|
-
|
|
843
|
+
.catch((error) => {
|
|
844
|
+
this.log.error(`Error getting global node_modules directory: ${error}`);
|
|
845
845
|
});
|
|
846
|
-
}
|
|
846
|
+
}*/
|
|
847
847
|
// Create the data directory .matterbridge in the home directory
|
|
848
848
|
this.matterbridgeDirectory = path.join(this.homeDirectory, '.matterbridge');
|
|
849
849
|
this.matterbridgeInformation.matterbridgeDirectory = this.matterbridgeDirectory;
|
|
@@ -894,14 +894,14 @@ export class Matterbridge extends EventEmitter {
|
|
|
894
894
|
this.log.debug(`Matterbridge Plugin Directory: ${this.matterbridgePluginDirectory}`);
|
|
895
895
|
// Matterbridge version
|
|
896
896
|
const packageJson = JSON.parse(await fs.readFile(path.join(this.rootDirectory, 'package.json'), 'utf-8'));
|
|
897
|
-
this.matterbridgeVersion = packageJson.version;
|
|
898
|
-
this.matterbridgeInformation.matterbridgeVersion = this.matterbridgeVersion;
|
|
897
|
+
this.matterbridgeVersion = this.matterbridgeLatestVersion = packageJson.version;
|
|
898
|
+
this.matterbridgeInformation.matterbridgeVersion = this.matterbridgeInformation.matterbridgeLatestVersion = this.matterbridgeVersion;
|
|
899
899
|
this.log.debug(`Matterbridge Version: ${this.matterbridgeVersion}`);
|
|
900
900
|
// Matterbridge latest version
|
|
901
901
|
if (this.nodeContext)
|
|
902
|
-
this.matterbridgeLatestVersion = await this.nodeContext.get('matterbridgeLatestVersion',
|
|
902
|
+
this.matterbridgeLatestVersion = await this.nodeContext.get('matterbridgeLatestVersion', this.matterbridgeVersion);
|
|
903
903
|
this.log.debug(`Matterbridge Latest Version: ${this.matterbridgeLatestVersion}`);
|
|
904
|
-
this.getMatterbridgeLatestVersion();
|
|
904
|
+
// this.getMatterbridgeLatestVersion();
|
|
905
905
|
// Current working directory
|
|
906
906
|
const currentDir = process.cwd();
|
|
907
907
|
this.log.debug(`Current Working Directory: ${currentDir}`);
|
|
@@ -933,6 +933,11 @@ export class Matterbridge extends EventEmitter {
|
|
|
933
933
|
* @returns A promise that resolves to the path of the global Node.js modules directory.
|
|
934
934
|
*/
|
|
935
935
|
async getGlobalNodeModules() {
|
|
936
|
+
/*
|
|
937
|
+
const { Module } = await import('module'); // Dynamic import to access the `Module` class
|
|
938
|
+
const globalPaths = 'globalPaths' in Module && Array.isArray(Module.globalPaths) && typeof Module.globalPaths[0] === 'string' ? (Module.globalPaths as string[])[0] : '';
|
|
939
|
+
this.log.debug('Module.globalPaths:', globalPaths);
|
|
940
|
+
*/
|
|
936
941
|
return new Promise((resolve, reject) => {
|
|
937
942
|
this.execRunningCount++;
|
|
938
943
|
exec('npm root -g', (error, stdout) => {
|
|
@@ -1000,32 +1005,32 @@ export class Matterbridge extends EventEmitter {
|
|
|
1000
1005
|
* @returns {Function} The MatterLogger function.
|
|
1001
1006
|
*/
|
|
1002
1007
|
createMatterLogger() {
|
|
1003
|
-
const matterLogger = new AnsiLogger({ logName: 'Matter', logTimestampFormat: TimestampFormat.TIME_MILLIS
|
|
1008
|
+
const matterLogger = new AnsiLogger({ logName: 'Matter', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: "debug" /* LogLevel.DEBUG */ });
|
|
1004
1009
|
return (_level, formattedLog) => {
|
|
1005
1010
|
const logger = formattedLog.slice(44, 44 + 20).trim();
|
|
1006
1011
|
const message = formattedLog.slice(65);
|
|
1007
1012
|
matterLogger.logName = logger;
|
|
1008
1013
|
switch (_level) {
|
|
1009
1014
|
case MatterLogLevel.DEBUG:
|
|
1010
|
-
matterLogger.log(LogLevel.DEBUG
|
|
1015
|
+
matterLogger.log("debug" /* LogLevel.DEBUG */, message);
|
|
1011
1016
|
break;
|
|
1012
1017
|
case MatterLogLevel.INFO:
|
|
1013
|
-
matterLogger.log(LogLevel.INFO
|
|
1018
|
+
matterLogger.log("info" /* LogLevel.INFO */, message);
|
|
1014
1019
|
break;
|
|
1015
1020
|
case MatterLogLevel.NOTICE:
|
|
1016
|
-
matterLogger.log(LogLevel.NOTICE
|
|
1021
|
+
matterLogger.log("notice" /* LogLevel.NOTICE */, message);
|
|
1017
1022
|
break;
|
|
1018
1023
|
case MatterLogLevel.WARN:
|
|
1019
|
-
matterLogger.log(LogLevel.WARN
|
|
1024
|
+
matterLogger.log("warn" /* LogLevel.WARN */, message);
|
|
1020
1025
|
break;
|
|
1021
1026
|
case MatterLogLevel.ERROR:
|
|
1022
|
-
matterLogger.log(LogLevel.ERROR
|
|
1027
|
+
matterLogger.log("error" /* LogLevel.ERROR */, message);
|
|
1023
1028
|
break;
|
|
1024
1029
|
case MatterLogLevel.FATAL:
|
|
1025
|
-
matterLogger.log(LogLevel.FATAL
|
|
1030
|
+
matterLogger.log("fatal" /* LogLevel.FATAL */, message);
|
|
1026
1031
|
break;
|
|
1027
1032
|
default:
|
|
1028
|
-
matterLogger.log(LogLevel.DEBUG
|
|
1033
|
+
matterLogger.log("debug" /* LogLevel.DEBUG */, message);
|
|
1029
1034
|
break;
|
|
1030
1035
|
}
|
|
1031
1036
|
};
|
|
@@ -1883,20 +1888,22 @@ export class Matterbridge extends EventEmitter {
|
|
|
1883
1888
|
hardwareVersionString: await storageContext.get('hardwareVersionString'),
|
|
1884
1889
|
},
|
|
1885
1890
|
});
|
|
1886
|
-
const sanitizeFabrics = (fabrics) => {
|
|
1891
|
+
const sanitizeFabrics = (fabrics, resetSessions = false) => {
|
|
1887
1892
|
// New type of fabric information: Record<FabricIndex, ExposedFabricInformation>
|
|
1888
1893
|
const sanitizedFabrics = this.sanitizeFabricInformations(Array.from(Object.values(fabrics)));
|
|
1889
1894
|
this.log.info(`Fabrics: ${debugStringify(sanitizedFabrics)}`);
|
|
1890
1895
|
if (this.bridgeMode === 'bridge') {
|
|
1891
1896
|
this.matterbridgeFabricInformations = sanitizedFabrics;
|
|
1892
|
-
|
|
1897
|
+
if (resetSessions)
|
|
1898
|
+
this.matterbridgeSessionInformations = []; // Changed cause Invoke Matterbridge.operationalCredentials.updateFabricLabel is sent after the session is created
|
|
1893
1899
|
this.matterbridgePaired = true;
|
|
1894
1900
|
}
|
|
1895
1901
|
if (this.bridgeMode === 'childbridge') {
|
|
1896
1902
|
const plugin = this.plugins.get(storeId);
|
|
1897
1903
|
if (plugin) {
|
|
1898
1904
|
plugin.fabricInformations = sanitizedFabrics;
|
|
1899
|
-
|
|
1905
|
+
if (resetSessions)
|
|
1906
|
+
plugin.sessionInformations = []; // Changed cause Invoke Matterbridge.operationalCredentials.updateFabricLabel is sent after the session is created
|
|
1900
1907
|
plugin.paired = true;
|
|
1901
1908
|
}
|
|
1902
1909
|
}
|
|
@@ -1920,7 +1927,6 @@ export class Matterbridge extends EventEmitter {
|
|
|
1920
1927
|
this.matterbridgeFabricInformations = [];
|
|
1921
1928
|
this.matterbridgeSessionInformations = [];
|
|
1922
1929
|
this.matterbridgePaired = false;
|
|
1923
|
-
this.matterbridgeConnected = false;
|
|
1924
1930
|
this.log.notice(`QR Code URL: https://project-chip.github.io/connectedhomeip/qrcode.html?data=${qrPairingCode}`);
|
|
1925
1931
|
this.log.notice(`Manual pairing code: ${manualPairingCode}`);
|
|
1926
1932
|
}
|
|
@@ -1932,7 +1938,6 @@ export class Matterbridge extends EventEmitter {
|
|
|
1932
1938
|
plugin.fabricInformations = [];
|
|
1933
1939
|
plugin.sessionInformations = [];
|
|
1934
1940
|
plugin.paired = false;
|
|
1935
|
-
plugin.connected = false;
|
|
1936
1941
|
this.log.notice(`QR Code URL: https://project-chip.github.io/connectedhomeip/qrcode.html?data=${qrPairingCode}`);
|
|
1937
1942
|
this.log.notice(`Manual pairing code: ${manualPairingCode}`);
|
|
1938
1943
|
}
|
|
@@ -1940,7 +1945,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1940
1945
|
}
|
|
1941
1946
|
else {
|
|
1942
1947
|
this.log.notice(`Server node for ${storeId} is already commissioned. Waiting for controllers to connect ...`);
|
|
1943
|
-
sanitizeFabrics(serverNode.state.commissioning.fabrics);
|
|
1948
|
+
sanitizeFabrics(serverNode.state.commissioning.fabrics, true);
|
|
1944
1949
|
}
|
|
1945
1950
|
this.frontend.wssSendRefreshRequired();
|
|
1946
1951
|
});
|
|
@@ -1953,7 +1958,16 @@ export class Matterbridge extends EventEmitter {
|
|
|
1953
1958
|
this.matterbridgeFabricInformations = [];
|
|
1954
1959
|
this.matterbridgeSessionInformations = [];
|
|
1955
1960
|
this.matterbridgePaired = false;
|
|
1956
|
-
|
|
1961
|
+
}
|
|
1962
|
+
if (this.bridgeMode === 'childbridge') {
|
|
1963
|
+
const plugin = this.plugins.get(storeId);
|
|
1964
|
+
if (plugin) {
|
|
1965
|
+
plugin.qrPairingCode = undefined;
|
|
1966
|
+
plugin.manualPairingCode = undefined;
|
|
1967
|
+
plugin.fabricInformations = [];
|
|
1968
|
+
plugin.sessionInformations = [];
|
|
1969
|
+
plugin.paired = false;
|
|
1970
|
+
}
|
|
1957
1971
|
}
|
|
1958
1972
|
this.frontend.wssSendRefreshRequired();
|
|
1959
1973
|
});
|
|
@@ -2046,7 +2060,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2046
2060
|
}
|
|
2047
2061
|
// Register and add the device to the matterbridge aggregator node
|
|
2048
2062
|
if (this.bridgeMode === 'bridge') {
|
|
2049
|
-
this.log.debug(`Adding ${plg}${pluginName}${db}:${dev}${device.deviceName}${db} to Matterbridge aggregator node`);
|
|
2063
|
+
this.log.debug(`Adding bridged endpoint ${plg}${pluginName}${db}:${dev}${device.deviceName}${db} to Matterbridge aggregator node`);
|
|
2050
2064
|
if (!this.aggregatorNode)
|
|
2051
2065
|
this.log.error('Aggregator node not found for Matterbridge');
|
|
2052
2066
|
await this.aggregatorNode?.add(device);
|
|
@@ -2057,7 +2071,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2057
2071
|
}
|
|
2058
2072
|
if (plugin.type === 'DynamicPlatform') {
|
|
2059
2073
|
plugin.locked = true;
|
|
2060
|
-
this.log.debug(`Adding ${plg}${pluginName}${db}:${dev}${device.deviceName}${db} to ${plg}${plugin.name}${db} aggregator node`);
|
|
2074
|
+
this.log.debug(`Adding bridged endpoint ${plg}${pluginName}${db}:${dev}${device.deviceName}${db} to ${plg}${plugin.name}${db} aggregator node`);
|
|
2061
2075
|
if (!plugin.aggregatorNode)
|
|
2062
2076
|
this.log.error(`Aggregator node not found for plugin ${plg}${plugin.name}${db}`);
|
|
2063
2077
|
await plugin.aggregatorNode?.add(device);
|