Skip to content

Commit

Permalink
Merge pull request #30 from Luligu/dev
Browse files Browse the repository at this point in the history
Release 1.2.17
  • Loading branch information
Luligu authored May 25, 2024
2 parents 95d0e53 + e8693e8 commit b74e1ab
Show file tree
Hide file tree
Showing 26 changed files with 697 additions and 671 deletions.
136 changes: 92 additions & 44 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,93 @@
{
"plugins": [
"@typescript-eslint",
"@stylistic",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"prettier/prettier": ["error"],
"indent": ["error", 2, { "SwitchCase": 1 }],
"max-len": ["warn", 250],
"no-console": ["warn"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": false }],
"comma-spacing": ["error", { "before": false, "after": true }],
"space-before-function-paren": ["error", { "anonymous": "always", "named": "never", "asyncArrow": "always" }],
"keyword-spacing": ["error", { "before": true, "after": true }],
"no-multi-spaces": "error",
"object-curly-spacing": ["error", "always"],
"@typescript-eslint/type-annotation-spacing": ["error", {
"before": false,
"after": true,
"overrides": {
"arrow": {
"before": true,
"after": true
}
}
}]
}
}
"plugins": [
"@typescript-eslint",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/stylistic",
"prettier"
],
"rules": {
"prettier/prettier": [
"error"
],
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"max-len": [
"warn",
250
],
"spaced-comment": [
"error",
"always"
],
"no-console": [
"warn"
],
"quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": false
}
],
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"keyword-spacing": [
"error",
{
"before": true,
"after": true
}
],
"no-multi-spaces": "error",
"object-curly-spacing": [
"error",
"always"
],
"@typescript-eslint/type-annotation-spacing": [
"error",
{
"before": false,
"after": true,
"overrides": {
"arrow": {
"before": true,
"after": true
}
}
}
]
}
}
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-buildx-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
--platform linux/amd64,linux/arm64,linux/arm/v7 \
-f docker/Dockerfile.main \
-t luligu/matterbridge:latest \
-t luligu/matterbridge:1.2.15 \
-t luligu/matterbridge:1.2.17 \
--push .
docker manifest inspect luligu/matterbridge:latest
timeout-minutes: 60
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

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

## [1.2.17] - 2024-05-22

### Fixed
- [matterbridge]: Fixed the issue causing the commissioning reset for all fabrics when only one is removed. (Apple uses 2 fabrics: Home app and Key chain).

### Changed
- [matterbridge]: Preliminary integration for the new matterbridge-shelly plugin (still not published)
- [matterbridge]: Updated dependencies
- [matterbridge]: Moved eslint to @typescript-eslint/strict and @typescript-eslint/stylistic

### Added
- [frontend]: Fetch data in Home page every minute
- [device]: Added new method addClusterServerFromList
- [device]: Added ModeSelectClusterServer (only for testing)
- [matterbridge]: Added fabric info in the log on startup
- [matterbridge]: Added vendorId for Alexa

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

## [1.2.16] - 2024-05-15

### Changed
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ RUN npm -g install matterbridge-eve-weather
# WORKDIR /app
# Node modules: /usr/local/lib/node_modules/matterbridge/dist/cli.js
# Bin: /usr/local/bin/matterbridge
CMD ["/usr/local/bin/matterbridge", "-bridge", "-docker", "-frontend", "8283", "-port", "5550"]
CMD ["/usr/local/bin/matterbridge", "-bridge", "-docker", "-frontend", "8283"]
2 changes: 1 addition & 1 deletion docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ COPY --from=builder /matterbridge-eve-weather/*.tgz .
RUN npm -g install *.tgz
RUN rm *.tgz

CMD ["matterbridge", "-bridge", "-docker", "-frontend", "8283", "-port", "5550"]
CMD ["matterbridge", "-bridge", "-docker", "-frontend", "8283"]
3 changes: 1 addition & 2 deletions docker/Dockerfile.main
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ RUN npm -g install matterbridge-eve-room
RUN npm -g install matterbridge-eve-weather

WORKDIR /app
CMD ["matterbridge", "-bridge", "-docker", "-frontend", "8283", "-port", "5550"]
# CMD ["node", "dist/cli.js", "-bridge", "-docker", "-frontend", "8283", "-port", "5550"]
CMD ["matterbridge", "-bridge", "-docker", "-frontend", "8283"]
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.b08bfdf4.js",
"main.js": "/static/js/main.eab44937.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.b08bfdf4.js.map": "/static/js/main.b08bfdf4.js.map",
"main.eab44937.js.map": "/static/js/main.eab44937.js.map",
"453.d855a71b.chunk.js.map": "/static/js/453.d855a71b.chunk.js.map"
},
"entrypoints": [
"static/css/main.57bd18a9.css",
"static/js/main.b08bfdf4.js"
"static/js/main.eab44937.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.b08bfdf4.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.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>
1 change: 0 additions & 1 deletion frontend/build/static/js/main.b08bfdf4.js.map

This file was deleted.

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions frontend/src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function Header() {
}, 20000);
};

/*
useEffect(() => {
// Fetch settinggs from the backend
fetch('/api/settings')
Expand All @@ -122,6 +123,37 @@ function Header() {
})
.catch(error => console.error('Error fetching settings:', error));
}, []); // The empty array causes this effect to run only once
*/
useEffect(() => {
// Fetch settings from the backend
const fetchSettings = () => {

fetch('/api/settings')
.then(response => response.json())
.then(data => {
console.log('From header /api/settings (header):', data);
setWssHost(data.wssHost);
setQrCode(data.qrPairingCode);
setPairingCode(data.manualPairingCode);
setSystemInfo(data.systemInformation);
setMatterbridgeInfo(data.matterbridgeInformation);
localStorage.setItem('wssHost', data.wssHost);
localStorage.setItem('qrPairingCode', data.qrPairingCode);
localStorage.setItem('manualPairingCode', data.manualPairingCode);
localStorage.setItem('systemInformation', data.systemInformation);
localStorage.setItem('matterbridgeInformation', data.matterbridgeInformation);
})
.catch(error => console.error('Error fetching settings:', error));
};

// Call fetchSettings immediately and then every 10 minutes
fetchSettings();
const intervalId = setInterval(fetchSettings, 1 * 60 * 1000);

// Clear the interval when the component is unmounted
return () => clearInterval(intervalId);

}, []); // The empty array causes this effect to run only once

return (
Expand Down
Loading

0 comments on commit b74e1ab

Please sign in to comment.