matterbridge 3.2.9-dev-20250922-517cae7 → 3.2.9-dev-20250924-9417698
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 +5 -3
- package/dist/frontend.js +14 -15
- package/dist/frontendTypes.js +5 -21
- package/dist/shelly.js +4 -4
- package/frontend/build/assets/index.js +1 -23
- package/frontend/package.json +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,13 +12,15 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
12
12
|
|
|
13
13
|
### Breaking Changes
|
|
14
14
|
|
|
15
|
-
- [profiles]: Profile management has changed. Now, each profile has its own independent directories under `profiles` with storage, matterstorage, plugin config, and plugin directory. This means that if you are using profiles, Matterbridge will not find the old profile data.
|
|
15
|
+
- [profiles]: Profile management has changed. Now, each profile has its own independent directories under `profiles` with storage, matterstorage, plugin config, and plugin directory. This means that if you are using profiles, Matterbridge will not find the old profile data. The new profile management allows to run multiple instances of matterbridge (change the frontend port and the matter port for each profile) or to simply make a test of a new plugin without modifing your production setup.
|
|
16
16
|
|
|
17
17
|
### Added
|
|
18
18
|
|
|
19
|
-
- [frontend]: Bumped `frontend` version to 3.1.0.
|
|
19
|
+
- [frontend]: Bumped `frontend` version to 3.1.0. Now, 100% on typescript and fully typed with the backend.
|
|
20
20
|
- [frontend]: Removed legacy `react-table` and created an autonomous component `MbfTable`. Features: unique UI for all tables with integrated column sorting and column selection.
|
|
21
21
|
- [frontend]: Use MbfTable for Plugins, Devices, Registered devices and Clusters tables.
|
|
22
|
+
- [frontend]: Optimized WebSocker message handlers. Now, the handler targets the component.
|
|
23
|
+
- [frontend]: Removed dangerouslySetInnerHTML from log rendering.
|
|
22
24
|
|
|
23
25
|
### Changed
|
|
24
26
|
|
|
@@ -27,7 +29,7 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
27
29
|
|
|
28
30
|
### Fixed
|
|
29
31
|
|
|
30
|
-
- [frontend]: Fix default values for homePageMode in MatterbridgeSettings
|
|
32
|
+
- [frontend]: Fix default values (devices) for homePageMode (logs/devices) in MatterbridgeSettings.
|
|
31
33
|
|
|
32
34
|
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
33
35
|
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">
|
package/dist/frontend.js
CHANGED
|
@@ -938,7 +938,7 @@ export class Frontend extends EventEmitter {
|
|
|
938
938
|
}
|
|
939
939
|
this.log.debug(`Received message from websocket client: ${debugStringify(data)}`);
|
|
940
940
|
if (data.method === 'ping') {
|
|
941
|
-
sendResponse({ id: data.id, method:
|
|
941
|
+
sendResponse({ id: data.id, method: 'pong', src: 'Matterbridge', dst: data.src, success: true, response: 'pong' });
|
|
942
942
|
return;
|
|
943
943
|
}
|
|
944
944
|
else if (data.method === '/api/login') {
|
|
@@ -1281,7 +1281,7 @@ export class Frontend extends EventEmitter {
|
|
|
1281
1281
|
else
|
|
1282
1282
|
serverNode = this.matterbridge.getPlugins().find((p) => p.serverNode && p.serverNode.id === localData.params.id)?.serverNode || this.matterbridge.getDevices().find((d) => d.serverNode && d.serverNode.id === localData.params.id)?.serverNode;
|
|
1283
1283
|
if (!serverNode) {
|
|
1284
|
-
sendResponse({ id: data.id, method: data.method, src: 'Matterbridge', dst: data.src, error:
|
|
1284
|
+
sendResponse({ id: data.id, method: data.method, src: 'Matterbridge', dst: data.src, error: `Unknown server node id ${localData.params.id} in /api/matter` });
|
|
1285
1285
|
return;
|
|
1286
1286
|
}
|
|
1287
1287
|
const matter = this.matterbridge.getServerNodeData(serverNode);
|
|
@@ -1704,7 +1704,6 @@ export class Frontend extends EventEmitter {
|
|
|
1704
1704
|
message = message.replace(/[\t\n]/g, '');
|
|
1705
1705
|
message = message.replace(/[\x00-\x1F\x7F]/g, '');
|
|
1706
1706
|
message = message.replace(/\\"/g, '"');
|
|
1707
|
-
message = message.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
1708
1707
|
const maxContinuousLength = 100;
|
|
1709
1708
|
const keepStartLength = 20;
|
|
1710
1709
|
const keepEndLength = 20;
|
|
@@ -1717,11 +1716,11 @@ export class Frontend extends EventEmitter {
|
|
|
1717
1716
|
return word;
|
|
1718
1717
|
})
|
|
1719
1718
|
.join(' ');
|
|
1720
|
-
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'log',
|
|
1719
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'log', success: true, response: { level, time, name, message } });
|
|
1721
1720
|
}
|
|
1722
1721
|
wssSendRefreshRequired(changed, params) {
|
|
1723
1722
|
this.log.debug('Sending a refresh required message to all connected clients');
|
|
1724
|
-
this.wssBroadcastMessage({ id:
|
|
1723
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'refresh_required', success: true, response: { changed, ...params } });
|
|
1725
1724
|
}
|
|
1726
1725
|
wssSendRestartRequired(snackbar = true, fixed = false) {
|
|
1727
1726
|
this.log.debug('Sending a restart required message to all connected clients');
|
|
@@ -1729,50 +1728,50 @@ export class Frontend extends EventEmitter {
|
|
|
1729
1728
|
this.matterbridge.matterbridgeInformation.fixedRestartRequired = fixed;
|
|
1730
1729
|
if (snackbar === true)
|
|
1731
1730
|
this.wssSendSnackbarMessage(`Restart required`, 0);
|
|
1732
|
-
this.wssBroadcastMessage({ id:
|
|
1731
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'restart_required', success: true, response: { fixed } });
|
|
1733
1732
|
}
|
|
1734
1733
|
wssSendRestartNotRequired(snackbar = true) {
|
|
1735
1734
|
this.log.debug('Sending a restart not required message to all connected clients');
|
|
1736
1735
|
this.matterbridge.matterbridgeInformation.restartRequired = false;
|
|
1737
1736
|
if (snackbar === true)
|
|
1738
1737
|
this.wssSendCloseSnackbarMessage(`Restart required`);
|
|
1739
|
-
this.wssBroadcastMessage({ id:
|
|
1738
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'restart_not_required', success: true });
|
|
1740
1739
|
}
|
|
1741
1740
|
wssSendUpdateRequired(devVersion = false) {
|
|
1742
1741
|
this.log.debug('Sending an update required message to all connected clients');
|
|
1743
1742
|
this.matterbridge.matterbridgeInformation.updateRequired = true;
|
|
1744
|
-
this.wssBroadcastMessage({ id:
|
|
1743
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'update_required', success: true, response: { devVersion } });
|
|
1745
1744
|
}
|
|
1746
1745
|
wssSendCpuUpdate(cpuUsage) {
|
|
1747
1746
|
if (hasParameter('debug'))
|
|
1748
1747
|
this.log.debug('Sending a cpu update message to all connected clients');
|
|
1749
|
-
this.wssBroadcastMessage({ id:
|
|
1748
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'cpu_update', success: true, response: { cpuUsage: Math.round(cpuUsage * 100) / 100 } });
|
|
1750
1749
|
}
|
|
1751
1750
|
wssSendMemoryUpdate(totalMemory, freeMemory, rss, heapTotal, heapUsed, external, arrayBuffers) {
|
|
1752
1751
|
if (hasParameter('debug'))
|
|
1753
1752
|
this.log.debug('Sending a memory update message to all connected clients');
|
|
1754
|
-
this.wssBroadcastMessage({ id:
|
|
1753
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'memory_update', success: true, response: { totalMemory, freeMemory, rss, heapTotal, heapUsed, external, arrayBuffers } });
|
|
1755
1754
|
}
|
|
1756
1755
|
wssSendUptimeUpdate(systemUptime, processUptime) {
|
|
1757
1756
|
if (hasParameter('debug'))
|
|
1758
1757
|
this.log.debug('Sending a uptime update message to all connected clients');
|
|
1759
|
-
this.wssBroadcastMessage({ id:
|
|
1758
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'uptime_update', success: true, response: { systemUptime, processUptime } });
|
|
1760
1759
|
}
|
|
1761
1760
|
wssSendSnackbarMessage(message, timeout = 5, severity = 'info') {
|
|
1762
1761
|
this.log.debug('Sending a snackbar message to all connected clients');
|
|
1763
|
-
this.wssBroadcastMessage({ id:
|
|
1762
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'snackbar', success: true, response: { message, timeout, severity } });
|
|
1764
1763
|
}
|
|
1765
1764
|
wssSendCloseSnackbarMessage(message) {
|
|
1766
1765
|
this.log.debug('Sending a close snackbar message to all connected clients');
|
|
1767
|
-
this.wssBroadcastMessage({ id:
|
|
1766
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'close_snackbar', success: true, response: { message } });
|
|
1768
1767
|
}
|
|
1769
1768
|
wssSendAttributeChangedMessage(plugin, serialNumber, uniqueId, cluster, attribute, value) {
|
|
1770
1769
|
this.log.debug('Sending an attribute update message to all connected clients');
|
|
1771
|
-
this.wssBroadcastMessage({ id:
|
|
1770
|
+
this.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'state_update', success: true, response: { plugin, serialNumber, uniqueId, cluster, attribute, value } });
|
|
1772
1771
|
}
|
|
1773
1772
|
wssBroadcastMessage(msg) {
|
|
1774
1773
|
const stringifiedMsg = JSON.stringify(msg);
|
|
1775
|
-
if (msg.
|
|
1774
|
+
if (msg.method !== 'log')
|
|
1776
1775
|
this.log.debug(`Sending a broadcast message: ${debugStringify(msg)}`);
|
|
1777
1776
|
this.webSocketServer?.clients.forEach((client) => {
|
|
1778
1777
|
if (client.readyState === WebSocket.OPEN) {
|
package/dist/frontendTypes.js
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
export var WsBroadcastMessageId;
|
|
2
|
-
(function (WsBroadcastMessageId) {
|
|
3
|
-
WsBroadcastMessageId[WsBroadcastMessageId["Log"] = 0] = "Log";
|
|
4
|
-
WsBroadcastMessageId[WsBroadcastMessageId["RefreshRequired"] = 1] = "RefreshRequired";
|
|
5
|
-
WsBroadcastMessageId[WsBroadcastMessageId["RestartRequired"] = 2] = "RestartRequired";
|
|
6
|
-
WsBroadcastMessageId[WsBroadcastMessageId["RestartNotRequired"] = 3] = "RestartNotRequired";
|
|
7
|
-
WsBroadcastMessageId[WsBroadcastMessageId["CpuUpdate"] = 4] = "CpuUpdate";
|
|
8
|
-
WsBroadcastMessageId[WsBroadcastMessageId["MemoryUpdate"] = 5] = "MemoryUpdate";
|
|
9
|
-
WsBroadcastMessageId[WsBroadcastMessageId["UptimeUpdate"] = 6] = "UptimeUpdate";
|
|
10
|
-
WsBroadcastMessageId[WsBroadcastMessageId["Snackbar"] = 7] = "Snackbar";
|
|
11
|
-
WsBroadcastMessageId[WsBroadcastMessageId["UpdateRequired"] = 8] = "UpdateRequired";
|
|
12
|
-
WsBroadcastMessageId[WsBroadcastMessageId["StateUpdate"] = 9] = "StateUpdate";
|
|
13
|
-
WsBroadcastMessageId[WsBroadcastMessageId["CloseSnackbar"] = 10] = "CloseSnackbar";
|
|
14
|
-
WsBroadcastMessageId[WsBroadcastMessageId["ShellySysUpdate"] = 100] = "ShellySysUpdate";
|
|
15
|
-
WsBroadcastMessageId[WsBroadcastMessageId["ShellyMainUpdate"] = 101] = "ShellyMainUpdate";
|
|
16
|
-
})(WsBroadcastMessageId || (WsBroadcastMessageId = {}));
|
|
17
|
-
export function isBroadcast(msg) {
|
|
18
|
-
return msg.id >= 0 && msg.id <= 101;
|
|
19
|
-
}
|
|
20
1
|
export function isApiRequest(msg) {
|
|
21
|
-
return msg.id
|
|
2
|
+
return msg.id !== 0 && msg.src === 'Frontend' && msg.dst === 'Matterbridge';
|
|
22
3
|
}
|
|
23
4
|
export function isApiResponse(msg) {
|
|
24
|
-
return msg.id
|
|
5
|
+
return msg.id !== 0 && msg.src === 'Matterbridge' && msg.dst === 'Frontend';
|
|
6
|
+
}
|
|
7
|
+
export function isBroadcast(msg) {
|
|
8
|
+
return msg.id === 0 && msg.src === 'Matterbridge' && msg.dst === 'Frontend';
|
|
25
9
|
}
|
package/dist/shelly.js
CHANGED
|
@@ -13,7 +13,7 @@ export async function getShellySysUpdate(matterbridge) {
|
|
|
13
13
|
if (updates.length === 0)
|
|
14
14
|
return;
|
|
15
15
|
matterbridge.matterbridgeInformation.shellySysUpdate = true;
|
|
16
|
-
matterbridge.frontend.wssBroadcastMessage({ id:
|
|
16
|
+
matterbridge.frontend.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'shelly_sys_update', success: true, response: { available: true } });
|
|
17
17
|
for (const { name } of updates) {
|
|
18
18
|
if (!name)
|
|
19
19
|
continue;
|
|
@@ -31,7 +31,7 @@ export async function triggerShellySysUpdate(matterbridge) {
|
|
|
31
31
|
matterbridge.log.notice('Installing Shelly system update...');
|
|
32
32
|
matterbridge.matterbridgeInformation.shellySysUpdate = false;
|
|
33
33
|
matterbridge.frontend.wssSendSnackbarMessage('Installing Shelly system update...', 15);
|
|
34
|
-
matterbridge.frontend.wssBroadcastMessage({ id:
|
|
34
|
+
matterbridge.frontend.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'shelly_sys_update', success: true, response: { available: false } });
|
|
35
35
|
await verifyShellyUpdate(matterbridge, '/api/updates/sys/status', 'Shelly system update');
|
|
36
36
|
}
|
|
37
37
|
catch (err) {
|
|
@@ -44,7 +44,7 @@ export async function getShellyMainUpdate(matterbridge) {
|
|
|
44
44
|
if (updates.length === 0)
|
|
45
45
|
return;
|
|
46
46
|
matterbridge.matterbridgeInformation.shellyMainUpdate = true;
|
|
47
|
-
matterbridge.frontend.wssBroadcastMessage({ id:
|
|
47
|
+
matterbridge.frontend.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'shelly_main_update', success: true, response: { available: true } });
|
|
48
48
|
for (const { name } of updates) {
|
|
49
49
|
if (!name)
|
|
50
50
|
continue;
|
|
@@ -62,7 +62,7 @@ export async function triggerShellyMainUpdate(matterbridge) {
|
|
|
62
62
|
matterbridge.log.notice('Installing Shelly software update...');
|
|
63
63
|
matterbridge.matterbridgeInformation.shellyMainUpdate = false;
|
|
64
64
|
matterbridge.frontend.wssSendSnackbarMessage('Installing Shelly software update...', 15);
|
|
65
|
-
matterbridge.frontend.wssBroadcastMessage({ id:
|
|
65
|
+
matterbridge.frontend.wssBroadcastMessage({ id: 0, src: 'Matterbridge', dst: 'Frontend', method: 'shelly_main_update', success: true, response: { available: false } });
|
|
66
66
|
await verifyShellyUpdate(matterbridge, '/api/updates/main/status', 'Shelly software update');
|
|
67
67
|
}
|
|
68
68
|
catch (err) {
|