matterbridge 1.1.5 → 1.1.6
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 +8 -1
- package/README.md +1 -0
- package/dist/AirQualityCluster.d.ts.map +1 -1
- package/dist/AirQualityCluster.js +1 -7
- package/dist/AirQualityCluster.js.map +1 -1
- package/dist/TvocCluster.d.ts.map +1 -1
- package/dist/TvocCluster.js +1 -2
- package/dist/TvocCluster.js.map +1 -1
- package/dist/matterbridge.d.ts +1 -1
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +74 -32
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeController.d.ts +23 -1
- package/dist/matterbridgeController.d.ts.map +1 -1
- package/dist/matterbridgeController.js +364 -293
- package/dist/matterbridgeController.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +7 -1
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +24 -7
- package/dist/matterbridgeDevice.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.b6ca1c6b.js → main.e5888ebb.js} +3 -3
- package/frontend/build/static/js/main.e5888ebb.js.map +1 -0
- package/package.json +71 -70
- package/frontend/build/static/js/main.b6ca1c6b.js.map +0 -1
- /package/frontend/build/static/js/{main.b6ca1c6b.js.LICENSE.txt → main.e5888ebb.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [1.1.
|
|
5
|
+
## [1.1.6] - 2024-03-14
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- [async]: Plugins are loaded started configured fully asyncronously.
|
|
10
|
+
- [frontend]: Added configured button.
|
|
11
|
+
|
|
12
|
+
## [1.1.5] - 2024-03-12
|
|
6
13
|
|
|
7
14
|
### Added
|
|
8
15
|
|
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
|
5
5
|
|
|
6
|
+
[](https://www.npmjs.com/package/matter-history)
|
|
6
7
|
[](https://www.npmjs.com/package/node-ansi-logger)
|
|
7
8
|
[](https://www.npmjs.com/package/node-persist-manager)
|
|
8
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AirQualityCluster.d.ts","sourceRoot":"","sources":["../src/AirQualityCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"AirQualityCluster.d.ts","sourceRoot":"","sources":["../src/AirQualityCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAGlG,yBAAiB,UAAU,CAAC;IAC1B,KAAY,OAAO;QACjB,cAAc,mBAAmB;QACjC,kBAAkB,uBAAuB;QACzC,kBAAkB,uBAAuB;QACzC,uBAAuB,4BAA4B;KACpD;IAED,KAAY,cAAc;QACxB,OAAO,IAAI;QACX,IAAI,IAAI;QACR,IAAI,IAAI;QACR,QAAQ,IAAI;QACZ,IAAI,IAAI;QACR,QAAQ,IAAI;QACZ,aAAa,IAAI;KAClB;IAEM,MAAM,IAAI;;;;;;;;;;;;;MAef,CAAC;IAEI,MAAM,uBAAuB,mCAA+B,CAAC;IAC7D,MAAM,2BAA2B,mCAA+B,CAAC;IACjE,MAAM,2BAA2B,mCAA+B,CAAC;IACjE,MAAM,gCAAgC,mCAA+B,CAAC;IAEtE,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuBnB,CAAC;IAEF,KAAY,SAAS,CAAC,EAAE,SAAS,wBAAwB,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,EAAE,mBAAmB,CAAC,GAAG;QAAE,iBAAiB,EAAE,EAAE,CAAA;KAAE,GAAG,CAAC,EAAE,SAAS;QAChK,cAAc,EAAE,IAAI,CAAC;KACtB,GACG,OAAO,uBAAuB,GAC9B,EAAE,CAAC,GACP,CAAC,EAAE,SAAS;QAAE,kBAAkB,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,2BAA2B,GAAG,EAAE,CAAC,GACnF,CAAC,EAAE,SAAS;QAAE,kBAAkB,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,2BAA2B,GAAG,EAAE,CAAC,GACnF,CAAC,EAAE,SAAS;QAAE,uBAAuB,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,gCAAgC,GAAG,EAAE,CAAC,CAAC;CACjG;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,UAAU,CAAC,OAAO,CAAC;AAC1D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAqB,CAAC"}
|
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
* See the License for the specific language governing permissions and
|
|
21
21
|
* limitations under the License. *
|
|
22
22
|
*/
|
|
23
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
24
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
25
23
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
24
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
26
25
|
import { ClusterFactory } from '@project-chip/matter-node.js/cluster';
|
|
27
26
|
import { Attribute } from '@project-chip/matter-node.js/cluster';
|
|
28
27
|
import { BitFlag, BitFlags } from '@project-chip/matter-node.js/schema';
|
|
@@ -85,11 +84,6 @@ export var AirQuality;
|
|
|
85
84
|
ClusterFactory.extend(cluster, AirQuality.ExtremelyPoorAirQualityComponent, { extremelyPoorAirQuality: true });
|
|
86
85
|
return cluster;
|
|
87
86
|
});
|
|
88
|
-
const MSM = { momentarySwitchMultiPress: true };
|
|
89
|
-
const LS = { latchingSwitch: true };
|
|
90
|
-
const MS = { momentarySwitch: true };
|
|
91
|
-
const MSL = { momentarySwitchLongPress: true };
|
|
92
|
-
const MSR = { momentarySwitchRelease: true };
|
|
93
87
|
})(AirQuality || (AirQuality = {}));
|
|
94
88
|
export const AirQualityCluster = AirQuality.Cluster;
|
|
95
89
|
//# sourceMappingURL=AirQualityCluster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AirQualityCluster.js","sourceRoot":"","sources":["../src/AirQualityCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,
|
|
1
|
+
{"version":3,"file":"AirQualityCluster.js","sourceRoot":"","sources":["../src/AirQualityCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,oDAAoD;AACpD,iDAAiD;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA4B,MAAM,qCAAqC,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,MAAM,KAAW,UAAU,CAyE1B;AAzED,WAAiB,UAAU;IACzB,IAAY,OAKX;IALD,WAAY,OAAO;QACjB,4CAAiC,CAAA;QACjC,oDAAyC,CAAA;QACzC,oDAAyC,CAAA;QACzC,8DAAmD,CAAA;IACrD,CAAC,EALW,OAAO,GAAP,kBAAO,KAAP,kBAAO,QAKlB;IAED,IAAY,cAQX;IARD,WAAY,cAAc;Q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MAAM,CAAC,OAAO,EAAE,WAAA,uBAAuB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QAClF,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,WAAA,2BAA2B,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1F,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,WAAA,2BAA2B,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1F,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,WAAA,gCAAgC,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC,CAAC;QACpG,OAAO,OAAkE,CAAC;IAC5E,CAAC,CACF,CAAC;AAUJ,CAAC,EAzEgB,UAAU,KAAV,UAAU,QAyE1B;AAGD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TvocCluster.d.ts","sourceRoot":"","sources":["../src/TvocCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"TvocCluster.d.ts","sourceRoot":"","sources":["../src/TvocCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAGlG,yBAAiB,eAAe,CAAC;IAC/B,KAAY,OAAO;QACjB,kBAAkB,uBAAuB;QACzC,eAAe,oBAAoB;QACnC,WAAW,gBAAgB;QAC3B,aAAa,kBAAkB;QAC/B,eAAe,oBAAoB;QACnC,kBAAkB,uBAAuB;KAC1C;IAED,KAAY,mBAA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AI,CAAA;KAAE,GAAG,OAAO,aAAa,GAAG,EAAE,CAAC,GAChE,CAAC,EAAE,SAAS;QAAE,eAAe,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,eAAe,GAAG,EAAE,CAAC,GACpE,CAAC,EAAE,SAAS;QAAE,kBAAkB,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,kBAAkB,GAAG,EAAE,CAAC,CAAC;CAC9E;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,eAAe,CAAC,OAAO,CAAC;AACpE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0B,CAAC"}
|
package/dist/TvocCluster.js
CHANGED
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
* See the License for the specific language governing permissions and
|
|
21
21
|
* limitations under the License. *
|
|
22
22
|
*/
|
|
23
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
24
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
25
23
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
24
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
26
25
|
import { ClusterFactory, OptionalAttribute } from '@project-chip/matter-node.js/cluster';
|
|
27
26
|
import { Attribute } from '@project-chip/matter-node.js/cluster';
|
|
28
27
|
import { BitFlag, BitFlags } from '@project-chip/matter-node.js/schema';
|
package/dist/TvocCluster.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TvocCluster.js","sourceRoot":"","sources":["../src/TvocCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,
|
|
1
|
+
{"version":3,"file":"TvocCluster.js","sourceRoot":"","sources":["../src/TvocCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,oDAAoD;AACpD,iDAAiD;AACjD,OAAO,EA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CAAC,MAAM,CAAC,OAAO,EAAE,gBAAA,eAAe,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3E,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,gBAAA,kBAAkB,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QACjF,OAAO,OAAkE,CAAC;IAC5E,CAAC,CACF,CAAC;AAUJ,CAAC,EAlGgB,eAAe,KAAf,eAAe,QAkG/B;AAGD,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,OAAO,CAAC"}
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -192,7 +192,7 @@ export declare class Matterbridge {
|
|
|
192
192
|
*
|
|
193
193
|
* @param commissioningServer - The commissioning server to show the QR code for.
|
|
194
194
|
* @param storageContext - The storage context to store the pairing codes.
|
|
195
|
-
* @param
|
|
195
|
+
* @param pluginName - The name of the commissioning server.
|
|
196
196
|
*/
|
|
197
197
|
private showCommissioningQRCode;
|
|
198
198
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;AAuE3F,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;GAEG;AACH,qBAAa,YAAY;IAChB,iBAA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AS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B9E;;;;;OAKG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BrF;;;;;OAKG;YACW,YAAY;IAyB1B;;;;;OAKG;YACW,iBAAiB;IAkB/B;;;OAGG;YACW,WAAW;YAMX,qBAAqB;YA+BrB,WAAW;YA6BX,eAAe;YA4Bf,UAAU;IA+CxB;;;;;;;;OAQG;YACW,iBAAiB;YAgHjB,iBAAiB;IAM/B;;;;;;OAMG;IACH,OAAO,CAAC,gCAAgC;IAwBxC;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,gCAAgC;IAmCxC;;;;;;;;;;OAUG;YACW,uBAAuB;IA4BrC;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IASlB;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAgHhC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAK1B;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAuC9B;;OAEG;YACW,UAAU;IAUxB;;OAEG;YACW,oBAAoB;IAoFlC,OAAO,CAAC,wBAAwB;IAmBhC,OAAO,CAAC,wBAAwB;IAkBhC;;;;OAIG;IACG,kBAAkB,CAAC,IAAI,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA+G5D;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;CAsBjC"}
|
package/dist/matterbridge.js
CHANGED
|
@@ -174,8 +174,15 @@ export class Matterbridge {
|
|
|
174
174
|
async parseCommandLine() {
|
|
175
175
|
if (hasParameter('list')) {
|
|
176
176
|
this.log.info('Registered plugins:');
|
|
177
|
-
this.registeredPlugins.forEach((plugin) => {
|
|
178
|
-
|
|
177
|
+
this.registeredPlugins.forEach((plugin, index) => {
|
|
178
|
+
if (index === this.registeredPlugins.length - 1) {
|
|
179
|
+
this.log.info(`└─┬─ ${plg}${plugin.name}${nf}: "${plg}${BRIGHT}${plugin.description}${RESET}${nf}" type: ${typ}${plugin.type}${nf} ${YELLOW}${plugin.enabled ? 'enabled' : 'disabled'}${nf}`);
|
|
180
|
+
this.log.info(` └─ ${db}${plugin.path}${db}`);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.log.info(`├─┬─ ${plg}${plugin.name}${nf}: "${plg}${BRIGHT}${plugin.description}${RESET}${nf}" type: ${typ}${plugin.type}${nf} ${YELLOW}${plugin.enabled ? 'enabled' : 'disabled'}${nf}`);
|
|
184
|
+
this.log.info(`│ └─ ${db}${plugin.path}${db}`);
|
|
185
|
+
}
|
|
179
186
|
});
|
|
180
187
|
process.exit(0);
|
|
181
188
|
}
|
|
@@ -216,6 +223,10 @@ export class Matterbridge {
|
|
|
216
223
|
for (const plugin of this.registeredPlugins) {
|
|
217
224
|
if (!plugin.enabled)
|
|
218
225
|
continue;
|
|
226
|
+
plugin.loaded = false;
|
|
227
|
+
plugin.started = false;
|
|
228
|
+
plugin.configured = false;
|
|
229
|
+
plugin.connected = undefined;
|
|
219
230
|
this.loadPlugin(plugin); // No await do it asyncronously
|
|
220
231
|
}
|
|
221
232
|
await this.startMatterBridge();
|
|
@@ -226,7 +237,11 @@ export class Matterbridge {
|
|
|
226
237
|
for (const plugin of this.registeredPlugins) {
|
|
227
238
|
if (!plugin.enabled)
|
|
228
239
|
continue;
|
|
229
|
-
|
|
240
|
+
plugin.loaded = false;
|
|
241
|
+
plugin.started = false;
|
|
242
|
+
plugin.configured = false;
|
|
243
|
+
plugin.connected = false;
|
|
244
|
+
this.loadPlugin(plugin, true, 'Matterbridge is starting'); // No await do it asyncronously
|
|
230
245
|
}
|
|
231
246
|
await this.startMatterBridge();
|
|
232
247
|
}
|
|
@@ -276,6 +291,10 @@ export class Matterbridge {
|
|
|
276
291
|
const plugin = this.registeredPlugins.find((registeredPlugin) => registeredPlugin.name === packageJson.name);
|
|
277
292
|
if (plugin) {
|
|
278
293
|
plugin.enabled = true;
|
|
294
|
+
plugin.loaded = undefined;
|
|
295
|
+
plugin.started = undefined;
|
|
296
|
+
plugin.configured = undefined;
|
|
297
|
+
plugin.connected = undefined;
|
|
279
298
|
await this.nodeContext?.set('plugins', this.getBaseRegisteredPlugins());
|
|
280
299
|
this.log.info(`Plugin ${plg}${packageJsonPath}${nf} enabled`);
|
|
281
300
|
}
|
|
@@ -287,6 +306,10 @@ export class Matterbridge {
|
|
|
287
306
|
const plugin = this.registeredPlugins.find((registeredPlugin) => registeredPlugin.name === packageJson.name);
|
|
288
307
|
if (plugin) {
|
|
289
308
|
plugin.enabled = false;
|
|
309
|
+
plugin.loaded = undefined;
|
|
310
|
+
plugin.started = undefined;
|
|
311
|
+
plugin.configured = undefined;
|
|
312
|
+
plugin.connected = undefined;
|
|
290
313
|
await this.nodeContext?.set('plugins', this.getBaseRegisteredPlugins());
|
|
291
314
|
this.log.info(`Plugin ${plg}${packageJsonPath}${nf} disabled`);
|
|
292
315
|
}
|
|
@@ -347,14 +370,17 @@ export class Matterbridge {
|
|
|
347
370
|
await this.stopMatter();
|
|
348
371
|
// Closing storage
|
|
349
372
|
await this.stopStorage();
|
|
373
|
+
// Serialize registeredDevices
|
|
350
374
|
const serializedRegisteredDevices = [];
|
|
351
375
|
this.registeredDevices.forEach((registeredDevice) => {
|
|
352
376
|
serializedRegisteredDevices.push(registeredDevice.device.serialize(registeredDevice.plugin));
|
|
353
377
|
});
|
|
354
378
|
//console.log('serializedRegisteredDevices:', serializedRegisteredDevices);
|
|
355
379
|
await this.nodeContext?.set('devices', serializedRegisteredDevices);
|
|
356
|
-
|
|
357
|
-
|
|
380
|
+
setTimeout(() => {
|
|
381
|
+
this.log.info('Cleanup completed.');
|
|
382
|
+
process.exit(0);
|
|
383
|
+
}, 2 * 1000);
|
|
358
384
|
}, 3 * 1000);
|
|
359
385
|
}
|
|
360
386
|
}
|
|
@@ -593,7 +619,7 @@ export class Matterbridge {
|
|
|
593
619
|
return Promise.reject(new Error(`Failed to configure plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
594
620
|
}
|
|
595
621
|
}
|
|
596
|
-
async loadPlugin(plugin) {
|
|
622
|
+
async loadPlugin(plugin, start = false, message = '') {
|
|
597
623
|
if (!plugin.enabled) {
|
|
598
624
|
this.log.error(`Plugin ${plg}${plugin.name}${er} not enabled`);
|
|
599
625
|
return Promise.reject(new Error(`Plugin ${plg}${plugin.name}${er} not enabled`));
|
|
@@ -628,6 +654,8 @@ export class Matterbridge {
|
|
|
628
654
|
plugin.addedDevices = 0;
|
|
629
655
|
await this.nodeContext?.set('plugins', this.getBaseRegisteredPlugins());
|
|
630
656
|
this.log.info(`Loaded plugin ${plg}${plugin.name}${db} type ${typ}${platform.type}${db} (entrypoint ${UNDERLINE}${pluginEntry}${UNDERLINEOFF})`);
|
|
657
|
+
if (start)
|
|
658
|
+
this.startPlugin(plugin, message); // No await do it asyncronously
|
|
631
659
|
return Promise.resolve(platform);
|
|
632
660
|
}
|
|
633
661
|
else {
|
|
@@ -670,33 +698,34 @@ export class Matterbridge {
|
|
|
670
698
|
this.showCommissioningQRCode(this.commissioningServer, this.matterbridgeContext, 'Matterbridge');
|
|
671
699
|
}
|
|
672
700
|
if (this.bridgeMode === 'childbridge') {
|
|
673
|
-
// Plugins are loaded by loadPlugin on startup and plugin.loaded is set to true
|
|
674
|
-
// Plugins are started here and plugin.started is set to true.
|
|
701
|
+
// Plugins are loaded and started by loadPlugin on startup and plugin.loaded is set to true and plugin.started is set to true
|
|
675
702
|
// addDevice and addBridgedDeevice just register the devices that are added here to the plugin commissioning server for Accessory Platform
|
|
676
703
|
// or to the plugin aggregator for Dynamic Platform after the commissioning is done
|
|
704
|
+
// Plugins are configured by callback when the plugin is commissioned
|
|
677
705
|
this.registeredPlugins.forEach(async (plugin) => {
|
|
678
706
|
if (!plugin.enabled)
|
|
679
707
|
return;
|
|
680
708
|
// Start the interval to check if the plugins is started
|
|
709
|
+
// TODO set a counter or a timeout
|
|
710
|
+
this.log.info(`**Starting startMatterBridge interval for plugin ${plg}${plugin.name}${db} loaded: ${plugin.loaded} started: ${plugin.started}...`);
|
|
681
711
|
const startInterval = setInterval(async () => {
|
|
682
|
-
|
|
683
|
-
|
|
712
|
+
if (!plugin.loaded || !plugin.started) {
|
|
713
|
+
this.log.info(`***Returning in startMatterBridge interval for plugin ${plg}${plugin.name}${db} loaded: ${plugin.loaded} started: ${plugin.started}...`);
|
|
684
714
|
return;
|
|
715
|
+
}
|
|
685
716
|
if (plugin.type === 'AccessoryPlatform') {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
717
|
+
this.registeredDevices
|
|
718
|
+
.filter((registeredDevice) => registeredDevice.plugin === plugin.name)
|
|
719
|
+
.forEach((registeredDevice) => {
|
|
720
|
+
if (!plugin.storageContext)
|
|
689
721
|
plugin.storageContext = this.importCommissioningServerContext(plugin.name, registeredDevice.device); // Generate serialNumber and uniqueId
|
|
722
|
+
if (!plugin.commissioningServer)
|
|
690
723
|
plugin.commissioningServer = this.createCommisioningServer(plugin.storageContext, plugin.name);
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
if (plugin.registeredDevices !== undefined)
|
|
694
|
-
plugin.registeredDevices++;
|
|
695
|
-
this.log.debug(`Adding commissioning server to matter server for plugin ${plg}${plugin.name}${db} `);
|
|
696
|
-
await this.matterServer.addCommissioningServer(plugin.commissioningServer, { uniqueStorageKey: plugin.name });
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
724
|
+
this.log.debug(`Adding device ${dev}${registeredDevice.device.name}${db} to commissioning server for plugin ${plg}${plugin.name}${db}`);
|
|
725
|
+
plugin.commissioningServer.addDevice(registeredDevice.device);
|
|
699
726
|
});
|
|
727
|
+
this.log.debug(`Adding commissioning server to matter server for plugin ${plg}${plugin.name}${db}`);
|
|
728
|
+
await this.matterServer.addCommissioningServer(plugin.commissioningServer, { uniqueStorageKey: plugin.name });
|
|
700
729
|
}
|
|
701
730
|
if (plugin.type === 'DynamicPlatform') {
|
|
702
731
|
plugin.storageContext = this.createCommissioningServerContext(
|
|
@@ -705,7 +734,6 @@ export class Matterbridge {
|
|
|
705
734
|
plugin.commissioningServer = this.createCommisioningServer(plugin.storageContext, plugin.name);
|
|
706
735
|
this.log.debug(`Creating aggregator for plugin ${plg}${plugin.name}${db}`);
|
|
707
736
|
plugin.aggregator = this.createMatterAggregator(plugin.storageContext); // Generate serialNumber and uniqueId
|
|
708
|
-
await this.startPlugin(plugin, 'Matterbridge Dynamic platform has started');
|
|
709
737
|
this.log.debug(`Adding matter aggregator to commissioning server for plugin ${plg}${plugin.name}${db}`);
|
|
710
738
|
plugin.commissioningServer.addDevice(plugin.aggregator);
|
|
711
739
|
this.log.debug(`Adding commissioning server to matter server for plugin ${plg}${plugin.name}${db}`);
|
|
@@ -715,17 +743,20 @@ export class Matterbridge {
|
|
|
715
743
|
}, 1000);
|
|
716
744
|
});
|
|
717
745
|
// Start the interval to check if all plugins are loaded and started and so start the matter server
|
|
746
|
+
// TODO set a counter or a timeout
|
|
747
|
+
this.log.info('**Starting start matter interval...');
|
|
718
748
|
const startMatterInterval = setInterval(async () => {
|
|
719
749
|
let allStarted = true;
|
|
720
750
|
this.registeredPlugins.forEach((plugin) => {
|
|
721
751
|
if (!plugin.enabled)
|
|
722
752
|
return;
|
|
723
|
-
this.log.
|
|
753
|
+
this.log.info(`**Waiting in start matter server interval for plugin ${plg}${plugin.name}${db} to load (${plugin.loaded}) and start (${plugin.started}) ...`);
|
|
724
754
|
if (plugin.enabled && (!plugin.loaded || !plugin.started))
|
|
725
755
|
allStarted = false;
|
|
726
756
|
});
|
|
727
757
|
if (!allStarted)
|
|
728
758
|
return;
|
|
759
|
+
this.log.info('**Starting matter server in start matter server interval...');
|
|
729
760
|
// Setting reachability to true
|
|
730
761
|
this.registeredPlugins.forEach((plugin) => {
|
|
731
762
|
if (!plugin.enabled)
|
|
@@ -819,25 +850,34 @@ export class Matterbridge {
|
|
|
819
850
|
*
|
|
820
851
|
* @param commissioningServer - The commissioning server to show the QR code for.
|
|
821
852
|
* @param storageContext - The storage context to store the pairing codes.
|
|
822
|
-
* @param
|
|
853
|
+
* @param pluginName - The name of the commissioning server.
|
|
823
854
|
*/
|
|
824
|
-
showCommissioningQRCode(commissioningServer, storageContext,
|
|
825
|
-
if (!commissioningServer || !storageContext || !
|
|
855
|
+
async showCommissioningQRCode(commissioningServer, storageContext, pluginName) {
|
|
856
|
+
if (!commissioningServer || !storageContext || !pluginName)
|
|
826
857
|
return;
|
|
827
858
|
if (!commissioningServer.isCommissioned()) {
|
|
828
|
-
this.log.info(`***The commissioning server for ${plg}${
|
|
859
|
+
this.log.info(`***The commissioning server for ${plg}${pluginName}${nf} is not commissioned. Pair it scanning the QR code ...`);
|
|
829
860
|
const { qrPairingCode, manualPairingCode } = commissioningServer.getPairingCode();
|
|
830
861
|
storageContext.set('qrPairingCode', qrPairingCode);
|
|
831
862
|
storageContext.set('manualPairingCode', manualPairingCode);
|
|
832
863
|
const QrCode = new QrCodeSchema();
|
|
833
|
-
this.log.
|
|
864
|
+
this.log.info(`Pairing code:\n\n${QrCode.encode(qrPairingCode)}\nManual pairing code: ${manualPairingCode}\n`);
|
|
865
|
+
if (this.bridgeMode === 'childbridge') {
|
|
866
|
+
const plugin = this.findPlugin(pluginName);
|
|
867
|
+
if (plugin) {
|
|
868
|
+
await this.nodeContext?.set('plugins', this.getBaseRegisteredPlugins());
|
|
869
|
+
plugin.paired = false;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
834
872
|
}
|
|
835
873
|
else {
|
|
836
|
-
this.log.info(`***The commissioning server for ${plg}${
|
|
874
|
+
this.log.info(`***The commissioning server for ${plg}${pluginName}${nf} is already commissioned. Waiting for controllers to connect ...`);
|
|
837
875
|
if (this.bridgeMode === 'childbridge') {
|
|
838
|
-
const plugin = this.findPlugin(
|
|
839
|
-
if (plugin)
|
|
876
|
+
const plugin = this.findPlugin(pluginName);
|
|
877
|
+
if (plugin) {
|
|
878
|
+
await this.nodeContext?.set('plugins', this.getBaseRegisteredPlugins());
|
|
840
879
|
plugin.paired = true;
|
|
880
|
+
}
|
|
841
881
|
}
|
|
842
882
|
}
|
|
843
883
|
}
|
|
@@ -959,7 +999,8 @@ export class Matterbridge {
|
|
|
959
999
|
const info = commissioningServer.getCommissionedFabricInformation(fabricIndex);
|
|
960
1000
|
this.log.debug(`***Commissioning changed on fabric ${fabricIndex} for ${plg}${name}${nf}`, debugStringify(info));
|
|
961
1001
|
if (info.length === 0) {
|
|
962
|
-
this.log.warn(`***Commissioning removed from fabric ${fabricIndex} for ${plg}${name}${nf}
|
|
1002
|
+
this.log.warn(`***Commissioning removed from fabric ${fabricIndex} for ${plg}${name}${nf}. Resetting the commissioning server ...`);
|
|
1003
|
+
commissioningServer.factoryReset(); // TODO delete from storage also "matterbridge-eve-weather.EndpointStructure"
|
|
963
1004
|
}
|
|
964
1005
|
},
|
|
965
1006
|
});
|
|
@@ -1112,6 +1153,7 @@ export class Matterbridge {
|
|
|
1112
1153
|
enabled: plugin.enabled,
|
|
1113
1154
|
loaded: plugin.loaded,
|
|
1114
1155
|
started: plugin.started,
|
|
1156
|
+
configured: plugin.configured,
|
|
1115
1157
|
paired: plugin.paired,
|
|
1116
1158
|
connected: plugin.connected,
|
|
1117
1159
|
registeredDevices: plugin.registeredDevices,
|