Skip to content

Commit b78e3cd

Browse files
authored
Release 2.2.2
## [2.2.2] - 2026-01-20 ### Added - [matter]: Conformance to Matter 1.4.2 and matterbridge 3.5.x. - [thermostat]: Conformance to Matter 1.4.2. ### Changed - [package]: Updated dependencies. - [package]: Updated package to automator v. 3.0.0. - [package]: Refactored Dev Container to use Matterbridge mDNS reflector. - [package]: Requires Matterbridge v.3.5.0. <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
1 parent 1a7b21f commit b78e3cd

32 files changed

+1128
-844
lines changed

.devcontainer/devcontainer.json

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,57 @@
11
// .devcontainer/devcontainer.json
22

33
// This file defines the development container configuration for a Matterbridge Plugin.
4-
// WARNING: since the dev container doesn't have network host and ipv6, you can run matterbridge inside the container and test the plugin but is not possible to pair the Matterbridge instance.
4+
5+
/*
6+
************************************************* WARNING *************************************************
7+
Dev containers have networking limitations depending on the host OS and Docker setup.
8+
9+
• Docker Desktop on Windows or macOS:
10+
- Runs inside a VM
11+
- Host networking mode is NOT available
12+
- Matterbridge and plugins can run but:
13+
❌ Pairing with Matter controllers will NOT work cause of missing mDNS support
14+
✅ Remote and local network access (cloud services, internet APIs) works normally
15+
✅ Matterbridge frontend works normally
16+
17+
• Native Linux or WSL 2 with Docker Engine CLI integration:
18+
- Host networking IS available
19+
- Full local network access is supported
20+
- Matterbridge and plugins work correctly, including pairing
21+
- Matterbridge frontend works normally
22+
************************************************* WARNING *************************************************
23+
*/
524
{
625
// Name of the dev container
726
"name": "Matterbridge Plugin Dev Container",
827
// Use the pre-built image with Node+TypeScript
928
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:latest",
29+
// Inherit timezone from the host environment (set TZ on the host, e.g. Europe/Paris)
30+
"containerEnv": {
31+
"TZ": "${localEnv:TZ}"
32+
},
1033
// Mount the local matterbridge and node_modules workspace folder to the container's workspace volumes to improve performance
1134
"mounts": [
1235
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
36+
"source=${localWorkspaceFolderBasename}-cache,target=${containerWorkspaceFolder}/.cache,type=volume",
37+
"source=${localWorkspaceFolderBasename}-plugins,target=/home/node/Matterbridge,type=volume",
38+
"source=${localWorkspaceFolderBasename}-storage,target=/home/node/.matterbridge,type=volume",
39+
"source=${localWorkspaceFolderBasename}-cert,target=/home/node/.mattercert,type=volume",
1340
"source=matterbridge,target=/matterbridge,type=volume"
1441
],
15-
// On startup, update npm, pnpm, install the dev of matterbridge and install the dependencies from package.json
16-
"postCreateCommand": "sudo npm install -g npm@latest pnpm@latest npm-check-updates shx && sudo chmod +x ./install-matterbridge-*.sh && ./install-matterbridge-dev.sh && sudo chown -R node:node . && npm install && npm link matterbridge && npm run build && npm outdated || true",
17-
// Give the Docker container the same name as the repository (must be unique on host)
18-
"runArgs": ["--name", "${localWorkspaceFolderBasename}"],
42+
// Create the matterbridge Docker network if it doesn't exist (runs on the HOST before the container starts).
43+
"initializeCommand": "docker network inspect matterbridge || docker network create matterbridge",
44+
// On startup, update npm, install and link the dev of matterbridge and install and build the plugin
45+
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
46+
"runArgs": [
47+
// Give the Docker container the same name as the repository (must be unique on host)
48+
"--name",
49+
"${localWorkspaceFolderBasename}",
50+
// Use network host mode if on Docker Engine on Linux or WSL 2 to allow full local network access and mDNS support
51+
// "--network=host"
52+
// Use a shared bridge network to allow to access other containers with their names (dns resolution). With the default bridge, dns resolution does not work (only ip:port).
53+
"--network=matterbridge"
54+
],
1955
"customizations": {
2056
"vscode": {
2157
// Extensions to install in the dev container
@@ -24,16 +60,26 @@
2460
"ms-azuretools.vscode-containers",
2561
"dbaeumer.vscode-eslint",
2662
"esbenp.prettier-vscode",
63+
"github.copilot-chat",
2764
"github.vscode-github-actions",
2865
"github.vscode-pull-request-github"
2966
],
3067
// Settings for the VS Code environment
3168
"settings": {
69+
"terminal.integrated.shell.linux": "/bin/bash",
70+
"terminal.integrated.scrollback": 10000,
71+
"editor.tabSize": 2,
72+
"editor.formatOnSave": true,
73+
"editor.codeActionsOnSave": {
74+
"source.fixAll.eslint": "explicit"
75+
},
3276
"eslint.format.enable": true,
3377
"eslint.useFlatConfig": true,
34-
"editor.formatOnSave": true,
35-
"terminal.integrated.shell.linux": "/bin/bash",
36-
"terminal.integrated.scrollback": 10000
78+
"diffEditor.ignoreTrimWhitespace": false,
79+
"git.autofetch": true,
80+
"files.eol": "\n",
81+
"files.insertFinalNewline": true,
82+
"files.trimFinalNewlines": true
3783
}
3884
}
3985
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ if [ ! -d "/workspaces" ]; then
1414
fi
1515
sudo chown -R node:node matterbridge
1616
sudo chmod g+s matterbridge
17-
rm -rf matterbridge/* matterbridge/.[!.]* matterbridge/..?*
17+
sudo rm -rf matterbridge/* matterbridge/.[!.]* matterbridge/..?*
1818
# Shallow clone for speed (history not needed inside dev container). Remove --depth if full history required.
1919
git clone --depth 1 --single-branch --no-tags -b dev https://github.com/Luligu/matterbridge.git matterbridge
2020
cd matterbridge
2121
npm ci --no-fund --no-audit
2222
npm run build
2323
npm install . --global --no-fund --no-audit
24-
rm -rf .git .github .vscode docker systemd docs public screenshot
25-
echo "Matterbridge has been installed from the dev branch."
24+
rm -rf .cache .devcontainer .git .github .vscode docker docs reflector screenshots scripts systemd
25+
echo "Matterbridge has been installed from the dev branch."

install-matterbridge-main.sh renamed to .devcontainer/install-matterbridge-main.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ if [ ! -d "/workspaces" ]; then
1414
fi
1515
sudo chown -R node:node matterbridge
1616
sudo chmod g+s matterbridge
17-
rm -rf matterbridge/* matterbridge/.[!.]* matterbridge/..?*
17+
sudo rm -rf matterbridge/* matterbridge/.[!.]* matterbridge/..?*
1818
# Shallow clone for speed (history not needed inside dev container). Remove --depth if full history required.
1919
git clone --depth 1 --single-branch --no-tags https://github.com/Luligu/matterbridge.git matterbridge
2020
cd matterbridge
2121
npm ci --no-fund --no-audit
2222
npm run build
2323
npm install . --global --no-fund --no-audit
24-
rm -rf .git .github .vscode docker systemd docs public screenshot
25-
echo "Matterbridge has been installed from the main branch."
24+
rm -rf .cache .devcontainer .git .github .vscode docker docs reflector screenshots scripts systemd
25+
echo "Matterbridge has been installed from the main branch."

.devcontainer/postCreateCommand.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
3+
# postCreateCommand.sh
4+
5+
# This script runs after the Dev Container is created to set up the dev container environment.
6+
7+
set -euo pipefail
8+
9+
echo "Welcome to Matterbridge Plugin Dev Container"
10+
DISTRO=$(awk -F= '/^PRETTY_NAME=/{gsub(/"/, "", $2); print $2}' /etc/os-release)
11+
CODENAME=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release)
12+
echo "Distro: $DISTRO ($CODENAME)"
13+
echo "User: $(whoami)"
14+
echo "Hostname: $(hostname)"
15+
echo "Architecture: $(uname -m)"
16+
echo "Kernel Version: $(uname -r)"
17+
echo "Uptime: $(uptime -p || echo 'unavailable')"
18+
echo "Date: $(date)"
19+
echo "Node.js version: $(node -v)"
20+
echo "Npm version: $(npm -v)"
21+
echo ""
22+
23+
echo "1 - Installing updates and scripts..."
24+
npm install --global --no-fund --no-audit npm npm-check-updates shx cross-env
25+
26+
echo "2 - Building Matterbridge..."
27+
sudo chmod +x .devcontainer/install-matterbridge-*.sh
28+
# Use this for the main branch:
29+
# .devcontainer/install-matterbridge-main.sh
30+
# Use this for the dev branch:
31+
.devcontainer/install-matterbridge-dev.sh
32+
33+
echo "3 - Creating directories..."
34+
sudo mkdir -p /home/node/Matterbridge /home/node/.matterbridge /home/node/.mattercert
35+
36+
echo "4 - Setting permissions..."
37+
sudo chown -R node:node . /home/node/Matterbridge /home/node/.matterbridge /home/node/.mattercert
38+
39+
echo "5 - Building the package..."
40+
npm install --no-fund --no-audit
41+
npm link matterbridge --no-fund --no-audit
42+
npm run build
43+
npm run matterbridge:add
44+
npm outdated || true
45+
46+
echo "6 - Setup completed!"

.github/workflows/build-matterbridge-plugin.yml renamed to .github/workflows/build.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,8 @@ jobs:
2626
uses: actions/setup-node@v4
2727
with:
2828
node-version: ${{ matrix.node-version }}
29-
30-
- name: Clean cache
31-
run: npm cache clean --force
32-
33-
- name: Verify Node.js version
34-
run: node -v
35-
36-
- name: Verify Npm version
37-
run: npm -v
29+
registry-url: 'https://registry.npmjs.org'
30+
cache: npm
3831

3932
- name: Clone matterbridge repo
4033
run: git clone --depth 1 --single-branch --no-tags https://github.com/Luligu/matterbridge.git ../matterbridge
@@ -52,10 +45,10 @@ jobs:
5245
run: npm link --no-fund --no-audit
5346

5447
- name: Install plugin dependencies
55-
run: npm ci
48+
run: npm ci --no-fund --no-audit
5649

5750
- name: Link matterbridge in the project
58-
run: npm link matterbridge
51+
run: npm link matterbridge --no-fund --no-audit
5952

6053
- name: Build the plugin
6154
run: npm run build

.github/workflows/codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
with:
2727
node-version: '22.x'
2828
registry-url: 'https://registry.npmjs.org'
29+
cache: npm
2930

3031
- name: Clone matterbridge repo
3132
run: git clone --depth 1 --single-branch --no-tags https://github.com/Luligu/matterbridge.git ../matterbridge

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25-
- uses: github/codeql-action/init@v3
25+
- uses: github/codeql-action/init@v4
2626
with:
2727
languages: javascript
28-
- uses: github/codeql-action/analyze@v3
28+
- uses: github/codeql-action/analyze@v4

.github/workflows/publish-matterbridge-plugin-dev-daily-from-dev.yml renamed to .github/workflows/publish-daily-dev-from-dev.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ jobs:
2323
with:
2424
node-version: '22.x'
2525
registry-url: 'https://registry.npmjs.org'
26-
27-
- name: Clean npm cache
28-
run: npm cache clean --force
26+
cache: npm
2927

3028
- name: Clone matterbridge repo branch dev
3129
run: git clone --depth 1 --single-branch --no-tags -b dev https://github.com/Luligu/matterbridge.git ../matterbridge
@@ -42,18 +40,20 @@ jobs:
4240
working-directory: ../matterbridge
4341
run: npm link --no-fund --no-audit
4442

45-
- name: Lint & test & build the plugin
46-
run: |
47-
npm ci
48-
npm link matterbridge
49-
npm run buildProduction
50-
npm run lint
51-
npm install -g .
52-
npm run test -- --forceExit
53-
npm pkg delete devDependencies scripts types
54-
npx shx rm -rf ./node_modules
55-
npm install --omit=dev
56-
npm shrinkwrap
43+
- name: Install plugin dependencies
44+
run: npm ci
45+
46+
- name: Link matterbridge in the project
47+
run: npm link matterbridge
48+
49+
- name: Build the plugin
50+
run: npm run build
51+
52+
- name: Lint the plugin
53+
run: npm run lint
54+
55+
- name: Test the plugin
56+
run: npm run test -- --forceExit
5757

5858
- name: Extract base version and date
5959
id: vars
@@ -66,7 +66,7 @@ jobs:
6666
echo "ORIG_SHA=$SHA" >> $GITHUB_ENV
6767
6868
- name: Bump to date-commit-stamped version --no-git-tag-version tag ${{ env.DEV_TAG }} sha ${{ env.ORIG_SHA }}
69-
run: npm version "${{ env.DEV_TAG }}" --no-git-tag-version
69+
run: npm version "${{ env.DEV_TAG }}" --no-git-tag-version --ignore-scripts
7070

7171
- name: Check if a new dev-publish is needed
7272
id: check_new

.github/workflows/publish-matterbridge-plugin-dev-daily-from-main.yml renamed to .github/workflows/publish-daily-dev-from-main.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ jobs:
2323
with:
2424
node-version: '22.x'
2525
registry-url: 'https://registry.npmjs.org'
26-
27-
- name: Clean npm cache
28-
run: npm cache clean --force
26+
cache: npm
2927

3028
- name: Clone matterbridge repo branch dev
3129
run: git clone --depth 1 --single-branch --no-tags -b dev https://github.com/Luligu/matterbridge.git ../matterbridge
@@ -42,18 +40,20 @@ jobs:
4240
working-directory: ../matterbridge
4341
run: npm link --no-fund --no-audit
4442

45-
- name: Lint & test & build the plugin
46-
run: |
47-
npm ci
48-
npm link matterbridge
49-
npm run buildProduction
50-
npm run lint
51-
npm install -g .
52-
npm run test -- --forceExit
53-
npm pkg delete devDependencies scripts types
54-
npx shx rm -rf ./node_modules
55-
npm install --omit=dev
56-
npm shrinkwrap
43+
- name: Install plugin dependencies
44+
run: npm ci
45+
46+
- name: Link matterbridge in the project
47+
run: npm link matterbridge
48+
49+
- name: Build the plugin
50+
run: npm run build
51+
52+
- name: Lint the plugin
53+
run: npm run lint
54+
55+
- name: Test the plugin
56+
run: npm run test -- --forceExit
5757

5858
- name: Extract base version and date
5959
id: vars
@@ -66,7 +66,7 @@ jobs:
6666
echo "ORIG_SHA=$SHA" >> $GITHUB_ENV
6767
6868
- name: Bump to date-commit-stamped version --no-git-tag-version tag ${{ env.DEV_TAG }} sha ${{ env.ORIG_SHA }}
69-
run: npm version "${{ env.DEV_TAG }}" --no-git-tag-version
69+
run: npm version "${{ env.DEV_TAG }}" --no-git-tag-version --ignore-scripts
7070

7171
- name: Check if a new dev-publish is needed
7272
id: check_new

.github/workflows/publish-matterbridge-plugin.yml renamed to .github/workflows/publish.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ jobs:
1717
with:
1818
node-version: '22.x'
1919
registry-url: 'https://registry.npmjs.org'
20-
21-
- name: Clean cache
22-
run: npm cache clean --force
20+
cache: npm
2321

2422
- name: Verify Node.js version
2523
run: node -v

0 commit comments

Comments
 (0)