Skip to content

Commit bffa15b

Browse files
authored
Release 3.1.8
## [3.1.8] - 2025-07-28 ### Added - [Jest]: Total coverage 100%. - [certification]: Improved certification management in pairing.json. Added pemToBuffer function for converting PEM strings to Uint8Array. - [certification]: Improved certification management in pairing.json. Added extractPrivateKeyRaw function for extrating the raw part of PEM private key to Uint8Array. - [workflow]: Update permissions and change GitHub token for Docker build triggers. - [update]: Added support for retrieving and logging plugin development versions. - [frontend]: Improved test units on Frontend class (total coverage 100%). - [frontend]: Bump version 2.7.1. - [frontend]: Added Changelog button that appears in the frontend when a new version is installed and the frontend needs to be updated (page refresh). - [frontend]: Added restart plugin in childbridge mode. - [frontend]: Added update to stable and update to dev banner. The update to new appears only if you are on the dev and there is a new dev version. - [frontend]: Added update to stable and update to dev banner for plugins. The update to new dev appears only if you are on the dev and there is a new dev version. - [frontend]: Added new menu item for manual update check. ### Changed - [package]: Updated dependencies. ### Fixed - [switch]: Added conditional handling for momentary switch events in MatterbridgeEndpoint for single press only switches. - [advertise]: Changed the message advertise stopped to work also in childbridge mode. <a href="https://www.buymeacoffee.com/luligugithub"> <img src="bmc-button.svg" alt="Buy me a coffee" width="80"> </a>
1 parent 15f02a2 commit bffa15b

28 files changed

+1118
-841
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ screenshot/
1414
src/
1515
temp/
1616
test/
17+
vitest/
1718

1819
# Specific files that should be ignored
1920
.gitattributes

.vscode/tasks.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,25 @@
238238
},
239239
"problemMatcher": []
240240
},
241+
{
242+
"label": "Test: Utils",
243+
"type": "shell",
244+
"command": "node",
245+
"args": [
246+
"--no-warnings",
247+
"--experimental-vm-modules",
248+
"node_modules/jest/bin/jest.js",
249+
"--verbose",
250+
"--coverage",
251+
"--maxWorkers=100%",
252+
"update.test.ts"
253+
],
254+
"group": {
255+
"kind": "test",
256+
"isDefault": false
257+
},
258+
"problemMatcher": []
259+
},
241260
{
242261
"type": "npm",
243262
"script": "lint",

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,36 @@ If you like this project and find it useful, please consider giving it a star on
88
<img src="bmc-button.svg" alt="Buy me a coffee" width="120">
99
</a>
1010

11+
## [3.1.8] - 2025-07-28
12+
13+
### Added
14+
15+
- [Jest]: Total coverage 100%.
16+
- [certification]: Improved certification management in pairing.json. Added pemToBuffer function for converting PEM strings to Uint8Array.
17+
- [certification]: Improved certification management in pairing.json. Added extractPrivateKeyRaw function for extrating the raw part of PEM private key to Uint8Array.
18+
- [workflow]: Update permissions and change GitHub token for Docker build triggers.
19+
- [update]: Added support for retrieving and logging plugin development versions.
20+
- [frontend]: Improved test units on Frontend class (total coverage 100%).
21+
- [frontend]: Bump version 2.7.1.
22+
- [frontend]: Added Changelog button that appears in the frontend when a new version is installed and the frontend needs to be updated (page refresh).
23+
- [frontend]: Added restart plugin in childbridge mode.
24+
- [frontend]: Added update to stable and update to dev banner. The update to new appears only if you are on the dev and there is a new dev version.
25+
- [frontend]: Added update to stable and update to dev banner for plugins. The update to new dev appears only if you are on the dev and there is a new dev version.
26+
- [frontend]: Added new menu item for manual update check.
27+
28+
### Changed
29+
30+
- [package]: Updated dependencies.
31+
32+
### Fixed
33+
34+
- [switch]: Added conditional handling for momentary switch events in MatterbridgeEndpoint for single press only switches.
35+
- [advertise]: Changed the message advertise stopped to work also in childbridge mode.
36+
37+
<a href="https://www.buymeacoffee.com/luligugithub">
38+
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">
39+
</a>
40+
1141
## [3.1.7] - 2025-07-25
1242

1343
### Added

frontend/build/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"files": {
33
"main.css": "./static/css/main.944b63c3.css",
4-
"main.js": "./static/js/main.1d25e0d8.js",
4+
"main.js": "./static/js/main.6ab99f2a.js",
55
"static/js/453.d855a71b.chunk.js": "./static/js/453.d855a71b.chunk.js",
66
"static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.c4d6cab43bec89049809.woff2",
77
"static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.599f66a60bdf974e578e.woff2",
@@ -77,11 +77,11 @@
7777
"static/media/roboto-greek-ext-300-normal.woff": "./static/media/roboto-greek-ext-300-normal.60729cafbded24073dfb.woff",
7878
"index.html": "./index.html",
7979
"main.944b63c3.css.map": "./static/css/main.944b63c3.css.map",
80-
"main.1d25e0d8.js.map": "./static/js/main.1d25e0d8.js.map",
80+
"main.6ab99f2a.js.map": "./static/js/main.6ab99f2a.js.map",
8181
"453.d855a71b.chunk.js.map": "./static/js/453.d855a71b.chunk.js.map"
8282
},
8383
"entrypoints": [
8484
"static/css/main.944b63c3.css",
85-
"static/js/main.1d25e0d8.js"
85+
"static/js/main.6ab99f2a.js"
8686
]
8787
}

