matterbridge 3.0.7 → 3.0.8-dev-20250622-9a6255a
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 +25 -0
- package/bin/matterbridge +2 -0
- package/dist/cli.js +5 -66
- package/dist/clusters/export.js +0 -2
- package/dist/defaultConfigSchema.js +0 -23
- package/dist/deviceManager.js +2 -95
- package/dist/devices/export.js +0 -2
- package/dist/evse.js +9 -65
- package/dist/frontend.js +47 -383
- package/dist/globalMatterbridge.js +0 -20
- package/dist/helpers.js +4 -52
- package/dist/index.js +2 -29
- package/dist/laundryWasher.js +7 -92
- package/dist/logger/export.js +0 -1
- package/dist/matter/behaviors.js +0 -2
- package/dist/matter/clusters.js +0 -2
- package/dist/matter/devices.js +0 -2
- package/dist/matter/endpoints.js +0 -2
- package/dist/matter/export.js +0 -2
- package/dist/matter/types.js +0 -2
- package/dist/matterbridge.js +53 -755
- package/dist/matterbridgeAccessoryPlatform.js +0 -34
- package/dist/matterbridgeBehaviors.js +1 -54
- package/dist/matterbridgeDeviceTypes.js +15 -578
- package/dist/matterbridgeDynamicPlatform.js +0 -34
- package/dist/matterbridgeEndpoint.js +45 -1000
- package/dist/matterbridgeEndpointHelpers.js +12 -206
- package/dist/matterbridgePlatform.js +13 -225
- package/dist/matterbridgeTypes.js +0 -24
- package/dist/pluginManager.js +4 -270
- package/dist/roboticVacuumCleaner.js +9 -84
- package/dist/shelly.js +9 -156
- package/dist/storage/export.js +0 -1
- package/dist/update.js +0 -53
- package/dist/utils/colorUtils.js +2 -205
- package/dist/utils/commandLine.js +0 -53
- package/dist/utils/copyDirectory.js +1 -37
- package/dist/utils/createDirectory.js +0 -31
- package/dist/utils/createZip.js +2 -42
- package/dist/utils/deepCopy.js +0 -38
- package/dist/utils/deepEqual.js +1 -71
- package/dist/utils/export.js +0 -1
- package/dist/utils/hex.js +0 -57
- package/dist/utils/isvalid.js +0 -100
- package/dist/utils/network.js +6 -77
- package/dist/utils/spawn.js +0 -16
- package/dist/utils/wait.js +10 -58
- package/dist/waterHeater.js +5 -65
- package/frontend/build/matterbridge 1250x1250.png +0 -0
- package/frontend/build/matterbridge 624x624.png +0 -0
- package/frontend/package-lock.json +19176 -0
- package/frontend/package.json +79 -0
- package/frontend/public/Shelly.svg +1 -0
- package/frontend/public/bmc-button.svg +22 -0
- package/frontend/public/discord.svg +5 -0
- package/frontend/public/favicon.ico +0 -0
- package/frontend/public/index.html +19 -0
- package/frontend/public/manifest.json +15 -0
- package/frontend/public/matter.png +0 -0
- package/frontend/public/matterbridge 1250x1250.png +0 -0
- package/frontend/public/matterbridge 32x32.png +0 -0
- package/frontend/public/matterbridge 624x624.png +0 -0
- package/frontend/public/matterbridge 64x64.png +0 -0
- package/frontend/public/matterbridge.svg +50 -0
- package/frontend/public/robots.txt +3 -0
- package/npm-shrinkwrap.json +33 -42
- package/package.json +3 -4
- package/dist/cli.d.ts +0 -29
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/clusters/export.d.ts +0 -2
- package/dist/clusters/export.d.ts.map +0 -1
- package/dist/clusters/export.js.map +0 -1
- package/dist/defaultConfigSchema.d.ts +0 -27
- package/dist/defaultConfigSchema.d.ts.map +0 -1
- package/dist/defaultConfigSchema.js.map +0 -1
- package/dist/deviceManager.d.ts +0 -114
- package/dist/deviceManager.d.ts.map +0 -1
- package/dist/deviceManager.js.map +0 -1
- package/dist/devices/export.d.ts +0 -5
- package/dist/devices/export.d.ts.map +0 -1
- package/dist/devices/export.js.map +0 -1
- package/dist/evse.d.ts +0 -67
- package/dist/evse.d.ts.map +0 -1
- package/dist/evse.js.map +0 -1
- package/dist/frontend.d.ts +0 -256
- package/dist/frontend.d.ts.map +0 -1
- package/dist/frontend.js.map +0 -1
- package/dist/globalMatterbridge.d.ts +0 -32
- package/dist/globalMatterbridge.d.ts.map +0 -1
- package/dist/globalMatterbridge.js.map +0 -1
- package/dist/helpers.d.ts +0 -47
- package/dist/helpers.d.ts.map +0 -1
- package/dist/helpers.js.map +0 -1
- package/dist/index.d.ts +0 -37
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/laundryWasher.d.ts +0 -243
- package/dist/laundryWasher.d.ts.map +0 -1
- package/dist/laundryWasher.js.map +0 -1
- package/dist/logger/export.d.ts +0 -2
- package/dist/logger/export.d.ts.map +0 -1
- package/dist/logger/export.js.map +0 -1
- package/dist/matter/behaviors.d.ts +0 -2
- package/dist/matter/behaviors.d.ts.map +0 -1
- package/dist/matter/behaviors.js.map +0 -1
- package/dist/matter/clusters.d.ts +0 -2
- package/dist/matter/clusters.d.ts.map +0 -1
- package/dist/matter/clusters.js.map +0 -1
- package/dist/matter/devices.d.ts +0 -2
- package/dist/matter/devices.d.ts.map +0 -1
- package/dist/matter/devices.js.map +0 -1
- package/dist/matter/endpoints.d.ts +0 -2
- package/dist/matter/endpoints.d.ts.map +0 -1
- package/dist/matter/endpoints.js.map +0 -1
- package/dist/matter/export.d.ts +0 -5
- package/dist/matter/export.d.ts.map +0 -1
- package/dist/matter/export.js.map +0 -1
- package/dist/matter/types.d.ts +0 -3
- package/dist/matter/types.d.ts.map +0 -1
- package/dist/matter/types.js.map +0 -1
- package/dist/matterbridge.d.ts +0 -445
- package/dist/matterbridge.d.ts.map +0 -1
- package/dist/matterbridge.js.map +0 -1
- package/dist/matterbridgeAccessoryPlatform.d.ts +0 -40
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
- package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
- package/dist/matterbridgeBehaviors.d.ts +0 -1333
- package/dist/matterbridgeBehaviors.d.ts.map +0 -1
- package/dist/matterbridgeBehaviors.js.map +0 -1
- package/dist/matterbridgeDeviceTypes.d.ts +0 -644
- package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
- package/dist/matterbridgeDeviceTypes.js.map +0 -1
- package/dist/matterbridgeDynamicPlatform.d.ts +0 -40
- package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
- package/dist/matterbridgeDynamicPlatform.js.map +0 -1
- package/dist/matterbridgeEndpoint.d.ts +0 -1145
- package/dist/matterbridgeEndpoint.d.ts.map +0 -1
- package/dist/matterbridgeEndpoint.js.map +0 -1
- package/dist/matterbridgeEndpointHelpers.d.ts +0 -3083
- package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
- package/dist/matterbridgeEndpointHelpers.js.map +0 -1
- package/dist/matterbridgePlatform.d.ts +0 -290
- package/dist/matterbridgePlatform.d.ts.map +0 -1
- package/dist/matterbridgePlatform.js.map +0 -1
- package/dist/matterbridgeTypes.d.ts +0 -196
- package/dist/matterbridgeTypes.d.ts.map +0 -1
- package/dist/matterbridgeTypes.js.map +0 -1
- package/dist/pluginManager.d.ts +0 -273
- package/dist/pluginManager.d.ts.map +0 -1
- package/dist/pluginManager.js.map +0 -1
- package/dist/roboticVacuumCleaner.d.ts +0 -102
- package/dist/roboticVacuumCleaner.d.ts.map +0 -1
- package/dist/roboticVacuumCleaner.js.map +0 -1
- package/dist/shelly.d.ts +0 -161
- package/dist/shelly.d.ts.map +0 -1
- package/dist/shelly.js.map +0 -1
- package/dist/storage/export.d.ts +0 -2
- package/dist/storage/export.d.ts.map +0 -1
- package/dist/storage/export.js.map +0 -1
- package/dist/update.d.ts +0 -58
- package/dist/update.d.ts.map +0 -1
- package/dist/update.js.map +0 -1
- package/dist/utils/colorUtils.d.ts +0 -61
- package/dist/utils/colorUtils.d.ts.map +0 -1
- package/dist/utils/colorUtils.js.map +0 -1
- package/dist/utils/commandLine.d.ts +0 -58
- package/dist/utils/commandLine.d.ts.map +0 -1
- package/dist/utils/commandLine.js.map +0 -1
- package/dist/utils/copyDirectory.d.ts +0 -32
- package/dist/utils/copyDirectory.d.ts.map +0 -1
- package/dist/utils/copyDirectory.js.map +0 -1
- package/dist/utils/createDirectory.d.ts +0 -32
- package/dist/utils/createDirectory.d.ts.map +0 -1
- package/dist/utils/createDirectory.js.map +0 -1
- package/dist/utils/createZip.d.ts +0 -38
- package/dist/utils/createZip.d.ts.map +0 -1
- package/dist/utils/createZip.js.map +0 -1
- package/dist/utils/deepCopy.d.ts +0 -31
- package/dist/utils/deepCopy.d.ts.map +0 -1
- package/dist/utils/deepCopy.js.map +0 -1
- package/dist/utils/deepEqual.d.ts +0 -53
- package/dist/utils/deepEqual.d.ts.map +0 -1
- package/dist/utils/deepEqual.js.map +0 -1
- package/dist/utils/export.d.ts +0 -12
- package/dist/utils/export.d.ts.map +0 -1
- package/dist/utils/export.js.map +0 -1
- package/dist/utils/hex.d.ts +0 -48
- package/dist/utils/hex.d.ts.map +0 -1
- package/dist/utils/hex.js.map +0 -1
- package/dist/utils/isvalid.d.ts +0 -102
- package/dist/utils/isvalid.d.ts.map +0 -1
- package/dist/utils/isvalid.js.map +0 -1
- package/dist/utils/network.d.ts +0 -69
- package/dist/utils/network.d.ts.map +0 -1
- package/dist/utils/network.js.map +0 -1
- package/dist/utils/spawn.d.ts +0 -12
- package/dist/utils/spawn.d.ts.map +0 -1
- package/dist/utils/spawn.js.map +0 -1
- package/dist/utils/wait.d.ts +0 -52
- package/dist/utils/wait.d.ts.map +0 -1
- package/dist/utils/wait.js.map +0 -1
- package/dist/waterHeater.d.ts +0 -90
- package/dist/waterHeater.d.ts.map +0 -1
- package/dist/waterHeater.js.map +0 -1
- package/tsconfig.jest.json +0 -8
- package/tsconfig.production.json +0 -13
package/dist/deviceManager.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
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.10
|
|
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
|
-
/**
|
|
28
|
-
* Manages Matterbridge devices.
|
|
29
|
-
*/
|
|
30
|
-
export declare class DeviceManager {
|
|
31
|
-
private readonly _devices;
|
|
32
|
-
private readonly matterbridge;
|
|
33
|
-
private readonly nodeContext;
|
|
34
|
-
private readonly log;
|
|
35
|
-
/**
|
|
36
|
-
* Creates an instance of DeviceManager.
|
|
37
|
-
*
|
|
38
|
-
* @param {Matterbridge} matterbridge - The Matterbridge instance.
|
|
39
|
-
* @param {NodeStorage} nodeContext - The node storage context.
|
|
40
|
-
*/
|
|
41
|
-
constructor(matterbridge: Matterbridge, nodeContext: NodeStorage);
|
|
42
|
-
/**
|
|
43
|
-
* Gets the number of devices.
|
|
44
|
-
*
|
|
45
|
-
* @returns {number} The number of devices.
|
|
46
|
-
*/
|
|
47
|
-
get length(): number;
|
|
48
|
-
/**
|
|
49
|
-
* Gets the number of devices.
|
|
50
|
-
*
|
|
51
|
-
* @returns {number} The number of devices.
|
|
52
|
-
*/
|
|
53
|
-
get size(): number;
|
|
54
|
-
/**
|
|
55
|
-
* Checks if a device with the specified unique ID exists.
|
|
56
|
-
*
|
|
57
|
-
* @param {string} uniqueId - The unique ID of the device.
|
|
58
|
-
* @returns {boolean} True if the device exists, false otherwise.
|
|
59
|
-
*/
|
|
60
|
-
has(uniqueId: string): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Gets a device by its unique ID.
|
|
63
|
-
*
|
|
64
|
-
* @param {string} uniqueId - The unique ID of the device.
|
|
65
|
-
* @returns {MatterbridgeEndpoint | undefined} The device, or undefined if not found.
|
|
66
|
-
*/
|
|
67
|
-
get(uniqueId: string): MatterbridgeEndpoint | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Adds a device to the manager.
|
|
70
|
-
*
|
|
71
|
-
* @param {MatterbridgeEndpoint} device - The device to add.
|
|
72
|
-
* @returns {MatterbridgeEndpoint} The added device.
|
|
73
|
-
* @throws {Error} If the device does not have a unique ID.
|
|
74
|
-
*/
|
|
75
|
-
set(device: MatterbridgeEndpoint): MatterbridgeEndpoint;
|
|
76
|
-
/**
|
|
77
|
-
* Removes a device from the manager.
|
|
78
|
-
*
|
|
79
|
-
* @param {MatterbridgeEndpoint} device - The device to remove.
|
|
80
|
-
* @returns {boolean} True if the device was removed, false otherwise.
|
|
81
|
-
* @throws {Error} If the device does not have a unique ID.
|
|
82
|
-
*/
|
|
83
|
-
remove(device: MatterbridgeEndpoint): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Clears all devices from the manager.
|
|
86
|
-
*/
|
|
87
|
-
clear(): void;
|
|
88
|
-
/**
|
|
89
|
-
* Gets an array of all devices.
|
|
90
|
-
*
|
|
91
|
-
* @returns {MatterbridgeEndpoint[]} An array of all devices.
|
|
92
|
-
*/
|
|
93
|
-
array(): MatterbridgeEndpoint[];
|
|
94
|
-
/**
|
|
95
|
-
* Iterates over all devices.
|
|
96
|
-
*
|
|
97
|
-
* @returns {IterableIterator<MatterbridgeEndpoint>} An iterator for the devices.
|
|
98
|
-
*/
|
|
99
|
-
[Symbol.iterator](): MapIterator<MatterbridgeEndpoint>;
|
|
100
|
-
/**
|
|
101
|
-
* Asynchronously iterates over each device and calls the provided callback function.
|
|
102
|
-
*
|
|
103
|
-
* @param {(device: MatterbridgeEndpoint) => Promise<void>} callback - The callback function to call with each device.
|
|
104
|
-
* @returns {Promise<void>} A promise that resolves when all callbacks have been called.
|
|
105
|
-
*/
|
|
106
|
-
forEach(callback: (device: MatterbridgeEndpoint) => Promise<void>): Promise<void>;
|
|
107
|
-
/**
|
|
108
|
-
* Sets the log level.
|
|
109
|
-
*
|
|
110
|
-
* @param {LogLevel} logLevel - The log level to set.
|
|
111
|
-
*/
|
|
112
|
-
set logLevel(logLevel: LogLevel);
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=deviceManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deviceManager.d.ts","sourceRoot":"","sources":["../src/deviceManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAwB,QAAQ,EAAmB,MAAM,oBAAoB,CAAC;AAGrF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE;;GAEG;AACH,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;IAEjC;;;;;OAKG;gBACS,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW;IAOhE;;;;OAIG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;OAKG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI9B;;;;;OAKG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,oB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AAc,IAAI,GAAG,MAAM,CAAC,QAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACrL,CAAC;QACH,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,IAAI,QAAQ,CAAC,QAAkB;QAC7B,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,CAAC;CACF"}
|
package/dist/devices/export.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/devices/export.ts"],"names":[],"mappings":"AACA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/devices/export.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
package/dist/evse.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the Evse class.
|
|
3
|
-
*
|
|
4
|
-
* @file energy-evse.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @contributor Ludovic BOUÉ
|
|
7
|
-
* @date 2025-05-27
|
|
8
|
-
* @version 1.1.0
|
|
9
|
-
*
|
|
10
|
-
* Copyright 2025, 2026, 2027 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
|
-
import { MaybePromise } from '@matter/main';
|
|
25
|
-
import { EnergyEvseServer } from '@matter/main/behaviors/energy-evse';
|
|
26
|
-
import { EnergyEvseModeServer } from '@matter/main/behaviors/energy-evse-mode';
|
|
27
|
-
import { EnergyEvse, EnergyEvseMode } from '@matter/main/clusters';
|
|
28
|
-
import { ModeBase } from '@matter/main/clusters/mode-base';
|
|
29
|
-
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
30
|
-
export declare class Evse extends MatterbridgeEndpoint {
|
|
31
|
-
/**
|
|
32
|
-
* Creates an instance of the EVSE class.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} name - The name of the EVSE.
|
|
35
|
-
* @param {string} serial - The serial number of the EVSE.
|
|
36
|
-
* @param {number} [currentMode] - The current mode of the EnergyEvseMode cluster. Defaults to mode 1 (EnergyEvseMode.ModeTag.Manual).
|
|
37
|
-
* @param {EnergyEvseMode.ModeOption[]} [supportedModes] - The supported modes for the EnergyEvseMode cluster. This is a fixed attribute that defaults to a predefined set of EnergyEvseMode cluster modes.
|
|
38
|
-
* @param {EnergyEvse.State} [state] - The current state of the EVSE. Defaults to NotPluggedIn.
|
|
39
|
-
* @param {EnergyEvse.SupplyState} [supplyState] - The supply state of the EVSE. Defaults to Disabled.
|
|
40
|
-
* @param {EnergyEvse.FaultState} [faultState] - The fault state of the EVSE. Defaults to NoError.
|
|
41
|
-
* @param {number} [absMinPower=0] - Indicate the minimum electrical power that the ESA can consume when switched on. Defaults to `0` if not provided.
|
|
42
|
-
* @param {number} [absMaxPower=0] - Indicate the maximum electrical power that the ESA can consume when switched on. Defaults to `0` if not provided.
|
|
43
|
-
*/
|
|
44
|
-
constructor(name: string, serial: string, currentMode?: number, supportedModes?: EnergyEvseMode.ModeOption[], state?: EnergyEvse.State, supplyState?: EnergyEvse.SupplyState, faultState?: EnergyEvse.FaultState, absMinPower?: number, absMaxPower?: number);
|
|
45
|
-
/**
|
|
46
|
-
* Creates a default EnergyEvseServer Cluster Server.
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
createDefaultEnergyEvseClusterServer(state?: EnergyEvse.State, supplyState?: EnergyEvse.SupplyState, faultState?: EnergyEvse.FaultState): this;
|
|
50
|
-
/**
|
|
51
|
-
* Creates a default EnergyEvseMode Cluster Server.
|
|
52
|
-
*
|
|
53
|
-
* @param {number} [currentMode] - The current mode of the EnergyEvseMode cluster. Defaults to mode 1 (EnergyEvseMode.ModeTag.Manual).
|
|
54
|
-
* @param {EnergyEvseMode.ModeOption[]} [supportedModes] - The supported modes for the EnergyEvseMode cluster. Defaults all EnergyEvseMode cluster modes.
|
|
55
|
-
*
|
|
56
|
-
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
57
|
-
*/
|
|
58
|
-
createDefaultEnergyEvseModeClusterServer(currentMode?: number, supportedModes?: EnergyEvseMode.ModeOption[]): this;
|
|
59
|
-
}
|
|
60
|
-
export declare class MatterbridgeEnergyEvseServer extends EnergyEvseServer {
|
|
61
|
-
disable(): MaybePromise;
|
|
62
|
-
enableCharging(request: EnergyEvse.EnableChargingRequest): MaybePromise;
|
|
63
|
-
}
|
|
64
|
-
export declare class MatterbridgeEnergyEvseModeServer extends EnergyEvseModeServer {
|
|
65
|
-
changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=evse.d.ts.map
|
package/dist/evse.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evse.d.ts","sourceRoot":"","sources":["../src/evse.ts"],"names":[],"mappings":"AA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"}
|
package/dist/frontend.d.ts
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
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.2
|
|
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
|
-
* Websocket message ID indicating a cpu update.
|
|
42
|
-
* @constant {number}
|
|
43
|
-
*/
|
|
44
|
-
export declare const WS_ID_CPU_UPDATE = 3;
|
|
45
|
-
/**
|
|
46
|
-
* Websocket message ID indicating a memory update.
|
|
47
|
-
* @constant {number}
|
|
48
|
-
*/
|
|
49
|
-
export declare const WS_ID_MEMORY_UPDATE = 4;
|
|
50
|
-
/**
|
|
51
|
-
* Websocket message ID indicating an uptime update.
|
|
52
|
-
* @constant {number}
|
|
53
|
-
*/
|
|
54
|
-
export declare const WS_ID_UPTIME_UPDATE = 5;
|
|
55
|
-
/**
|
|
56
|
-
* Websocket message ID indicating a snackbar message.
|
|
57
|
-
* @constant {number}
|
|
58
|
-
*/
|
|
59
|
-
export declare const WS_ID_SNACKBAR = 6;
|
|
60
|
-
/**
|
|
61
|
-
* Websocket message ID indicating matterbridge has un update available.
|
|
62
|
-
* @constant {number}
|
|
63
|
-
*/
|
|
64
|
-
export declare const WS_ID_UPDATE_NEEDED = 7;
|
|
65
|
-
/**
|
|
66
|
-
* Websocket message ID indicating a state update.
|
|
67
|
-
* @constant {number}
|
|
68
|
-
*/
|
|
69
|
-
export declare const WS_ID_STATEUPDATE = 8;
|
|
70
|
-
/**
|
|
71
|
-
* Websocket message ID indicating to close a permanent snackbar message.
|
|
72
|
-
* @constant {number}
|
|
73
|
-
*/
|
|
74
|
-
export declare const WS_ID_CLOSE_SNACKBAR = 9;
|
|
75
|
-
/**
|
|
76
|
-
* Websocket message ID indicating a shelly system update.
|
|
77
|
-
* check:
|
|
78
|
-
* curl -k http://127.0.0.1:8101/api/updates/sys/check
|
|
79
|
-
* perform:
|
|
80
|
-
* curl -k http://127.0.0.1:8101/api/updates/sys/perform
|
|
81
|
-
* @constant {number}
|
|
82
|
-
*/
|
|
83
|
-
export declare const WS_ID_SHELLY_SYS_UPDATE = 100;
|
|
84
|
-
/**
|
|
85
|
-
* Websocket message ID indicating a shelly main update.
|
|
86
|
-
* check:
|
|
87
|
-
* curl -k http://127.0.0.1:8101/api/updates/main/check
|
|
88
|
-
* perform:
|
|
89
|
-
* curl -k http://127.0.0.1:8101/api/updates/main/perform
|
|
90
|
-
* @constant {number}
|
|
91
|
-
*/
|
|
92
|
-
export declare const WS_ID_SHELLY_MAIN_UPDATE = 101;
|
|
93
|
-
export declare class Frontend {
|
|
94
|
-
private matterbridge;
|
|
95
|
-
private log;
|
|
96
|
-
private port;
|
|
97
|
-
private initializeError;
|
|
98
|
-
private expressApp;
|
|
99
|
-
private httpServer;
|
|
100
|
-
private httpsServer;
|
|
101
|
-
private webSocketServer;
|
|
102
|
-
constructor(matterbridge: Matterbridge);
|
|
103
|
-
set logLevel(logLevel: LogLevel);
|
|
104
|
-
start(port?: number): Promise<void>;
|
|
105
|
-
stop(): Promise<void>;
|
|
106
|
-
private formatMemoryUsage;
|
|
107
|
-
private formatOsUpTime;
|
|
108
|
-
/**
|
|
109
|
-
* Retrieves the api settings data.
|
|
110
|
-
*
|
|
111
|
-
* @returns {Promise<{ matterbridgeInformation: MatterbridgeInformation, systemInformation: SystemInformation }>} A promise that resolve in the api settings object.
|
|
112
|
-
*/
|
|
113
|
-
private getApiSettings;
|
|
114
|
-
/**
|
|
115
|
-
* Retrieves the reachable attribute.
|
|
116
|
-
* @param {MatterbridgeDevice} device - The MatterbridgeDevice object.
|
|
117
|
-
* @returns {boolean} The reachable attribute.
|
|
118
|
-
*/
|
|
119
|
-
private getReachability;
|
|
120
|
-
/**
|
|
121
|
-
* Retrieves the power source attribute.
|
|
122
|
-
* @param {MatterbridgeEndpoint} endpoint - The MatterbridgeDevice object.
|
|
123
|
-
* @returns {'ac' | 'dc' | 'ok' | 'warning' | 'critical' | undefined} The power source attribute.
|
|
124
|
-
*/
|
|
125
|
-
private getPowerSource;
|
|
126
|
-
/**
|
|
127
|
-
* Retrieves the cluster text description from a given device.
|
|
128
|
-
* @param {MatterbridgeDevice} device - The MatterbridgeDevice object.
|
|
129
|
-
* @returns {string} The attributes description of the cluster servers in the device.
|
|
130
|
-
*/
|
|
131
|
-
private getClusterTextFromDevice;
|
|
132
|
-
/**
|
|
133
|
-
* Retrieves the base registered plugins sanitized for res.json().
|
|
134
|
-
* @returns {BaseRegisteredPlugin[]} An array of BaseRegisteredPlugin.
|
|
135
|
-
*/
|
|
136
|
-
private getBaseRegisteredPlugins;
|
|
137
|
-
/**
|
|
138
|
-
* Retrieves the devices from Matterbridge.
|
|
139
|
-
* @param {string} [pluginName] - The name of the plugin to filter devices by.
|
|
140
|
-
* @returns {Promise<ApiDevices[]>} A promise that resolves to an array of ApiDevices.
|
|
141
|
-
*/
|
|
142
|
-
private getDevices;
|
|
143
|
-
/**
|
|
144
|
-
* Retrieves the clusters from a given plugin and endpoint number.
|
|
145
|
-
*
|
|
146
|
-
* Response for /api/clusters
|
|
147
|
-
*
|
|
148
|
-
* @param {string} pluginName - The name of the plugin.
|
|
149
|
-
* @param {number} endpointNumber - The endpoint number.
|
|
150
|
-
* @returns {Promise<ApiClustersResponse | undefined>} A promise that resolves to the clusters or undefined if not found.
|
|
151
|
-
*/
|
|
152
|
-
private getClusters;
|
|
153
|
-
/**
|
|
154
|
-
* Handles incoming websocket messages for the Matterbridge frontend.
|
|
155
|
-
*
|
|
156
|
-
* @param {WebSocket} client - The websocket client that sent the message.
|
|
157
|
-
* @param {WebSocket.RawData} message - The raw data of the message received from the client.
|
|
158
|
-
* @returns {Promise<void>} A promise that resolves when the message has been handled.
|
|
159
|
-
*/
|
|
160
|
-
private wsMessageHandler;
|
|
161
|
-
/**
|
|
162
|
-
* Sends a WebSocket log message to all connected clients. The function is called by AnsiLogger.setGlobalCallback.
|
|
163
|
-
*
|
|
164
|
-
* @param {string} level - The logger level of the message: debug info notice warn error fatal...
|
|
165
|
-
* @param {string} time - The time string of the message
|
|
166
|
-
* @param {string} name - The logger name of the message
|
|
167
|
-
* @param {string} message - The content of the message.
|
|
168
|
-
*
|
|
169
|
-
* @remark
|
|
170
|
-
* The function removes ANSI escape codes, leading asterisks, non-printable characters, and replaces all occurrences of \t and \n.
|
|
171
|
-
* It also replaces all occurrences of \" with " and angle-brackets with < and >.
|
|
172
|
-
* The function sends the message to all connected clients.
|
|
173
|
-
*/
|
|
174
|
-
wssSendMessage(level: string, time: string, name: string, message: string): void;
|
|
175
|
-
/**
|
|
176
|
-
* Sends a need to refresh WebSocket message to all connected clients.
|
|
177
|
-
*
|
|
178
|
-
* @param {string} changed - The changed value. If null, the whole page will be refreshed.
|
|
179
|
-
* possible values:
|
|
180
|
-
* - 'matterbridgeLatestVersion'
|
|
181
|
-
* - 'matterbridgeAdvertise'
|
|
182
|
-
* - 'online'
|
|
183
|
-
* - 'offline'
|
|
184
|
-
* - 'reachability'
|
|
185
|
-
* - 'settings'
|
|
186
|
-
* - 'plugins'
|
|
187
|
-
* - 'pluginsRestart'
|
|
188
|
-
* - 'devices'
|
|
189
|
-
* - 'fabrics'
|
|
190
|
-
* - 'sessions'
|
|
191
|
-
*/
|
|
192
|
-
wssSendRefreshRequired(changed?: string | null): void;
|
|
193
|
-
/**
|
|
194
|
-
* Sends a need to restart WebSocket message to all connected clients.
|
|
195
|
-
*
|
|
196
|
-
*/
|
|
197
|
-
wssSendRestartRequired(snackbar?: boolean): void;
|
|
198
|
-
/**
|
|
199
|
-
* Sends a need to update WebSocket message to all connected clients.
|
|
200
|
-
*
|
|
201
|
-
*/
|
|
202
|
-
wssSendUpdateRequired(): void;
|
|
203
|
-
/**
|
|
204
|
-
* Sends a cpu update message to all connected clients.
|
|
205
|
-
*
|
|
206
|
-
*/
|
|
207
|
-
wssSendCpuUpdate(cpuUsage: number): void;
|
|
208
|
-
/**
|
|
209
|
-
* Sends a memory update message to all connected clients.
|
|
210
|
-
*
|
|
211
|
-
*/
|
|
212
|
-
wssSendMemoryUpdate(totalMemory: string, freeMemory: string, rss: string, heapTotal: string, heapUsed: string, external: string, arrayBuffers: string): void;
|
|
213
|
-
/**
|
|
214
|
-
* Sends an uptime update message to all connected clients.
|
|
215
|
-
*
|
|
216
|
-
*/
|
|
217
|
-
wssSendUptimeUpdate(systemUptime: string, processUptime: string): void;
|
|
218
|
-
/**
|
|
219
|
-
* Sends an open snackbar message to all connected clients.
|
|
220
|
-
* @param {string} message - The message to send.
|
|
221
|
-
* @param {number} timeout - The timeout in seconds for the snackbar message.
|
|
222
|
-
* @param {'info' | 'warning' | 'error' | 'success'} severity - The severity of the snackbar message (default info).
|
|
223
|
-
*
|
|
224
|
-
*/
|
|
225
|
-
wssSendSnackbarMessage(message: string, timeout?: number, severity?: 'info' | 'warning' | 'error' | 'success'): void;
|
|
226
|
-
/**
|
|
227
|
-
* Sends a close snackbar message to all connected clients.
|
|
228
|
-
* @param {string} message - The message to send.
|
|
229
|
-
*
|
|
230
|
-
*/
|
|
231
|
-
wssSendCloseSnackbarMessage(message: string): void;
|
|
232
|
-
/**
|
|
233
|
-
* Sends an attribute update message to all connected WebSocket clients.
|
|
234
|
-
*
|
|
235
|
-
* @param {string | undefined} plugin - The name of the plugin.
|
|
236
|
-
* @param {string | undefined} serialNumber - The serial number of the device.
|
|
237
|
-
* @param {string | undefined} uniqueId - The unique identifier of the device.
|
|
238
|
-
* @param {string} cluster - The cluster name where the attribute belongs.
|
|
239
|
-
* @param {string} attribute - The name of the attribute that changed.
|
|
240
|
-
* @param {number | string | boolean} value - The new value of the attribute.
|
|
241
|
-
*
|
|
242
|
-
* @remarks
|
|
243
|
-
* This method logs a debug message and sends a JSON-formatted message to all connected WebSocket clients
|
|
244
|
-
* with the updated attribute information.
|
|
245
|
-
*/
|
|
246
|
-
wssSendAttributeChangedMessage(plugin: string | undefined, serialNumber: string | undefined, uniqueId: string | undefined, cluster: string, attribute: string, value: number | string | boolean): void;
|
|
247
|
-
/**
|
|
248
|
-
* Sends a message to all connected clients.
|
|
249
|
-
* @param {number} id - The message id.
|
|
250
|
-
* @param {string} method - The message method.
|
|
251
|
-
* @param {Record<string, string | number | boolean>} params - The message parameters.
|
|
252
|
-
*
|
|
253
|
-
*/
|
|
254
|
-
wssBroadcastMessage(id: number, method?: string, params?: Record<string, string | number | boolean>): void;
|
|
255
|
-
}
|
|
256
|
-
//# sourceMappingURL=frontend.d.ts.map
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