Skip to content

Commit 925c41f

Browse files
authored
Merge pull request #265 from Luligu/dev
Dev
2 parents b6eb4c6 + d972034 commit 925c41f

14 files changed

+143
-95
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,23 @@ Features:
2929
- It is possible to choose the method: GET or POST.
3030
- The webhook can be tested directly in the frontend.
3131

32-
## [2.2.8] - 2025-04-08
32+
## [2.2.8] - 2025-04-10
3333

3434
### Added
3535

3636
- [platform]: Added stack to errors messages.
3737
- [endpoint]: Added createLevelTvocMeasurementClusterServer()
38+
- [frontend]: Added a restart button on the QRCode panel when the advertising for a not paired node is expired.
3839

3940
### Changed
4041

4142
- [package]: Update dependencies.
43+
- [package]: Use node:https.
44+
45+
### Fixed
46+
47+
- [homepage]: Fixed warning log for homepage property in package.json.
48+
- [DevicesIcon]: Fixed rendering of rain, freeze and leak sensors.
4249

4350
<a href="https://www.buymeacoffee.com/luligugithub">
4451
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">

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.ea7910e9.css",
4-
"main.js": "./static/js/main.1fa50342.js",
4+
"main.js": "./static/js/main.e11d6bb4.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.ea7910e9.css.map": "./static/css/main.ea7910e9.css.map",
80-
"main.1fa50342.js.map": "./static/js/main.1fa50342.js.map",
80+
"main.e11d6bb4.js.map": "./static/js/main.e11d6bb4.js.map",
8181
"453.d855a71b.chunk.js.map": "./static/js/453.d855a71b.chunk.js.map"
8282
},
8383
"entrypoints": [
8484
"static/css/main.ea7910e9.css",
85-
"static/js/main.1fa50342.js"
85+
"static/js/main.e11d6bb4.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.1fa50342.js"></script><link href="./static/css/main.ea7910e9.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.e11d6bb4.js"></script><link href="./static/css/main.ea7910e9.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.1fa50342.js renamed to frontend/build/static/js/main.e11d6bb4.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.1fa50342.js.map renamed to frontend/build/static/js/main.e11d6bb4.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/src/components/DevicesIcons.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ function Device({ device, endpoint, id, deviceType, clusters }) {
176176
))}
177177
{/* Water leak detector */}
178178
{deviceType===0x0043 && clusters.filter(cluster => cluster.clusterName === 'BooleanState' && cluster.attributeName === 'stateValue').map(cluster => (
179-
<Render icon={<WaterIcon/>} cluster={cluster} value={cluster.attributeLocalValue===true ?'No leak':'Leak'}/>
179+
<Render icon={<WaterIcon/>} cluster={cluster} value={cluster.attributeLocalValue===true ?'Leak':'No leak'}/>
180180
))}
181181
{/* Water freeze detector */}
182182
{deviceType===0x0041 && clusters.filter(cluster => cluster.clusterName === 'BooleanState' && cluster.attributeName === 'stateValue').map(cluster => (
183-
<Render icon={<AcUnitIcon/>} cluster={cluster} value={cluster.attributeLocalValue===true ?'No freeze':'Freeze'}/>
183+
<Render icon={<AcUnitIcon/>} cluster={cluster} value={cluster.attributeLocalValue===true ?'Freeze':'No freeze'}/>
184184
))}
185185
{/* Rain sensor */}
186186
{deviceType===0x0044 && clusters.filter(cluster => cluster.clusterName === 'BooleanState' && cluster.attributeName === 'stateValue').map(cluster => (
187-
<Render icon={<ThunderstormIcon/>} cluster={cluster} value={cluster.attributeLocalValue===true ?'No rain':'Rain'}/>
187+
<Render icon={<ThunderstormIcon/>} cluster={cluster} value={cluster.attributeLocalValue===true ?'Rain':'No rain'}/>
188188
))}
189189
{/* SmokeCoAlarm */}
190190
{deviceType===0x0076 && clusters.filter(cluster => cluster.clusterName === 'SmokeCoAlarm' && cluster.attributeName === 'smokeState').map(cluster => (

frontend/src/components/QRDiv.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
/* eslint-disable no-console */
2+
3+
// React
4+
import React, { useContext } from 'react';
5+
26
// Frontend
37
import { debug } from '../App';
8+
import { WebSocketContext } from './WebSocketProvider';
49

510
// QRCode
611
import { QRCodeSVG } from 'qrcode.react';
712

13+
// @mui
14+
import Button from '@mui/material/Button';
15+
import RestartAltIcon from '@mui/icons-material/RestartAlt';
16+
817
export function QRDiv({ matterbridgeInfo, plugin }) {
18+
const { sendMessage } = useContext(WebSocketContext);
19+
20+
const handleRestartClick = () => {
21+
if (matterbridgeInfo.restartMode === '') {
22+
sendMessage({ method: "/api/restart", src: "Frontend", dst: "Matterbridge", params: {} });
23+
}
24+
else {
25+
sendMessage({ method: "/api/shutdown", src: "Frontend", dst: "Matterbridge", params: {} });
26+
}
27+
};
28+
929
if(debug) console.log('QRDiv:', matterbridgeInfo, plugin);
1030
if (matterbridgeInfo.bridgeMode === 'bridge' && matterbridgeInfo.matterbridgePaired === true && matterbridgeInfo.matterbridgeAdvertise === false && matterbridgeInfo.matterbridgeFabricInformations) {
1131
if (debug) console.log(`QRDiv: paired ${matterbridgeInfo.matterbridgePaired}, got ${matterbridgeInfo.matterbridgeFabricInformations?.length} fabrics, got ${matterbridgeInfo.matterbridgeSessionInformations?.length} sessions`);
@@ -21,7 +41,7 @@ export function QRDiv({ matterbridgeInfo, plugin }) {
2141
<p style={{ margin: '0px 20px 0px 20px', color: 'var(--div-text-color)' }}>Vendor: {fabric.rootVendorId} {fabric.rootVendorName}</p>
2242
{fabric.label !== '' && <p style={{ margin: '0px 20px 0px 20px', color: 'var(--div-text-color)' }}>Label: {fabric.label}</p>}
2343
<p style={{ margin: '0px 20px 0px 20px', color: 'var(--div-text-color)' }}>
24-
Active sessions: {matterbridgeInfo.matterbridgeSessionInformations ?
44+
Sessions: {matterbridgeInfo.matterbridgeSessionInformations ?
2545
matterbridgeInfo.matterbridgeSessionInformations.filter(session => session.fabric.fabricIndex === fabric.fabricIndex && session.isPeerActive === true).length :
2646
'0'}
2747
{' '}
@@ -48,7 +68,7 @@ export function QRDiv({ matterbridgeInfo, plugin }) {
4868
<p style={{ margin: '0px 20px 0px 20px', color: 'var(--div-text-color)' }}>Vendor: {fabric.rootVendorId} {fabric.rootVendorName}</p>
4969
{fabric.label !== '' && <p style={{ margin: '0px 20px 0px 20px', color: 'var(--div-text-color)' }}>Label: {fabric.label}</p>}
5070
<p style={{ margin: '0px 20px 0px 20px', color: 'var(--div-text-color)' }}>
51-
Active sessions: {plugin.sessionInformations ?
71+
Sessions: {plugin.sessionInformations ?
5272
plugin.sessionInformations.filter(session => session.fabric.fabricIndex === fabric.fabricIndex && session.isPeerActive === true).length :
5373
'0'}
5474
{' '}
@@ -94,7 +114,8 @@ export function QRDiv({ matterbridgeInfo, plugin }) {
94114
<div className="MbfWindowHeader">
95115
<p className="MbfWindowHeaderText" style={{ textAlign: 'left' }}>QR pairing code</p>
96116
</div>
97-
<div className="MbfWindowFooter" style={{ padding: 0, marginTop: '-5px', height: '30px' }}>
117+
<Button onClick={handleRestartClick} endIcon={<RestartAltIcon />} style={{ margin: '20px', color: 'var(--main-button-color)', backgroundColor: 'var(--main-button-bg-color)', height: '30px', minWidth: '90px' }}> Restart</Button>
118+
<div className="MbfWindowFooter" style={{ padding: 0, margin: 0, height: '30px' }}>
98119
<p className="MbfWindowFooterText" style={{ fontSize: '14px', fontWeight: 'normal', color: 'var(--div-text-color)' }}>Restart to generate a new QRCode.</p>
99120
</div>
100121
</div>
@@ -106,7 +127,8 @@ export function QRDiv({ matterbridgeInfo, plugin }) {
106127
<div className="MbfWindowHeader">
107128
<p className="MbfWindowHeaderText" style={{ textAlign: 'left' }}>QR pairing code</p>
108129
</div>
109-
<div className="MbfWindowFooter" style={{ padding: 0, marginTop: '-5px', height: '30px' }}>
130+
<Button onClick={handleRestartClick} endIcon={<RestartAltIcon />} style={{ margin: '20px', color: 'var(--main-button-color)', backgroundColor: 'var(--main-button-bg-color)', height: '30px', minWidth: '90px' }}> Restart</Button>
131+
<div className="MbfWindowFooter" style={{ padding: 0, margin: 0, height: '30px' }}>
110132
<p className="MbfWindowFooterText" style={{ fontSize: '14px', fontWeight: 'normal', color: 'var(--div-text-color)' }}>Restart to generate a new QRCode.</p>
111133
</div>
112134
</div>

0 commit comments

Comments
 (0)