frontend/build/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.1d25e0d8.js"></script><link href="./static/css/main.944b63c3.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.6ab99f2a.js"></script><link href="./static/css/main.944b63c3.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

frontend/build/static/js/main.1d25e0d8.js renamed to frontend/build/static/js/main.6ab99f2a.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/build/static/js/main.1d25e0d8.js.map renamed to frontend/build/static/js/main.6ab99f2a.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frontend",
3-
"version": "2.7.0",
3+
"version": "2.7.1",
44
"private": true,
55
"homepage": "./",
66
"scripts": {

frontend/src/components/Header.js

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function Header() {
3232
const { online, sendMessage, logMessage, addListener, removeListener, getUniqueId } = useContext(WebSocketContext);
3333
// States
3434
const [restart, setRestart] = useState(false);
35+
const [fixedRestart, setFixedRestart] = useState(false);
3536
const [update, setUpdate] = useState(false);
37+
const [updateDev, setUpdateDev] = useState(false);
3638
const [settings, setSettings] = useState(null);
3739
// Refs
3840
const uniqueId = useRef(getUniqueId());
@@ -52,7 +54,11 @@ function Header() {
5254
};
5355

5456
const handleChangelogClick = () => {
55-
window.open(`https://github.com/Luligu/matterbridge/blob/main/CHANGELOG.md`, '_blank');
57+
if(settings.matterbridgeInformation.matterbridgeVersion.includes('-dev-')) {
58+
window.open(`https://github.com/Luligu/matterbridge/blob/dev/CHANGELOG.md`, '_blank');
59+
} else {
60+
window.open(`https://github.com/Luligu/matterbridge/blob/main/CHANGELOG.md`, '_blank');
61+
}
5662
};
5763

5864
const handleDiscordLogoClick = () => {
@@ -67,6 +73,10 @@ function Header() {
6773
sendMessage({ id: uniqueId.current, sender: 'Header', method: "/api/install", src: "Frontend", dst: "Matterbridge", params: { packageName: 'matterbridge@dev', restart: true } });
6874
};
6975

76+
const handleUpdateCheckClick = () => {
77+
sendMessage({ id: uniqueId.current, sender: 'Header', method: "/api/checkupdates", src: "Frontend", dst: "Matterbridge", params: { } });
78+
};
79+
7080
const handleShellySystemUpdateClick = () => {
7181
if(debug) console.log('Header: handleShellySystemUpdateClick');
7282
logMessage('Matterbridge', `Installing system updates...`);
@@ -89,7 +99,7 @@ function Header() {
8999
logMessage('Matterbridge', `Downloading Shelly system log...`);
90100
showSnackbarMessage('Downloading Shelly system log...', 5);
91101
window.location.href = './api/shellydownloadsystemlog';
92-
};
102+
};
93103

94104
const handleRestartClick = () => {
95105
if (settings.matterbridgeInformation.restartMode === '') {
@@ -175,6 +185,8 @@ function Header() {
175185
handleUpdateClick();
176186
} else if (value === 'updatedev') {
177187
handleUpdateDevClick();
188+
} else if (value === 'updatecheck') {
189+
handleUpdateCheckClick();
178190
} else if (value === 'shelly-sys-update') {
179191
handleShellySystemUpdateClick();
180192
} else if (value === 'shelly-main-update') {
@@ -259,7 +271,8 @@ function Header() {
259271
if (msg.id === uniqueId.current && msg.method === '/api/settings') {
260272
if (debug) console.log('Header received settings:', msg.response);
261273
setSettings(msg.response);
262-
setRestart(msg.response.matterbridgeInformation.restartRequired);
274+
setRestart(msg.response.matterbridgeInformation.restartRequired || msg.response.matterbridgeInformation.fixedRestartRequired);
275+
setFixedRestart(msg.response.matterbridgeInformation.fixedRestartRequired);
263276
setUpdate(msg.response.matterbridgeInformation.updateRequired);
264277
}
265278
// Broadcast messages
@@ -270,13 +283,22 @@ function Header() {
270283
}
271284
}
272285
if (msg.method === 'restart_required') {
273-
if (debug) console.log('Header received restart_required');
286+
if (debug) console.log(`Header received restart_required with fixed: ${msg.params.fixed}`);
274287
setRestart(true);
288+
if(msg.params.fixed === true) setFixedRestart(true);
289+
}
290+
if (msg.method === 'restart_not_required') {
291+
if (debug) console.log(`Header received restart_not_required`);
292+
setRestart(false);
275293
}
276294
if (msg.method === 'update_required') {
277295
if (debug) console.log('Header received update_required');
278296
setUpdate(true);
279297
}
298+
if (msg.method === 'update_required_dev') {
299+
if (debug) console.log('Header received update_required_dev');
300+
setUpdateDev(true);
301+
}
280302
if (msg.id === WS_ID_SHELLY_SYS_UPDATE) {
281303
if (debug) console.log('Header received WS_ID_SHELLY_SYS_UPDATE:');
282304
setSettings(prevSettings => ({ ...prevSettings, matterbridgeInformation: { ...prevSettings.matterbridgeInformation, shellySysUpdate: msg.params.available } }));
@@ -327,17 +349,24 @@ function Header() {
327349
<span className="status-sponsor" onClick={handleSponsorClick}>Sponsor</span>
328350
</Tooltip>
329351
}
330-
{!settings.matterbridgeInformation.readOnly && !update &&
331-
<Tooltip title="Matterbridge version">
332-
<span className="status-information" onClick={handleChangelogClick}>
333-
v.{settings.matterbridgeInformation.matterbridgeVersion}
334-
</span>
335-
</Tooltip>
336-
}
337352
{!settings.matterbridgeInformation.readOnly && update &&
338353
<Tooltip title="New Matterbridge version available, click to install">
339354
<span className="status-warning" onClick={handleUpdateClick}>
340-
Update v.{settings.matterbridgeInformation.matterbridgeVersion} to v.{settings.matterbridgeInformation.matterbridgeLatestVersion}
355+
Update to v.{settings.matterbridgeInformation.matterbridgeLatestVersion}
356+
</span>
357+
</Tooltip>
358+
}
359+
{!settings.matterbridgeInformation.readOnly && updateDev &&
360+
<Tooltip title="New Matterbridge dev version available, click to install">
361+
<span className="status-warning" onClick={handleUpdateDevClick}>
362+
Update to new dev v.{settings.matterbridgeInformation.matterbridgeDevVersion.split('-dev-')[0]}
363+
</span>
364+
</Tooltip>
365+
}
366+
{!settings.matterbridgeInformation.readOnly &&
367+
<Tooltip title="Matterbridge version, click to see the changelog">
368+
<span className="status-information" onClick={handleChangelogClick}>
369+
v.{settings.matterbridgeInformation.matterbridgeVersion}
341370
</span>
342371
</Tooltip>
343372
}
@@ -384,7 +413,7 @@ function Header() {
384413
</IconButton>
385414
</Tooltip>
386415
{settings.matterbridgeInformation && !settings.matterbridgeInformation.readOnly &&
387-
<Tooltip title="Update matterbridge">
416+
<Tooltip title="Update matterbridge to latest version">
388417
<IconButton style={{ color: update ? 'var(--primary-color)' : 'var(--main-icon-color)' }} onClick={handleUpdateClick}>
389418
<SystemUpdateAltIcon />
390419
</IconButton>
@@ -405,13 +434,13 @@ function Header() {
405434
</Tooltip>
406435
}
407436
<Tooltip title="Restart matterbridge">
408-
<IconButton style={{ color: restart ? 'var(--primary-color)' : 'var(--main-icon-color)' }} onClick={handleRestartClick}>
437+
<IconButton style={{ color: restart || fixedRestart ? 'var(--primary-color)' : 'var(--main-icon-color)' }} onClick={handleRestartClick}>
409438
<RestartAltIcon />
410439
</IconButton>
411440
</Tooltip>
412441
{settings.matterbridgeInformation.restartMode === '' ? (
413442
<Tooltip title="Shut down matterbridge">
414-
<IconButton style={{ color: restart ? 'var(--primary-color)' : 'var(--main-icon-color)' }} onClick={handleShutdownClick}>
443+
<IconButton style={{ color: restart || fixedRestart ? 'var(--primary-color)' : 'var(--main-icon-color)' }} onClick={handleShutdownClick}>
415444
<PowerSettingsNewIcon />
416445
</IconButton>
417446
</Tooltip>
@@ -425,7 +454,7 @@ function Header() {
425454
{settings.matterbridgeInformation && !settings.matterbridgeInformation.readOnly &&
426455
<MenuItem onClick={() => handleMenuCloseConfirm('update')}>
427456
<ListItemIcon><SystemUpdateAltIcon style={{ color: 'var(--main-icon-color)' }} /></ListItemIcon>
428-
<ListItemText primary="Install latest" primaryTypographyProps={{ style: { fontWeight: 'normal', color: 'var(--main-icon-color)' } }}/>
457+
<ListItemText primary="Install latest stable" primaryTypographyProps={{ style: { fontWeight: 'normal', color: 'var(--main-icon-color)' } }}/>
429458
</MenuItem>
430459
}
431460
{settings.matterbridgeInformation && !settings.matterbridgeInformation.readOnly &&
@@ -434,6 +463,12 @@ function Header() {
434463
<ListItemText primary="Install latest dev" primaryTypographyProps={{ style: { fontWeight: 'normal', color: 'var(--main-icon-color)' } }}/>
435464
</MenuItem>
436465
}
466+
{settings.matterbridgeInformation && !settings.matterbridgeInformation.readOnly &&
467+
<MenuItem onClick={() => handleMenuCloseConfirm('updatecheck')}>
468+
<ListItemIcon><SystemUpdateAltIcon style={{ color: 'var(--main-icon-color)' }} /></ListItemIcon>
469+
<ListItemText primary="Check for updates" primaryTypographyProps={{ style: { fontWeight: 'normal', color: 'var(--main-icon-color)' } }}/>
470+
</MenuItem>
471+
}
437472
{settings.matterbridgeInformation && settings.matterbridgeInformation.shellyBoard && settings.matterbridgeInformation.shellySysUpdate &&
438473
<MenuItem onClick={() => handleMenuCloseConfirm('shelly-sys-update')}>
439474
<ListItemIcon><SystemUpdateAltIcon style={{ color: 'var(--main-icon-color)' }} /></ListItemIcon>

0 commit comments

Comments
 (0)