Skip to content

Commit

Permalink
Merge pull request #33 from Luligu/dev
Browse files Browse the repository at this point in the history
Release 1.2.18
  • Loading branch information
Luligu authored May 28, 2024
2 parents 1891f7f + 1493113 commit 2d995ba
Show file tree
Hide file tree
Showing 13 changed files with 159 additions and 92 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

All notable changes to this project will be documented in this file.

## [1.2.18] - 2024-05-28

### Changed
- [matterbridgeDevice]: bridgedNode and powerSource device types as conformance to Matter 1.3

### Fixed
- [matterbridge]: Fixed /api/settings error after resetting commissioning server
- [matterbridge]: Added error message and clean shutdown when WebSocketServer or ExpressServer ports are already in use

### Added
- [frontend]: Added a dropdown menu in Add Remove plugin to select the plugins

<a href="https://www.buymeacoffee.com/luligugithub">
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
</a>

## [1.2.17] - 2024-05-25

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "/static/css/main.57bd18a9.css",
"main.js": "/static/js/main.eab44937.js",
"main.js": "/static/js/main.5e82a930.js",
"static/js/453.d855a71b.chunk.js": "/static/js/453.d855a71b.chunk.js",
"index.html": "/index.html",
"main.57bd18a9.css.map": "/static/css/main.57bd18a9.css.map",
"main.eab44937.js.map": "/static/js/main.eab44937.js.map",
"main.5e82a930.js.map": "/static/js/main.5e82a930.js.map",
"453.d855a71b.chunk.js.map": "/static/js/453.d855a71b.chunk.js.map"
},
"entrypoints": [
"static/css/main.57bd18a9.css",
"static/js/main.eab44937.js"
"static/js/main.5e82a930.js"
]
}
2 changes: 1 addition & 1 deletion frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><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.eab44937.js"></script><link href="/static/css/main.57bd18a9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><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.5e82a930.js"></script><link href="/static/css/main.57bd18a9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/build/static/js/main.5e82a930.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/build/static/js/main.eab44937.js.map

This file was deleted.

60 changes: 33 additions & 27 deletions frontend/src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { sendCommandToMatterbridge, theme } from './Header';
import WebSocketComponent from './WebSocketComponent';

// @mui
import { Dialog, DialogTitle, DialogContent, TextField, Alert, Snackbar, Tooltip, IconButton, Button, createTheme, ThemeProvider } from '@mui/material';
import { DeleteForever, Download, Remove, Add, Unpublished, PublishedWithChanges, Settings, Favorite, Help, Announcement, QrCode2 } from '@mui/icons-material';
import { Dialog, DialogTitle, DialogContent, TextField, Alert, Snackbar, Tooltip, IconButton, Button, createTheme, ThemeProvider, Select, MenuItem, Menu } from '@mui/material';
import { DeleteForever, Download, Remove, Add, Unpublished, PublishedWithChanges, Settings, Favorite, Help, Announcement, QrCode2, MoreVert } from '@mui/icons-material';

