matterbridge 1.5.1 → 1.5.3
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 +34 -0
- package/{README-ADVANCED.md → README-DOCKER.md} +1 -82
- package/README-SERVICE.md +96 -0
- package/README.md +54 -17
- package/dist/cluster/AirQualityCluster.d.ts +1 -1
- package/dist/cluster/AirQualityCluster.d.ts.map +1 -1
- package/dist/cluster/CarbonDioxideConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/CarbonDioxideConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/CarbonMonoxideConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/CarbonMonoxideConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/ConcentrationMeasurementCluster.d.ts +10 -10
- package/dist/cluster/DeviceEnergyManagementCluster.d.ts +16 -16
- package/dist/cluster/DeviceEnergyManagementCluster.d.ts.map +1 -1
- package/dist/cluster/DeviceEnergyManagementModeCluster.d.ts +3 -3
- package/dist/cluster/DeviceEnergyManagementModeCluster.d.ts.map +1 -1
- package/dist/cluster/ElectricalEnergyMeasurementCluster.d.ts +8 -8
- package/dist/cluster/ElectricalEnergyMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/ElectricalPowerMeasurementCluster.d.ts +13 -13
- package/dist/cluster/ElectricalPowerMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/FormaldehydeConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/FormaldehydeConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/NitrogenDioxideConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/NitrogenDioxideConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/OzoneConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/OzoneConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/Pm10ConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/Pm10ConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/Pm1ConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/Pm1ConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/Pm25ConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/Pm25ConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/PowerTopologyCluster.d.ts +7 -7
- package/dist/cluster/PowerTopologyCluster.d.ts.map +1 -1
- package/dist/cluster/RadonConcentrationMeasurementCluster.d.ts +11 -11
- package/dist/cluster/RadonConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/ScenesCluster.d.ts +1249 -0
- package/dist/cluster/ScenesCluster.d.ts.map +1 -0
- package/dist/cluster/ScenesCluster.js +436 -0
- package/dist/cluster/ScenesCluster.js.map +1 -0
- package/dist/cluster/SmokeCoAlarmCluster.d.ts +9 -9
- package/dist/cluster/SmokeCoAlarmCluster.d.ts.map +1 -1
- package/dist/cluster/TvocCluster.d.ts +1 -1
- package/dist/cluster/TvocCluster.d.ts.map +1 -1
- package/dist/cluster/export.d.ts +0 -1
- package/dist/cluster/export.d.ts.map +1 -1
- package/dist/cluster/export.js +0 -1
- package/dist/cluster/export.js.map +1 -1
- package/dist/index.d.ts +3 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -32
- package/dist/index.js.map +1 -1
- package/dist/matterbridge.d.ts +5 -3
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +152 -30
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +4684 -2288
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +146 -545
- package/dist/matterbridgeDevice.js.map +1 -1
- package/dist/matterbridgeTypes.d.ts +5 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -1
- package/dist/pluginManager.d.ts.map +1 -1
- package/dist/pluginManager.js +16 -0
- package/dist/pluginManager.js.map +1 -1
- package/dist/utils/utils.d.ts +0 -5
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +5 -12
- 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.1cf003ae.css +2 -0
- package/frontend/build/static/css/main.1cf003ae.css.map +1 -0
- package/frontend/build/static/js/main.6725e5ab.js +3 -0
- package/frontend/build/static/js/main.6725e5ab.js.map +1 -0
- package/package.json +19 -15
- package/dist/cluster/BooleanStateConfigurationCluster.d.ts +0 -2200
- package/dist/cluster/BooleanStateConfigurationCluster.d.ts.map +0 -1
- package/dist/cluster/BooleanStateConfigurationCluster.js +0 -388
- package/dist/cluster/BooleanStateConfigurationCluster.js.map +0 -1
- package/dist/cluster/BridgedDeviceBasicInformationCluster.d.ts +0 -223
- package/dist/cluster/BridgedDeviceBasicInformationCluster.d.ts.map +0 -1
- package/dist/cluster/BridgedDeviceBasicInformationCluster.js +0 -177
- package/dist/cluster/BridgedDeviceBasicInformationCluster.js.map +0 -1
- package/dist/cluster/FanControlCluster.d.ts +0 -1583
- package/dist/cluster/FanControlCluster.d.ts.map +0 -1
- package/dist/cluster/FanControlCluster.js +0 -492
- package/dist/cluster/FanControlCluster.js.map +0 -1
- package/frontend/build/static/css/main.ee3183e2.css +0 -2
- package/frontend/build/static/css/main.ee3183e2.css.map +0 -1
- package/frontend/build/static/js/main.4c5271fd.js +0 -3
- package/frontend/build/static/js/main.4c5271fd.js.map +0 -1
- /package/frontend/build/static/js/{main.4c5271fd.js.LICENSE.txt → main.6725e5ab.js.LICENSE.txt} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -25,35 +25,13 @@ export * from '@project-chip/matter-node.js/device';
|
|
|
25
25
|
export * from '@project-chip/matter-node.js/cluster';
|
|
26
26
|
export * from '@project-chip/matter-node.js/log';
|
|
27
27
|
export * from '@project-chip/matter-node.js/datatype';
|
|
28
|
-
export * from '@project-chip/matter.js/util';
|
|
29
|
-
export * from '@project-chip/matter.js/schema';
|
|
30
|
-
export * from '@project-chip/matter.js/tlv';
|
|
28
|
+
export * from '@project-chip/matter-node.js/util';
|
|
29
|
+
export * from '@project-chip/matter-node.js/schema';
|
|
30
|
+
export * from '@project-chip/matter-node.js/tlv';
|
|
31
31
|
export * from './matterbridge.js';
|
|
32
32
|
export * from './matterbridgeDevice.js';
|
|
33
33
|
export * from './matterbridgePlatform.js';
|
|
34
34
|
export * from './matterbridgeAccessoryPlatform.js';
|
|
35
35
|
export * from './matterbridgeDynamicPlatform.js';
|
|
36
36
|
export * from './matterbridgeTypes.js';
|
|
37
|
-
export * from './cluster/AirQualityCluster.js';
|
|
38
|
-
export * from './cluster/BooleanStateConfigurationCluster.js';
|
|
39
|
-
export * from './cluster/CarbonDioxideConcentrationMeasurementCluster.js';
|
|
40
|
-
export * from './cluster/CarbonMonoxideConcentrationMeasurementCluster.js';
|
|
41
|
-
export * from './cluster/ConcentrationMeasurementCluster.js';
|
|
42
|
-
export * from './cluster/DeviceEnergyManagementCluster.js';
|
|
43
|
-
export * from './cluster/DeviceEnergyManagementModeCluster.js';
|
|
44
|
-
export * from './cluster/ElectricalEnergyMeasurementCluster.js';
|
|
45
|
-
export * from './cluster/ElectricalPowerMeasurementCluster.js';
|
|
46
|
-
export * from './cluster/FormaldehydeConcentrationMeasurementCluster.js';
|
|
47
|
-
export * from './cluster/MeasurementAccuracy.js';
|
|
48
|
-
export * from './cluster/MeasurementAccuracyRange.js';
|
|
49
|
-
export * from './cluster/MeasurementType.js';
|
|
50
|
-
export * from './cluster/NitrogenDioxideConcentrationMeasurementCluster.js';
|
|
51
|
-
export * from './cluster/OzoneConcentrationMeasurementCluster.js';
|
|
52
|
-
export * from './cluster/Pm10ConcentrationMeasurementCluster.js';
|
|
53
|
-
export * from './cluster/Pm1ConcentrationMeasurementCluster.js';
|
|
54
|
-
export * from './cluster/Pm25ConcentrationMeasurementCluster.js';
|
|
55
|
-
export * from './cluster/PowerTopologyCluster.js';
|
|
56
|
-
export * from './cluster/RadonConcentrationMeasurementCluster.js';
|
|
57
|
-
export * from './cluster/SmokeCoAlarmCluster.js';
|
|
58
|
-
export * from './cluster/TvocCluster.js';
|
|
59
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,8BAA8B,CAAC;AAItC,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,8BAA8B,CAAC;AAItC,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -26,44 +26,15 @@ export * from '@project-chip/matter-node.js/device';
|
|
|
26
26
|
export * from '@project-chip/matter-node.js/cluster';
|
|
27
27
|
export * from '@project-chip/matter-node.js/log';
|
|
28
28
|
export * from '@project-chip/matter-node.js/datatype';
|
|
29
|
-
export * from '@project-chip/matter.js/util';
|
|
30
|
-
export * from '@project-chip/matter.js/schema';
|
|
31
|
-
export * from '@project-chip/matter.js/tlv';
|
|
29
|
+
export * from '@project-chip/matter-node.js/util';
|
|
30
|
+
export * from '@project-chip/matter-node.js/schema';
|
|
31
|
+
export * from '@project-chip/matter-node.js/tlv';
|
|
32
32
|
export * from './matterbridge.js';
|
|
33
33
|
export * from './matterbridgeDevice.js';
|
|
34
34
|
export * from './matterbridgePlatform.js';
|
|
35
35
|
export * from './matterbridgeAccessoryPlatform.js';
|
|
36
36
|
export * from './matterbridgeDynamicPlatform.js';
|
|
37
37
|
export * from './matterbridgeTypes.js';
|
|
38
|
-
// TODO Remove in august 2024
|
|
39
|
-
/*
|
|
40
|
-
export * from 'matter-history';
|
|
41
|
-
export * from './utils/utils.js';
|
|
42
|
-
export * from './utils/colorUtils.js';
|
|
43
|
-
*/
|
|
44
|
-
// TODO Refactor all plugins to import from matterbridge/cluster and remove in september 2024
|
|
45
|
-
export * from './cluster/AirQualityCluster.js';
|
|
46
|
-
export * from './cluster/BooleanStateConfigurationCluster.js';
|
|
47
|
-
export * from './cluster/CarbonDioxideConcentrationMeasurementCluster.js';
|
|
48
|
-
export * from './cluster/CarbonMonoxideConcentrationMeasurementCluster.js';
|
|
49
|
-
export * from './cluster/ConcentrationMeasurementCluster.js';
|
|
50
|
-
export * from './cluster/DeviceEnergyManagementCluster.js';
|
|
51
|
-
export * from './cluster/DeviceEnergyManagementModeCluster.js';
|
|
52
|
-
export * from './cluster/ElectricalEnergyMeasurementCluster.js';
|
|
53
|
-
export * from './cluster/ElectricalPowerMeasurementCluster.js';
|
|
54
|
-
export * from './cluster/FormaldehydeConcentrationMeasurementCluster.js';
|
|
55
|
-
export * from './cluster/MeasurementAccuracy.js';
|
|
56
|
-
export * from './cluster/MeasurementAccuracyRange.js';
|
|
57
|
-
export * from './cluster/MeasurementType.js';
|
|
58
|
-
export * from './cluster/NitrogenDioxideConcentrationMeasurementCluster.js';
|
|
59
|
-
export * from './cluster/OzoneConcentrationMeasurementCluster.js';
|
|
60
|
-
export * from './cluster/Pm10ConcentrationMeasurementCluster.js';
|
|
61
|
-
export * from './cluster/Pm1ConcentrationMeasurementCluster.js';
|
|
62
|
-
export * from './cluster/Pm25ConcentrationMeasurementCluster.js';
|
|
63
|
-
export * from './cluster/PowerTopologyCluster.js';
|
|
64
|
-
export * from './cluster/RadonConcentrationMeasurementCluster.js';
|
|
65
|
-
export * from './cluster/SmokeCoAlarmCluster.js';
|
|
66
|
-
export * from './cluster/TvocCluster.js';
|
|
67
38
|
const cli = '\u001B[32m';
|
|
68
39
|
const er = '\u001B[38;5;9m';
|
|
69
40
|
const rs = '\u001B[40;0m';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AAEvC,MAAM,GAAG,GAAG,YAAY,CAAC;AACzB,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAC5B,MAAM,EAAE,GAAG,cAAc,CAAC;AAE1B,KAAK,UAAU,IAAI;IACjB,sCAAsC;IACtC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,0CAA0C,GAAG,EAAE,CAAC,CAAC;IACxG,MAAM,YAAY,CAAC,YAAY,EAAE,CAAC;IAClC,sCAAsC;IACtC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,0CAA0C,GAAG,EAAE,CAAC,CAAC;AAC1G,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,wDAAwD,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AAC3F,CAAC,CAAC,CAAC"}
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @file matterbridge.ts
|
|
5
5
|
* @author Luca Liguori
|
|
6
6
|
* @date 2023-12-29
|
|
7
|
-
* @version 1.
|
|
7
|
+
* @version 1.5.2
|
|
8
8
|
*
|
|
9
|
-
* Copyright 2023, 2024 Luca Liguori.
|
|
9
|
+
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
10
10
|
*
|
|
11
11
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
12
|
* you may not use this file except in compliance with the License.
|
|
@@ -40,7 +40,7 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
40
40
|
matterbridgeQrPairingCode: string | undefined;
|
|
41
41
|
matterbridgeManualPairingCode: string | undefined;
|
|
42
42
|
matterbridgeFabricInformations: SanitizedExposedFabricInformation[];
|
|
43
|
-
matterbridgeSessionInformations: SanitizedSessionInformation
|
|
43
|
+
matterbridgeSessionInformations: Map<string, SanitizedSessionInformation>;
|
|
44
44
|
matterbridgePaired: boolean;
|
|
45
45
|
matterbridgeConnected: boolean;
|
|
46
46
|
bridgeMode: 'bridge' | 'childbridge' | 'controller' | '';
|
|
@@ -72,6 +72,8 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
72
72
|
private httpsServer;
|
|
73
73
|
private webSocketServer;
|
|
74
74
|
private mdnsInterface;
|
|
75
|
+
private ipv4address;
|
|
76
|
+
private ipv6address;
|
|
75
77
|
private port;
|
|
76
78
|
private passcode?;
|
|
77
79
|
private discriminator?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AASH,OAAO,YAAY,MAAM,QAAQ,CAAC;AAQlC,OAAO,EAAE,UAAU,EAAyK,MAAM,kBAAkB,CAAC;AAGrN,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AASH,OAAO,YAAY,MAAM,QAAQ,CAAC;AAQlC,OAAO,EAAE,UAAU,EAAyK,MAAM,kBAAkB,CAAC;AAGrN,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EAAwB,uBAAuB,EAAsC,iCAAiC,EAAE,2BAA2B,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAkClO;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IACrC,iBAAiB,EAAE,iBAAiB,CAezC;IAEK,uBAAuB,EAAE,uBAAuB,CAyBrD;IAEK,aAAa,SAAM;IACnB,aAAa,SA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I,CAAC;IAorBpD;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAmDhC;;;;;OAKG;IACU,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,SAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAsEtG;;;;;OAKG;IACU,aAAa;IAa1B;;;;;OAKG;IACI,uBAAuB,IAAI,OAAO;CAI1C"}
|
package/dist/matterbridge.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @file matterbridge.ts
|
|
5
5
|
* @author Luca Liguori
|
|
6
6
|
* @date 2023-12-29
|
|
7
|
-
* @version 1.
|
|
7
|
+
* @version 1.5.2
|
|
8
8
|
*
|
|
9
|
-
* Copyright 2023, 2024 Luca Liguori.
|
|
9
|
+
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
10
10
|
*
|
|
11
11
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
12
|
* you may not use this file except in compliance with the License.
|
|
@@ -36,11 +36,12 @@ import { NodeStorageManager } from 'node-persist-manager';
|
|
|
36
36
|
import { AnsiLogger, UNDERLINE, UNDERLINEOFF, YELLOW, db, debugStringify, stringify, BRIGHT, RESET, er, nf, rs, wr, RED, GREEN, zb, hk, or, idn, BLUE, CYAN, nt } from 'node-ansi-logger';
|
|
37
37
|
// Matterbridge
|
|
38
38
|
import { MatterbridgeDevice } from './matterbridgeDevice.js';
|
|
39
|
-
import { BridgedDeviceBasicInformation, BridgedDeviceBasicInformationCluster } from './cluster/BridgedDeviceBasicInformationCluster.js';
|
|
40
39
|
import { logInterfaces, wait, waiter, createZip } from './utils/utils.js';
|
|
40
|
+
import { PluginManager } from './pluginManager.js';
|
|
41
|
+
import { DeviceManager } from './deviceManager.js';
|
|
41
42
|
// @project-chip/matter-node.js
|
|
42
43
|
import { CommissioningController, CommissioningServer, MatterServer } from '@project-chip/matter-node.js';
|
|
43
|
-
import { BasicInformationCluster, ClusterServer, FixedLabelCluster, GeneralCommissioning, PowerSourceCluster, SwitchCluster, ThreadNetworkDiagnosticsCluster, getClusterNameById } from '@project-chip/matter-node.js/cluster';
|
|
44
|
+
import { BasicInformationCluster, BridgedDeviceBasicInformation, BridgedDeviceBasicInformationCluster, ClusterServer, FixedLabelCluster, GeneralCommissioning, PowerSourceCluster, SwitchCluster, ThreadNetworkDiagnosticsCluster, getClusterNameById, } from '@project-chip/matter-node.js/cluster';
|
|
44
45
|
import { DeviceTypeId, VendorId } from '@project-chip/matter-node.js/datatype';
|
|
45
46
|
import { Aggregator, DeviceTypes, NodeStateInformation } from '@project-chip/matter-node.js/device';
|
|
46
47
|
import { Format, Level, Logger } from '@project-chip/matter-node.js/log';
|
|
@@ -48,8 +49,7 @@ import { ManualPairingCodeCodec, QrCodeSchema } from '@project-chip/matter-node.
|
|
|
48
49
|
import { StorageBackendDisk, StorageBackendJsonFile, StorageManager } from '@project-chip/matter-node.js/storage';
|
|
49
50
|
import { getParameter, getIntParameter, hasParameter } from '@project-chip/matter-node.js/util';
|
|
50
51
|
import { CryptoNode } from '@project-chip/matter-node.js/crypto';
|
|
51
|
-
import {
|
|
52
|
-
import { DeviceManager } from './deviceManager.js';
|
|
52
|
+
import { Specification } from '@project-chip/matter-node.js/model';
|
|
53
53
|
// Default colors
|
|
54
54
|
const plg = '\u001B[38;5;33m';
|
|
55
55
|
const dev = '\u001B[38;5;79m';
|
|
@@ -94,6 +94,11 @@ export class Matterbridge extends EventEmitter {
|
|
|
94
94
|
fileLogger: false,
|
|
95
95
|
matterLoggerLevel: Level.INFO,
|
|
96
96
|
matterFileLogger: false,
|
|
97
|
+
mattermdnsinterface: undefined,
|
|
98
|
+
matteripv4address: undefined,
|
|
99
|
+
matteripv6address: undefined,
|
|
100
|
+
restartRequired: false,
|
|
101
|
+
refreshRequired: false,
|
|
97
102
|
};
|
|
98
103
|
homeDirectory = '';
|
|
99
104
|
rootDirectory = '';
|
|
@@ -105,7 +110,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
105
110
|
matterbridgeQrPairingCode = undefined;
|
|
106
111
|
matterbridgeManualPairingCode = undefined;
|
|
107
112
|
matterbridgeFabricInformations = [];
|
|
108
|
-
matterbridgeSessionInformations = [];
|
|
113
|
+
// public matterbridgeSessionInformations: SanitizedSessionInformation[] = [];
|
|
114
|
+
matterbridgeSessionInformations = new Map();
|
|
109
115
|
matterbridgePaired = false;
|
|
110
116
|
matterbridgeConnected = false;
|
|
111
117
|
bridgeMode = '';
|
|
@@ -140,6 +146,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
140
146
|
webSocketServer;
|
|
141
147
|
// Matter
|
|
142
148
|
mdnsInterface; // matter server mdnsInterface: e.g. 'eth0' or 'wlan0' or 'WiFi'
|
|
149
|
+
ipv4address; // matter commissioning server listeningAddressIpv4
|
|
150
|
+
ipv6address; // matter commissioning server listeningAddressIpv6
|
|
143
151
|
port = 5540; // first commissioning server port
|
|
144
152
|
passcode; // first commissioning server passcode
|
|
145
153
|
discriminator; // first commissioning server discriminator
|
|
@@ -199,8 +207,6 @@ export class Matterbridge extends EventEmitter {
|
|
|
199
207
|
* @returns A Promise that resolves when the initialization is complete.
|
|
200
208
|
*/
|
|
201
209
|
async initialize() {
|
|
202
|
-
// Set the interface to use for the matter server mdnsInterface
|
|
203
|
-
this.mdnsInterface = getParameter('mdnsinterface');
|
|
204
210
|
// Set the first port to use for the commissioning server (will be incremented in childbridge mode)
|
|
205
211
|
this.port = getIntParameter('port') ?? 5540;
|
|
206
212
|
// Set the first passcode to use for the commissioning server (will be incremented in childbridge mode)
|
|
@@ -299,6 +305,33 @@ export class Matterbridge extends EventEmitter {
|
|
|
299
305
|
});
|
|
300
306
|
}
|
|
301
307
|
this.log.debug(`Matter logLevel: ${Logger.defaultLogLevel} fileLoger: ${this.matterbridgeInformation.matterFileLogger}.`);
|
|
308
|
+
// Set the interface to use for the matter server mdnsInterface
|
|
309
|
+
if (hasParameter('mdnsinterface')) {
|
|
310
|
+
this.mdnsInterface = getParameter('mdnsinterface');
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
this.mdnsInterface = await this.nodeContext?.get('mattermdnsinterface', undefined);
|
|
314
|
+
if (this.mdnsInterface === '')
|
|
315
|
+
this.mdnsInterface = undefined;
|
|
316
|
+
}
|
|
317
|
+
// Set the listeningAddressIpv4 for the matter commissioning server
|
|
318
|
+
if (hasParameter('ipv4address')) {
|
|
319
|
+
this.ipv4address = getParameter('ipv4address');
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
this.ipv4address = await this.nodeContext?.get('matteripv4address', undefined);
|
|
323
|
+
if (this.ipv4address === '')
|
|
324
|
+
this.ipv4address = undefined;
|
|
325
|
+
}
|
|
326
|
+
// Set the listeningAddressIpv6 for the matter commissioning server
|
|
327
|
+
if (hasParameter('ipv6address')) {
|
|
328
|
+
this.ipv6address = getParameter('ipv6address');
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
this.ipv6address = await this.nodeContext?.get('matteripv6address', undefined);
|
|
332
|
+
if (this.ipv6address === '')
|
|
333
|
+
this.ipv6address = undefined;
|
|
334
|
+
}
|
|
302
335
|
// Initialize PluginManager
|
|
303
336
|
this.plugins = new PluginManager(this);
|
|
304
337
|
await this.plugins.loadFromStorage();
|
|
@@ -378,6 +411,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
378
411
|
- list: list the registered plugins
|
|
379
412
|
- loginterfaces: log the network interfaces (usefull for finding the name of the interface to use with -mdnsinterface option)
|
|
380
413
|
- logstorage: log the node storage
|
|
414
|
+
- sudo: force the use of sudo to install or update packages
|
|
415
|
+
- nosudo: force not to use sudo to install or update packages
|
|
381
416
|
- ssl: enable SSL for the frontend and WebSockerServer (certificates in .matterbridge/certs directory cert.pem, key.pem and ca.pem (optional))
|
|
382
417
|
- add [plugin path]: register the plugin from the given absolute or relative path
|
|
383
418
|
- add [plugin name]: register the globally installed plugin with the given name
|
|
@@ -1603,7 +1638,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1603
1638
|
};
|
|
1604
1639
|
this.log.info('Commissioning with options:', options);
|
|
1605
1640
|
const nodeId = await this.commissioningController.commissionNode(options);
|
|
1606
|
-
this.log.info(`Commissioning successfully done with nodeId: ${nodeId
|
|
1641
|
+
this.log.info(`Commissioning successfully done with nodeId: ${nodeId}`);
|
|
1607
1642
|
this.log.info('ActiveSessionInformation:', this.commissioningController.getActiveSessionInformation());
|
|
1608
1643
|
} // (hasParameter('pairingcode'))
|
|
1609
1644
|
if (hasParameter('unpairall')) {
|
|
@@ -1812,7 +1847,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1812
1847
|
}
|
|
1813
1848
|
}
|
|
1814
1849
|
const matterServer = new MatterServer(storageManager, { mdnsInterface: this.mdnsInterface });
|
|
1815
|
-
this.log.debug(
|
|
1850
|
+
this.log.debug(`Created matter server with mdnsInterface: ${this.mdnsInterface ?? 'all available interfaces'}`);
|
|
1816
1851
|
return matterServer;
|
|
1817
1852
|
}
|
|
1818
1853
|
/**
|
|
@@ -1876,6 +1911,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
1876
1911
|
hardwareVersionString: await context.get('hardwareVersionString', '1.0.0'),
|
|
1877
1912
|
reachable: true,
|
|
1878
1913
|
capabilityMinima: { caseSessionsPerFabric: 3, subscriptionsPerFabric: 3 },
|
|
1914
|
+
specificationVersion: Specification.SPECIFICATION_VERSION,
|
|
1915
|
+
maxPathsPerInvoke: 1,
|
|
1879
1916
|
}, {}, {
|
|
1880
1917
|
startUp: true,
|
|
1881
1918
|
shutDown: true,
|
|
@@ -1910,10 +1947,40 @@ export class Matterbridge extends EventEmitter {
|
|
|
1910
1947
|
this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with softwareVersion ${softwareVersion} softwareVersionString ${softwareVersionString}`);
|
|
1911
1948
|
this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with hardwareVersion ${hardwareVersion} hardwareVersionString ${hardwareVersionString}`);
|
|
1912
1949
|
this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with nodeLabel '${productName}' port ${this.port} passcode ${this.passcode} discriminator ${this.discriminator}`);
|
|
1950
|
+
// Validate ipv4address
|
|
1951
|
+
if (this.ipv4address) {
|
|
1952
|
+
const networkInterfaces = os.networkInterfaces();
|
|
1953
|
+
const availableAddresses = Object.values(networkInterfaces)
|
|
1954
|
+
.flat()
|
|
1955
|
+
.filter((iface) => iface !== undefined && iface.family === 'IPv4' && !iface.internal)
|
|
1956
|
+
.map((iface) => iface.address);
|
|
1957
|
+
if (!availableAddresses.includes(this.ipv4address)) {
|
|
1958
|
+
this.log.error(`Invalid ipv4address: ${this.ipv4address}. Available addresses are: ${availableAddresses.join(', ')}. Using all available addresses.`);
|
|
1959
|
+
this.mdnsInterface = undefined;
|
|
1960
|
+
}
|
|
1961
|
+
else {
|
|
1962
|
+
this.log.info(`Using ipv4address '${this.ipv4address}' for the Matter commissioning server.`);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
// Validate ipv6address
|
|
1966
|
+
if (this.ipv6address) {
|
|
1967
|
+
const networkInterfaces = os.networkInterfaces();
|
|
1968
|
+
const availableAddresses = Object.values(networkInterfaces)
|
|
1969
|
+
.flat()
|
|
1970
|
+
.filter((iface) => iface !== undefined && iface.family === 'IPv6' && !iface.internal)
|
|
1971
|
+
.map((iface) => iface.address);
|
|
1972
|
+
if (!availableAddresses.includes(this.ipv6address)) {
|
|
1973
|
+
this.log.error(`Invalid ipv6address: ${this.ipv6address}. Available addresses are: ${availableAddresses.join(', ')}. Using all available addresses.`);
|
|
1974
|
+
this.mdnsInterface = undefined;
|
|
1975
|
+
}
|
|
1976
|
+
else {
|
|
1977
|
+
this.log.info(`Using ipv6address '${this.ipv6address}' for the Matter commissioning server.`);
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1913
1980
|
const commissioningServer = new CommissioningServer({
|
|
1914
1981
|
port: this.port++,
|
|
1915
|
-
listeningAddressIpv4:
|
|
1916
|
-
listeningAddressIpv6:
|
|
1982
|
+
listeningAddressIpv4: this.ipv4address,
|
|
1983
|
+
listeningAddressIpv6: this.ipv6address,
|
|
1917
1984
|
passcode: this.passcode,
|
|
1918
1985
|
discriminator: this.discriminator,
|
|
1919
1986
|
deviceName,
|
|
@@ -1947,7 +2014,10 @@ export class Matterbridge extends EventEmitter {
|
|
|
1947
2014
|
if (this.bridgeMode === 'bridge') {
|
|
1948
2015
|
this.matterbridgePaired = true;
|
|
1949
2016
|
this.matterbridgeConnected = true;
|
|
1950
|
-
this.matterbridgeSessionInformations = this.sanitizeSessionInformation(sessionInformations);
|
|
2017
|
+
// this.matterbridgeSessionInformations = this.sanitizeSessionInformation(sessionInformations);
|
|
2018
|
+
sessionInformations.forEach((session) => {
|
|
2019
|
+
this.matterbridgeSessionInformations.set(session.name, this.sanitizeSessionInformation([session])[0]);
|
|
2020
|
+
});
|
|
1951
2021
|
}
|
|
1952
2022
|
if (this.bridgeMode === 'childbridge') {
|
|
1953
2023
|
const plugin = this.plugins.get(pluginName);
|
|
@@ -1997,7 +2067,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
1997
2067
|
if (pluginName === 'Matterbridge') {
|
|
1998
2068
|
await this.matterbridgeContext?.clearAll();
|
|
1999
2069
|
this.matterbridgeFabricInformations = [];
|
|
2000
|
-
this.matterbridgeSessionInformations = [];
|
|
2070
|
+
// this.matterbridgeSessionInformations = [];
|
|
2071
|
+
this.matterbridgeSessionInformations.clear();
|
|
2001
2072
|
this.matterbridgePaired = false;
|
|
2002
2073
|
this.matterbridgeConnected = false;
|
|
2003
2074
|
}
|
|
@@ -2150,7 +2221,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
2150
2221
|
this.matterbridgeQrPairingCode = qrPairingCode;
|
|
2151
2222
|
this.matterbridgeManualPairingCode = manualPairingCode;
|
|
2152
2223
|
this.matterbridgeFabricInformations = [];
|
|
2153
|
-
this.matterbridgeSessionInformations = [];
|
|
2224
|
+
// this.matterbridgeSessionInformations = [];
|
|
2225
|
+
this.matterbridgeSessionInformations.clear();
|
|
2154
2226
|
this.matterbridgePaired = false;
|
|
2155
2227
|
this.matterbridgeConnected = false;
|
|
2156
2228
|
}
|
|
@@ -2176,7 +2248,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
2176
2248
|
});
|
|
2177
2249
|
if (pluginName === 'Matterbridge') {
|
|
2178
2250
|
this.matterbridgeFabricInformations = this.sanitizeFabricInformations(fabricInfo);
|
|
2179
|
-
this.matterbridgeSessionInformations = [];
|
|
2251
|
+
// this.matterbridgeSessionInformations = [];
|
|
2252
|
+
this.matterbridgeSessionInformations.clear();
|
|
2180
2253
|
this.matterbridgePaired = true;
|
|
2181
2254
|
}
|
|
2182
2255
|
if (pluginName !== 'Matterbridge') {
|
|
@@ -2382,7 +2455,10 @@ export class Matterbridge extends EventEmitter {
|
|
|
2382
2455
|
args.splice(0, args.length, '/c', argstring);
|
|
2383
2456
|
command = 'cmd.exe';
|
|
2384
2457
|
}
|
|
2385
|
-
|
|
2458
|
+
// Decide when using sudo on linux
|
|
2459
|
+
// When you need sudo: Spawn stderr: npm error Error: EACCES: permission denied
|
|
2460
|
+
// When you don't need sudo: Failed to start child process "npm install -g matterbridge-eve-door": spawn sudo ENOENT
|
|
2461
|
+
if (hasParameter('sudo') || (process.platform === 'linux' && command === 'npm' && !hasParameter('docker') && !hasParameter('nosudo'))) {
|
|
2386
2462
|
args.unshift(command);
|
|
2387
2463
|
command = 'sudo';
|
|
2388
2464
|
}
|
|
@@ -2392,44 +2468,48 @@ export class Matterbridge extends EventEmitter {
|
|
|
2392
2468
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
2393
2469
|
});
|
|
2394
2470
|
childProcess.on('error', (err) => {
|
|
2395
|
-
this.log.error(`Failed to start child process: ${err.message}`);
|
|
2396
|
-
reject(err);
|
|
2471
|
+
this.log.error(`Failed to start child process "${cmdLine}": ${err.message}`);
|
|
2472
|
+
reject(err);
|
|
2397
2473
|
});
|
|
2398
2474
|
childProcess.on('close', (code, signal) => {
|
|
2399
2475
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', `child process closed with code ${code} and signal ${signal}`);
|
|
2400
2476
|
if (code === 0) {
|
|
2401
2477
|
if (cmdLine.startsWith('npm install -g'))
|
|
2402
2478
|
this.log.notice(`${cmdLine.replace('npm install -g ', '')} installed correctly`);
|
|
2479
|
+
this.log.debug(`Child process "${cmdLine}" closed with code ${code} and signal ${signal}`);
|
|
2403
2480
|
resolve();
|
|
2404
2481
|
}
|
|
2405
2482
|
else {
|
|
2406
|
-
this.log.error(`Child process
|
|
2407
|
-
reject(new Error(`Child process
|
|
2483
|
+
this.log.error(`Child process "${cmdLine}" closed with code ${code} and signal ${signal}`);
|
|
2484
|
+
reject(new Error(`Child process "${cmdLine}" closed with code ${code} and signal ${signal}`));
|
|
2408
2485
|
}
|
|
2409
2486
|
});
|
|
2410
2487
|
childProcess.on('exit', (code, signal) => {
|
|
2411
2488
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', `child process exited with code ${code} and signal ${signal}`);
|
|
2412
2489
|
if (code === 0) {
|
|
2490
|
+
this.log.debug(`Child process "${cmdLine}" exited with code ${code} and signal ${signal}`);
|
|
2413
2491
|
resolve();
|
|
2414
2492
|
}
|
|
2415
2493
|
else {
|
|
2416
|
-
this.log.error(`Child process exited with code ${code} and signal ${signal}`);
|
|
2417
|
-
reject(new Error(`Child process exited with code ${code} and signal ${signal}`));
|
|
2494
|
+
this.log.error(`Child process "${cmdLine}" exited with code ${code} and signal ${signal}`);
|
|
2495
|
+
reject(new Error(`Child process "${cmdLine}" exited with code ${code} and signal ${signal}`));
|
|
2418
2496
|
}
|
|
2419
2497
|
});
|
|
2420
2498
|
childProcess.on('disconnect', () => {
|
|
2421
|
-
this.log.debug(
|
|
2499
|
+
this.log.debug(`Child process "${cmdLine}" has been disconnected from the parent`);
|
|
2422
2500
|
resolve();
|
|
2423
2501
|
});
|
|
2424
2502
|
if (childProcess.stdout) {
|
|
2425
2503
|
childProcess.stdout.on('data', (data) => {
|
|
2426
2504
|
const message = data.toString().trim();
|
|
2505
|
+
this.log.debug(`Spawn stdout: ${message}`);
|
|
2427
2506
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', message);
|
|
2428
2507
|
});
|
|
2429
2508
|
}
|
|
2430
2509
|
if (childProcess.stderr) {
|
|
2431
2510
|
childProcess.stderr.on('data', (data) => {
|
|
2432
2511
|
const message = data.toString().trim();
|
|
2512
|
+
this.log.debug(`Spawn stderr: ${message}`);
|
|
2433
2513
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', message);
|
|
2434
2514
|
});
|
|
2435
2515
|
}
|
|
@@ -2499,7 +2579,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2499
2579
|
if (this.systemInformation.ipv4Address !== '')
|
|
2500
2580
|
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://${this.systemInformation.ipv4Address}:${port}${UNDERLINEOFF}${rs}`);
|
|
2501
2581
|
if (this.systemInformation.ipv6Address !== '')
|
|
2502
|
-
this.log.
|
|
2582
|
+
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://[${this.systemInformation.ipv6Address}]:${port}${UNDERLINEOFF}${rs}`);
|
|
2503
2583
|
});
|
|
2504
2584
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2505
2585
|
this.httpServer.on('error', (error) => {
|
|
@@ -2552,7 +2632,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2552
2632
|
if (this.systemInformation.ipv4Address !== '')
|
|
2553
2633
|
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://${this.systemInformation.ipv4Address}:${port}${UNDERLINEOFF}${rs}`);
|
|
2554
2634
|
if (this.systemInformation.ipv6Address !== '')
|
|
2555
|
-
this.log.
|
|
2635
|
+
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://[${this.systemInformation.ipv6Address}]:${port}${UNDERLINEOFF}${rs}`);
|
|
2556
2636
|
});
|
|
2557
2637
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2558
2638
|
this.httpsServer.on('error', (error) => {
|
|
@@ -2637,12 +2717,17 @@ export class Matterbridge extends EventEmitter {
|
|
|
2637
2717
|
this.matterbridgeInformation.restartMode = this.restartMode;
|
|
2638
2718
|
this.matterbridgeInformation.loggerLevel = this.log.logLevel;
|
|
2639
2719
|
this.matterbridgeInformation.matterLoggerLevel = Logger.defaultLogLevel;
|
|
2720
|
+
this.matterbridgeInformation.mattermdnsinterface = (await this.nodeContext?.get('mattermdnsinterface', '')) || '';
|
|
2721
|
+
this.matterbridgeInformation.matteripv4address = (await this.nodeContext?.get('matteripv4address', '')) || '';
|
|
2722
|
+
this.matterbridgeInformation.matteripv6address = (await this.nodeContext?.get('matteripv6address', '')) || '';
|
|
2640
2723
|
this.matterbridgeInformation.matterbridgePaired = this.matterbridgePaired;
|
|
2641
2724
|
this.matterbridgeInformation.matterbridgeConnected = this.matterbridgeConnected;
|
|
2642
2725
|
this.matterbridgeInformation.matterbridgeQrPairingCode = this.matterbridgeQrPairingCode;
|
|
2643
2726
|
this.matterbridgeInformation.matterbridgeManualPairingCode = this.matterbridgeManualPairingCode;
|
|
2644
2727
|
this.matterbridgeInformation.matterbridgeFabricInformations = this.matterbridgeFabricInformations;
|
|
2645
|
-
this.matterbridgeInformation.matterbridgeSessionInformations = this.matterbridgeSessionInformations;
|
|
2728
|
+
// this.matterbridgeInformation.matterbridgeSessionInformations = this.matterbridgeSessionInformations;
|
|
2729
|
+
this.matterbridgeInformation.matterbridgeSessionInformations = Array.from(this.matterbridgeSessionInformations.values());
|
|
2730
|
+
// console.log('this.matterbridgeSessionInformations:', this.matterbridgeSessionInformations);
|
|
2646
2731
|
if (this.profile)
|
|
2647
2732
|
this.matterbridgeInformation.profile = this.profile;
|
|
2648
2733
|
// const response = { wssHost, ssl: hasParameter('ssl'), qrPairingCode, manualPairingCode, systemInformation: this.systemInformation, matterbridgeInformation: this.matterbridgeInformation };
|
|
@@ -2882,6 +2967,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2882
2967
|
// Handle the command setbridgemode from Settings
|
|
2883
2968
|
if (command === 'setbridgemode') {
|
|
2884
2969
|
this.log.debug(`setbridgemode: ${param}`);
|
|
2970
|
+
this.matterbridgeInformation.restartRequired = true;
|
|
2885
2971
|
await this.nodeContext?.set('bridgeMode', param);
|
|
2886
2972
|
res.json({ message: 'Command received' });
|
|
2887
2973
|
return;
|
|
@@ -2929,7 +3015,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2929
3015
|
}
|
|
2930
3016
|
// Handle the command setmbloglevel from Settings
|
|
2931
3017
|
if (command === 'setmjloglevel') {
|
|
2932
|
-
this.log.debug('Matter.js log level
|
|
3018
|
+
this.log.debug('Matter.js log level:', param);
|
|
2933
3019
|
if (param === 'Debug') {
|
|
2934
3020
|
Logger.defaultLogLevel = Level.DEBUG;
|
|
2935
3021
|
}
|
|
@@ -2952,6 +3038,33 @@ export class Matterbridge extends EventEmitter {
|
|
|
2952
3038
|
res.json({ message: 'Command received' });
|
|
2953
3039
|
return;
|
|
2954
3040
|
}
|
|
3041
|
+
// Handle the command setmdnsinterface from Settings
|
|
3042
|
+
if (command === 'setmdnsinterface') {
|
|
3043
|
+
param = param.slice(1, -1); // Remove the first and last characters *mdns*
|
|
3044
|
+
this.matterbridgeInformation.mattermdnsinterface = param;
|
|
3045
|
+
this.log.debug('Matter.js mdns interface:', param === '' ? 'All interfaces' : param);
|
|
3046
|
+
await this.nodeContext?.set('mattermdnsinterface', param);
|
|
3047
|
+
res.json({ message: 'Command received' });
|
|
3048
|
+
return;
|
|
3049
|
+
}
|
|
3050
|
+
// Handle the command setipv4address from Settings
|
|
3051
|
+
if (command === 'setipv4address') {
|
|
3052
|
+
param = param.slice(1, -1); // Remove the first and last characters *ip*
|
|
3053
|
+
this.matterbridgeInformation.matteripv4address = param;
|
|
3054
|
+
this.log.debug('Matter.js ipv4 address:', param === '' ? 'All ipv4 addresses' : param);
|
|
3055
|
+
await this.nodeContext?.set('matteripv4address', param);
|
|
3056
|
+
res.json({ message: 'Command received' });
|
|
3057
|
+
return;
|
|
3058
|
+
}
|
|
3059
|
+
// Handle the command setipv6address from Settings
|
|
3060
|
+
if (command === 'setipv6address') {
|
|
3061
|
+
param = param.slice(1, -1); // Remove the first and last characters *ip*
|
|
3062
|
+
this.matterbridgeInformation.matteripv6address = param;
|
|
3063
|
+
this.log.debug('Matter.js ipv6 address:', param === '' ? 'All ipv6 addresses' : param);
|
|
3064
|
+
await this.nodeContext?.set('matteripv6address', param);
|
|
3065
|
+
res.json({ message: 'Command received' });
|
|
3066
|
+
return;
|
|
3067
|
+
}
|
|
2955
3068
|
// Handle the command setmbloglevel from Settings
|
|
2956
3069
|
if (command === 'setmblogfile') {
|
|
2957
3070
|
this.log.debug('Matterbridge file log:', param);
|
|
@@ -3034,6 +3147,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
3034
3147
|
this.log.error('Error updating matterbridge');
|
|
3035
3148
|
}
|
|
3036
3149
|
await this.updateProcess();
|
|
3150
|
+
this.matterbridgeInformation.restartRequired = true;
|
|
3037
3151
|
res.json({ message: 'Command received' });
|
|
3038
3152
|
return;
|
|
3039
3153
|
}
|
|
@@ -3051,6 +3165,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
3051
3165
|
return;
|
|
3052
3166
|
this.plugins.saveConfigFromJson(plugin, req.body);
|
|
3053
3167
|
}
|
|
3168
|
+
this.matterbridgeInformation.restartRequired = true;
|
|
3054
3169
|
res.json({ message: 'Command received' });
|
|
3055
3170
|
return;
|
|
3056
3171
|
}
|
|
@@ -3066,7 +3181,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
3066
3181
|
catch (error) {
|
|
3067
3182
|
this.log.error(`Error installing plugin ${plg}${param}${er}`);
|
|
3068
3183
|
}
|
|
3069
|
-
|
|
3184
|
+
this.matterbridgeInformation.restartRequired = true;
|
|
3185
|
+
// Also add the plugin to matterbridge so no return!
|
|
3070
3186
|
// res.json({ message: 'Command received' });
|
|
3071
3187
|
// return;
|
|
3072
3188
|
}
|
|
@@ -3175,6 +3291,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
3175
3291
|
attributes += `Temperature: ${clusterServer.attributes.localTemperature.getLocal() / 100}°C `;
|
|
3176
3292
|
if (clusterServer.name === 'LevelControl')
|
|
3177
3293
|
attributes += `Level: ${clusterServer.getCurrentLevelAttribute()}% `;
|
|
3294
|
+
if (clusterServer.name === 'ColorControl' && clusterServer.isAttributeSupportedByName('currentX'))
|
|
3295
|
+
attributes += `X: ${Math.round(clusterServer.getCurrentXAttribute())} Y: ${Math.round(clusterServer.getCurrentYAttribute())} `;
|
|
3178
3296
|
if (clusterServer.name === 'ColorControl' && clusterServer.isAttributeSupportedByName('currentHue'))
|
|
3179
3297
|
attributes += `Hue: ${Math.round(clusterServer.getCurrentHueAttribute())} Saturation: ${Math.round(clusterServer.getCurrentSaturationAttribute())}% `;
|
|
3180
3298
|
if (clusterServer.name === 'ColorControl' && clusterServer.isAttributeSupportedByName('colorTemperatureMireds'))
|
|
@@ -3183,6 +3301,10 @@ export class Matterbridge extends EventEmitter {
|
|
|
3183
3301
|
attributes += `Contact: ${clusterServer.getStateValueAttribute()} `;
|
|
3184
3302
|
if (clusterServer.name === 'BooleanStateConfiguration' && clusterServer.isAttributeSupportedByName('alarmsActive'))
|
|
3185
3303
|
attributes += `Active alarms: ${stringify(clusterServer.getAlarmsActiveAttribute())} `;
|
|
3304
|
+
if (clusterServer.name === 'SmokeCoAlarm' && clusterServer.isAttributeSupportedByName('smokeState'))
|
|
3305
|
+
attributes += `Smoke: ${clusterServer.getSmokeStateAttribute()} `;
|
|
3306
|
+
if (clusterServer.name === 'SmokeCoAlarm' && clusterServer.isAttributeSupportedByName('coState'))
|
|
3307
|
+
attributes += `Co: ${clusterServer.getCoStateAttribute()} `;
|
|
3186
3308
|
if (clusterServer.name === 'FanControl')
|
|
3187
3309
|
attributes += `Mode: ${clusterServer.getFanModeAttribute()} Speed: ${clusterServer.getPercentCurrentAttribute()} `;
|
|
3188
3310
|
if (clusterServer.name === 'FanControl' && clusterServer.isAttributeSupportedByName('speedCurrent'))
|