matterbridge 2.1.1-dev.2 → 2.1.1
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 +3 -2
- package/dist/cli.d.ts +25 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +26 -0
- package/dist/cli.js.map +1 -0
- package/dist/cluster/export.d.ts +2 -0
- package/dist/cluster/export.d.ts.map +1 -0
- package/dist/cluster/export.js +2 -0
- package/dist/cluster/export.js.map +1 -0
- package/dist/defaultConfigSchema.d.ts +27 -0
- package/dist/defaultConfigSchema.d.ts.map +1 -0
- package/dist/defaultConfigSchema.js +23 -0
- package/dist/defaultConfigSchema.js.map +1 -0
- package/dist/deviceManager.d.ts +46 -0
- package/dist/deviceManager.d.ts.map +1 -0
- package/dist/deviceManager.js +26 -1
- package/dist/deviceManager.js.map +1 -0
- package/dist/frontend.d.ts +109 -0
- package/dist/frontend.d.ts.map +1 -0
- package/dist/frontend.js +227 -22
- package/dist/frontend.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/export.d.ts +2 -0
- package/dist/logger/export.d.ts.map +1 -0
- package/dist/logger/export.js +1 -0
- package/dist/logger/export.js.map +1 -0
- package/dist/matter/behaviors.d.ts +2 -0
- package/dist/matter/behaviors.d.ts.map +1 -0
- package/dist/matter/behaviors.js +2 -0
- package/dist/matter/behaviors.js.map +1 -0
- package/dist/matter/clusters.d.ts +2 -0
- package/dist/matter/clusters.d.ts.map +1 -0
- package/dist/matter/clusters.js +2 -0
- package/dist/matter/clusters.js.map +1 -0
- package/dist/matter/devices.d.ts +2 -0
- package/dist/matter/devices.d.ts.map +1 -0
- package/dist/matter/devices.js +2 -0
- package/dist/matter/devices.js.map +1 -0
- package/dist/matter/endpoints.d.ts +2 -0
- package/dist/matter/endpoints.d.ts.map +1 -0
- package/dist/matter/endpoints.js +2 -0
- package/dist/matter/endpoints.js.map +1 -0
- package/dist/matter/export.d.ts +4 -0
- package/dist/matter/export.d.ts.map +1 -0
- package/dist/matter/export.js +2 -0
- package/dist/matter/export.js.map +1 -0
- package/dist/matter/types.d.ts +3 -0
- package/dist/matter/types.d.ts.map +1 -0
- package/dist/matter/types.js +2 -0
- package/dist/matter/types.js.map +1 -0
- package/dist/matterbridge.d.ts +409 -0
- package/dist/matterbridge.d.ts.map +1 -0
- package/dist/matterbridge.js +754 -40
- package/dist/matterbridge.js.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts +39 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.js +33 -0
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
- package/dist/matterbridgeBehaviors.d.ts +1056 -0
- package/dist/matterbridgeBehaviors.d.ts.map +1 -0
- package/dist/matterbridgeBehaviors.js +32 -1
- package/dist/matterbridgeBehaviors.js.map +1 -0
- package/dist/matterbridgeDeviceTypes.d.ts +177 -0
- package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
- package/dist/matterbridgeDeviceTypes.js +112 -11
- package/dist/matterbridgeDeviceTypes.js.map +1 -0
- package/dist/matterbridgeDynamicPlatform.d.ts +39 -0
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
- package/dist/matterbridgeDynamicPlatform.js +33 -0
- package/dist/matterbridgeDynamicPlatform.js.map +1 -0
- package/dist/matterbridgeEndpoint.d.ts +834 -0
- package/dist/matterbridgeEndpoint.d.ts.map +1 -0
- package/dist/matterbridgeEndpoint.js +690 -6
- package/dist/matterbridgeEndpoint.js.map +1 -0
- package/dist/matterbridgeEndpointHelpers.d.ts +2262 -0
- package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
- package/dist/matterbridgeEndpointHelpers.js +96 -0
- package/dist/matterbridgeEndpointHelpers.js.map +1 -0
- package/dist/matterbridgePlatform.d.ts +164 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -0
- package/dist/matterbridgePlatform.js +123 -3
- package/dist/matterbridgePlatform.js.map +1 -0
- package/dist/matterbridgeTypes.d.ts +165 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -0
- package/dist/matterbridgeTypes.js +24 -0
- package/dist/matterbridgeTypes.js.map +1 -0
- package/dist/pluginManager.d.ts +238 -0
- package/dist/pluginManager.d.ts.map +1 -0
- package/dist/pluginManager.js +240 -3
- package/dist/pluginManager.js.map +1 -0
- package/dist/storage/export.d.ts +2 -0
- package/dist/storage/export.d.ts.map +1 -0
- package/dist/storage/export.js +1 -0
- package/dist/storage/export.js.map +1 -0
- package/dist/utils/colorUtils.d.ts +61 -0
- package/dist/utils/colorUtils.d.ts.map +1 -0
- package/dist/utils/colorUtils.js +205 -2
- package/dist/utils/colorUtils.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 +1 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/utils/utils.d.ts +221 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +251 -7
- package/dist/utils/utils.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -31,11 +31,12 @@ matterbridge-zigbee2mqtt v. 2.4.4
|
|
|
31
31
|
matterbridge-somfy-tahoma v. 1.2.3
|
|
32
32
|
matterbridge-hass v. 0.0.8
|
|
33
33
|
|
|
34
|
-
## [2.1.1
|
|
34
|
+
## [2.1.1] - 2025-02-02
|
|
35
35
|
|
|
36
36
|
### Fixed
|
|
37
37
|
|
|
38
|
-
- [matter.js]: Fix
|
|
38
|
+
- [matter.js]: Fix close server nodes.
|
|
39
|
+
|
|
39
40
|
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
40
41
|
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
41
42
|
</a>
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* This file contains the CLI entry point of Matterbridge.
|
|
4
|
+
*
|
|
5
|
+
* @file cli.ts
|
|
6
|
+
* @author Luca Liguori
|
|
7
|
+
* @date 2023-12-29
|
|
8
|
+
* @version 1.0.11
|
|
9
|
+
*
|
|
10
|
+
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License. *
|
|
23
|
+
*/
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* This file contains the CLI entry point of Matterbridge.
|
|
4
|
+
*
|
|
5
|
+
* @file cli.ts
|
|
6
|
+
* @author Luca Liguori
|
|
7
|
+
* @date 2023-12-29
|
|
8
|
+
* @version 1.0.11
|
|
9
|
+
*
|
|
10
|
+
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License. *
|
|
23
|
+
*/
|
|
24
|
+
/* eslint-disable no-console */
|
|
2
25
|
import { Matterbridge } from './matterbridge.js';
|
|
3
26
|
let instance;
|
|
4
27
|
const cli = '\u001B[32m';
|
|
@@ -34,10 +57,13 @@ async function restart() {
|
|
|
34
57
|
async function update() {
|
|
35
58
|
if (process.argv.includes('-debug'))
|
|
36
59
|
console.log(cli + 'CLI: received update event, updating...' + rs);
|
|
60
|
+
// TODO: Implement update logic outside of matterbridge
|
|
37
61
|
instance = await Matterbridge.loadInstance(true);
|
|
38
62
|
registerHandlers();
|
|
39
63
|
}
|
|
40
64
|
process.title = 'matterbridge';
|
|
65
|
+
// Run the main function
|
|
41
66
|
main().catch((error) => {
|
|
42
67
|
console.error(er + `CLI: Matterbridge.loadInstance() failed with error: ${error}` + rs);
|
|
43
68
|
});
|
|
69
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+BAA+B;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,IAAI,QAAkC,CAAC;AACvC,MAAM,GAAG,GAAG,YAAY,CAAC;AACzB,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAC5B,MAAM,EAAE,GAAG,cAAc,CAAC;AAE1B,KAAK,UAAU,IAAI;IACjB,IA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AC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,yCAAyC,GAAG,EAAE,CAAC,CAAC;IACvG,QAAQ,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACjD,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,KAAK,UAAU,MAAM;IACnB,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,yCAAyC,GAAG,EAAE,CAAC,CAAC;IACvG,uDAAuD;IACvD,QAAQ,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACjD,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC;AAE/B,wBAAwB;AACxB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,uDAAuD,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AAC1F,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/cluster/export.ts"],"names":[],"mappings":""}
|
package/dist/cluster/export.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/cluster/export.ts"],"names":[],"mappings":";AAAA,8BAA8B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the default config for the plugins.
|
|
3
|
+
*
|
|
4
|
+
* @file defaultConfigSchema.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @date 2024-05-07
|
|
7
|
+
* @version 1.0.1
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2024, 2025, 2026 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License. *
|
|
22
|
+
*/
|
|
23
|
+
import { PlatformConfig } from './matterbridgePlatform.js';
|
|
24
|
+
export declare const zigbee2mqtt_config: PlatformConfig;
|
|
25
|
+
export declare const somfytahoma_config: PlatformConfig;
|
|
26
|
+
export declare const shelly_config: PlatformConfig;
|
|
27
|
+
//# sourceMappingURL=defaultConfigSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultConfigSchema.d.ts","sourceRoot":"","sources":["../src/defaultConfigSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,eAAO,MAAM,kBAAkB,EAAE,cAiBhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAWhC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAkC3B,CAAC"}
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the default config for the plugins.
|
|
3
|
+
*
|
|
4
|
+
* @file defaultConfigSchema.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @date 2024-05-07
|
|
7
|
+
* @version 1.0.1
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2024, 2025, 2026 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License. *
|
|
22
|
+
*/
|
|
1
23
|
export const zigbee2mqtt_config = {
|
|
2
24
|
name: 'matterbridge-zigbee2mqtt',
|
|
3
25
|
type: 'DynamicPlatform',
|
|
@@ -63,3 +85,4 @@ export const shelly_config = {
|
|
|
63
85
|
debugWs: false,
|
|
64
86
|
unregisterOnShutdown: false,
|
|
65
87
|
};
|
|
88
|
+
//# sourceMappingURL=defaultConfigSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultConfigSchema.js","sourceRoot":"","sources":["../src/defaultConfigSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAmB;IAChD,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,gBAAgB,EAAE,EAAE;IACpB,sBAAsB,EAAE,EAAE;IAC1B,KAAK,EAAE,KAAK;IACZ,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAmB;IAChD,IAAI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
+
* @file devices.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @date 2024-07-26
|
|
7
|
+
* @version 1.0.9
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2024, 2025, 2026 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License. *
|
|
22
|
+
*/
|
|
23
|
+
import { LogLevel } from './logger/export.js';
|
|
24
|
+
import { NodeStorage } from './storage/export.js';
|
|
25
|
+
import { Matterbridge } from './matterbridge.js';
|
|
26
|
+
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
27
|
+
export declare class DeviceManager {
|
|
28
|
+
private readonly _devices;
|
|
29
|
+
private readonly matterbridge;
|
|
30
|
+
private readonly nodeContext;
|
|
31
|
+
private readonly log;
|
|
32
|
+
constructor(matterbridge: Matterbridge, nodeContext: NodeStorage);
|
|
33
|
+
get length(): number;
|
|
34
|
+
get size(): number;
|
|
35
|
+
has(uniqueId: string): boolean;
|
|
36
|
+
get(uniqueId: string): MatterbridgeEndpoint | undefined;
|
|
37
|
+
set(device: MatterbridgeEndpoint): MatterbridgeEndpoint;
|
|
38
|
+
remove(device: MatterbridgeEndpoint): boolean;
|
|
39
|
+
clear(): void;
|
|
40
|
+
array(): MatterbridgeEndpoint[];
|
|
41
|
+
[Symbol.iterator](): MapIterator<MatterbridgeEndpoint>;
|
|
42
|
+
forEach(callback: (device: MatterbridgeEndpoint) => Promise<void>): Promise<void>;
|
|
43
|
+
get logLevel(): LogLevel;
|
|
44
|
+
set logLevel(logLevel: LogLevel);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=deviceManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceManager.d.ts","sourceRoot":"","sources":["../src/deviceManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAwB,QAAQ,EAAmB,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IACpE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;gBAErB,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW;IAOhE,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI9B,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAIvD,GAAG,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB;IAOvD,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO;IAM7C,KAAK,IAAI,IAAI;IAIb,KAAK,IAAI,oBAAoB,EAAE;IAI/B,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIX,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAYvF,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAE9B;CACF"}
|
package/dist/deviceManager.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the DeviceManager class.
|
|
3
|
+
*
|
|
4
|
+
* @file devices.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @date 2024-07-26
|
|
7
|
+
* @version 1.0.9
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2024, 2025, 2026 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License. *
|
|
22
|
+
*/
|
|
23
|
+
// NodeStorage and AnsiLogger modules
|
|
1
24
|
import { AnsiLogger, BLUE, er } from './logger/export.js';
|
|
2
25
|
import { dev } from './matterbridgeTypes.js';
|
|
3
26
|
export class DeviceManager {
|
|
@@ -8,7 +31,7 @@ export class DeviceManager {
|
|
|
8
31
|
constructor(matterbridge, nodeContext) {
|
|
9
32
|
this.matterbridge = matterbridge;
|
|
10
33
|
this.nodeContext = nodeContext;
|
|
11
|
-
this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4
|
|
34
|
+
this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: matterbridge.log.logLevel });
|
|
12
35
|
this.log.debug('Matterbridge device manager starting...');
|
|
13
36
|
}
|
|
14
37
|
get length() {
|
|
@@ -54,6 +77,7 @@ export class DeviceManager {
|
|
|
54
77
|
}
|
|
55
78
|
catch (error) {
|
|
56
79
|
this.log.error(`Error processing forEach device ${dev}${device.deviceName}${er} serialNumber ${BLUE}${device.serialNumber}${er} uniqueId: ${BLUE}${device.uniqueId}${er}:`, error);
|
|
80
|
+
// throw error;
|
|
57
81
|
}
|
|
58
82
|
});
|
|
59
83
|
await Promise.all(tasks);
|
|
@@ -65,3 +89,4 @@ export class DeviceManager {
|
|
|
65
89
|
this.log.logLevel = logLevel;
|
|
66
90
|
}
|
|
67
91
|
}
|
|
92
|
+
//# sourceMappingURL=deviceManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceManager.js","sourceRoot":"","sources":["../src/deviceManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAA6B,MAAM,oBAAoB,CAAC;AAMrF,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAE7C,MAAM,OAAO,aAAa;IACP,QAAQ,GAAG,IAAI,GAAG,EAAgC,CAAC;IACnD,YAAY,CAAe;IAC3B,WAAW,CAAc;IACzB,GAAG,CAAa;IAEjC,YAAY,YAA0B,EAAE,WAAwB;QAC9D,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,qCAA6B,EAAE,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9I,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,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C7B,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the class Frontend.
|
|
3
|
+
*
|
|
4
|
+
* @file frontend.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @date 2025-01-13
|
|
7
|
+
* @version 1.0.1
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License. *
|
|
22
|
+
*/
|
|
23
|
+
import { LogLevel } from './logger/export.js';
|
|
24
|
+
import { Matterbridge } from './matterbridge.js';
|
|
25
|
+
/**
|
|
26
|
+
* Websocket message ID for logging.
|
|
27
|
+
* @constant {number}
|
|
28
|
+
*/
|
|
29
|
+
export declare const WS_ID_LOG = 0;
|
|
30
|
+
/**
|
|
31
|
+
* Websocket message ID indicating a refresh is needed.
|
|
32
|
+
* @constant {number}
|
|
33
|
+
*/
|
|
34
|
+
export declare const WS_ID_REFRESH_NEEDED = 1;
|
|
35
|
+
/**
|
|
36
|
+
* Websocket message ID indicating a restart is needed.
|
|
37
|
+
* @constant {number}
|
|
38
|
+
*/
|
|
39
|
+
export declare const WS_ID_RESTART_NEEDED = 2;
|
|
40
|
+
/**
|
|
41
|
+
* Initializes the frontend of Matterbridge.
|
|
42
|
+
*
|
|
43
|
+
* @param port The port number to run the frontend server on. Default is 8283.
|
|
44
|
+
*/
|
|
45
|
+
export declare class Frontend {
|
|
46
|
+
private matterbridge;
|
|
47
|
+
private log;
|
|
48
|
+
private port;
|
|
49
|
+
private initializeError;
|
|
50
|
+
private expressApp;
|
|
51
|
+
private httpServer;
|
|
52
|
+
private httpsServer;
|
|
53
|
+
private webSocketServer;
|
|
54
|
+
private memoryData;
|
|
55
|
+
private memoryInterval?;
|
|
56
|
+
private memoryTimeout?;
|
|
57
|
+
constructor(matterbridge: Matterbridge);
|
|
58
|
+
set logLevel(logLevel: LogLevel);
|
|
59
|
+
start(port?: number): Promise<void>;
|
|
60
|
+
stop(): Promise<void>;
|
|
61
|
+
private formatMemoryUsage;
|
|
62
|
+
private startMemoryDump;
|
|
63
|
+
private stopMemoryDump;
|
|
64
|
+
/**
|
|
65
|
+
* Retrieves the api settings.
|
|
66
|
+
* @returns {Promise<object>} A promise that resolve in the api settings object.
|
|
67
|
+
*/
|
|
68
|
+
private getApiSettings;
|
|
69
|
+
/**
|
|
70
|
+
* Retrieves the cluster text description from a given device.
|
|
71
|
+
* @param {MatterbridgeDevice} device - The MatterbridgeDevice object.
|
|
72
|
+
* @returns {string} The attributes description of the cluster servers in the device.
|
|
73
|
+
*/
|
|
74
|
+
private getClusterTextFromDevice;
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the base registered plugins sanitized for res.json().
|
|
77
|
+
* @returns {BaseRegisteredPlugin[]} An array of BaseRegisteredPlugin.
|
|
78
|
+
*/
|
|
79
|
+
private getBaseRegisteredPlugins;
|
|
80
|
+
/**
|
|
81
|
+
* Handles incoming websocket messages for the Matterbridge.
|
|
82
|
+
*
|
|
83
|
+
* @param {Matterbridge} this - The Matterbridge instance.
|
|
84
|
+
* @param {WebSocket} client - The websocket client that sent the message.
|
|
85
|
+
* @param {WebSocket.RawData} message - The raw data of the message received from the client.
|
|
86
|
+
* @returns {Promise<void>} A promise that resolves when the message has been handled.
|
|
87
|
+
*/
|
|
88
|
+
private wsMessageHandler;
|
|
89
|
+
/**
|
|
90
|
+
* Sends a WebSocket message to all connected clients. The function is called by AnsiLogger.setGlobalCallback.
|
|
91
|
+
*
|
|
92
|
+
* @param {string} level - The logger level of the message: debug info notice warn error fatal...
|
|
93
|
+
* @param {string} time - The time string of the message
|
|
94
|
+
* @param {string} name - The logger name of the message
|
|
95
|
+
* @param {string} message - The content of the message.
|
|
96
|
+
*/
|
|
97
|
+
wssSendMessage(level: string, time: string, name: string, message: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* Sends a need to refresh WebSocket message to all connected clients.
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
102
|
+
wssSendRefreshRequired(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Sends a need to restart WebSocket message to all connected clients.
|
|
105
|
+
*
|
|
106
|
+
*/
|
|
107
|
+
wssSendRestartRequired(): void;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=frontend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../src/frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAeH,OAAO,EAA4C,QAAQ,EAA2E,MAAM,oBAAoB,CAAC;AAKjK,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD;;;GAGG;AACH,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;GAIG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,UAAU,CAAyB;IAC3C,OAA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