// @rjsf
// import Form from '@rjsf/core';
Expand Down Expand Up @@ -312,6 +312,7 @@ function Home() {
function AddRemovePluginsDiv({ plugins }) {
const [pluginName, setPluginName] = useState('matterbridge-');
const [open, setSnack] = useState(false);
const [anchorEl, setAnchorEl] = React.useState(null);

const handleSnackOpen = () => {
console.log('handleSnackOpen');
Expand Down Expand Up @@ -348,6 +349,16 @@ function AddRemovePluginsDiv({ plugins }) {
sendCommandToMatterbridge('removeplugin', pluginName);
};

const handleClickVertical = (event) => {
setAnchorEl(event.currentTarget);
};

const handleCloseMenu = (value) => {
console.log('handleCloseMenu:', value);
if(value !== '') setPluginName(value);
setAnchorEl(null);
};

const theme = createTheme({
palette: {
primary: {
Expand All @@ -356,28 +367,6 @@ function AddRemovePluginsDiv({ plugins }) {
},
});

/*
const pluginList = [
{ value: 'matterbridge-zigbee2mqtt', label: 'matterbridge-zigbee2mqtt' },
{ value: 'matterbridge-somfy-tahoma', label: 'matterbridge-somfy-tahoma' },
{ value: 'matterbridge-shelly', label: 'matterbridge-shelly' },
{ value: 'matterbridge-example-accessory-platform', label: 'matterbridge-example-accessory-platform' },
{ value: 'matterbridge-example-dynamic-platform', label: 'matterbridge-example-dynamic-platform' },
{ value: 'matterbridge-eve-door', label: 'matterbridge-eve-door' },
{ value: 'matterbridge-eve-motion', label: 'matterbridge-eve-motion' },
{ value: 'matterbridge-eve-energy', label: 'matterbridge-eve-energy' },
{ value: 'matterbridge-eve-weather', label: 'matterbridge-eve-weather' },
{ value: 'matterbridge-eve-room', label: 'matterbridge-eve-room' },
];
sx={{ '.MuiSelect-select': { bgcolor: '#c4c2c2' } }} value={pluginName}
{pluginList.map((option) => (
<option key={option.value} value={option.value}>
{option.label}
</option>
))}
SelectProps={{ native: true, MenuProps: { PaperProps: { style: { backgroundColor: '#9e9e9e' } } }}}
*/
return (
<div className="MbfWindowDiv">
<div className="MbfWindowHeader">
Expand All @@ -388,14 +377,31 @@ function AddRemovePluginsDiv({ plugins }) {
<Alert onClose={handleSnackClose} severity="info" variant="filled" sx={{ width: '100%', bgcolor: '#4CAF50' }}>Restart required</Alert>
</Snackbar>
<TextField value={pluginName} onChange={(event) => { setPluginName(event.target.value); }} size="small" id="plugin-name" label="Plugin name or plugin path" variant="outlined" fullWidth/>

<IconButton onClick={handleClickVertical}>
<MoreVert />
</IconButton>
<Menu id="simple-menu" anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={() => handleCloseMenu('')}>
<MenuItem onClick={() => handleCloseMenu('matterbridge-zigbee2mqtt')}>matterbridge-zigbee2mqtt</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-somfy-tahoma')}>matterbridge-somfy-tahoma</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-shelly')}>matterbridge-shelly</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-example-accessory-platform')}>matterbridge-example-accessory-platform</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-example-dynamic-platform')}>matterbridge-example-dynamic-platform</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-eve-door')}>matterbridge-eve-door</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-eve-motion')}>matterbridge-eve-motion</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-eve-energy')}>matterbridge-eve-energy</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-eve-weather')}>matterbridge-eve-weather</MenuItem>
<MenuItem onClick={() => handleCloseMenu('matterbridge-eve-room')}>matterbridge-eve-room</MenuItem>
</Menu>

<Tooltip title="Install or update a plugin from npm">
<Button onClick={handleInstallPluginClick} theme={theme} color="primary" variant='contained' size="small" aria-label="install" endIcon={<Download />} style={{ color: '#ffffff', height: '30px' }}> Install</Button>
<Button onClick={handleInstallPluginClick} theme={theme} color="primary" variant='contained' size="small" aria-label="install" endIcon={<Download />} style={{ color: '#ffffff', height: '30px', minWidth: '90px' }}> Install</Button>
</Tooltip>
<Tooltip title="Add an installed plugin">
<Button onClick={handleAddPluginClick} theme={theme} color="primary" variant='contained' size="small" aria-label="add" endIcon={<Add />} style={{ color: '#ffffff', height: '30px' }}> Add</Button>
<Button onClick={handleAddPluginClick} theme={theme} color="primary" variant='contained' size="small" aria-label="add" endIcon={<Add />} style={{ color: '#ffffff', height: '30px', minWidth: '90px' }}> Add</Button>
</Tooltip>
<Tooltip title="Remove a registered plugin">
<Button onClick={handleRemovePluginClick} theme={theme} color="primary" variant='contained' size="small" aria-label="remove" endIcon={<Remove />} style={{ color: '#ffffff', height: '30px' }}> Remove</Button>
<Button onClick={handleRemovePluginClick} theme={theme} color="primary" variant='contained' size="small" aria-label="remove" endIcon={<Remove />} style={{ color: '#ffffff', height: '30px', minWidth: '90px' }}> Remove</Button>
</Tooltip>
</div>
</div>
Expand Down
92 changes: 46 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matterbridge",
"version": "1.2.17",
"version": "1.2.18",
"description": "Matterbridge plugin manager for Matter",
"author": "https://github.com/Luligu",
"license": "Apache-2.0",
Expand Down Expand Up @@ -82,8 +82,8 @@
"@types/express": "^4.17.21",
"@types/node": "^20.12.12",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
Expand All @@ -98,4 +98,4 @@
"node-persist-manager": "^1.0.7",
"ws": "^8.17.0"
}
}
}
2 changes: 1 addition & 1 deletion src/AirQualityCluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export namespace AirQuality {
}

export const Base = MutableCluster.Component({
id: 0x5b,
id: 0x005b,
name: 'AirQuality',
revision: 1,

Expand Down
Loading

0 comments on commit 2d995ba

Please sign in to comment.