Skip to content

Commit

Permalink
matter_server: Add beta flag (#3282)
Browse files Browse the repository at this point in the history
* matter_server: Add beta flag

Add a new flag which allows to install the latest pre-release of the
Python Matter Server. This is useful for testing new (pre-)releases
before bumping the add-on.

Previously we tried different approaches like a separate beta version of
the add-on. This has the problem that it has it's separate data store
(means no more devices in case the non-beta add-on has been used
previously) and it gets chaotic as the Matter integration is still
trying to start the non-beta version of the add-on.

With this attempt we can reuse the same add-on for testing. The downside
is once new OS dependencies are required, those won't be added. In that
case a regular add-on version bump would be necessary first.

* Update matter_server/config.yaml

Co-authored-by: Franck Nijhof <[email protected]>

---------

Co-authored-by: Franck Nijhof <[email protected]>
  • Loading branch information
agners and frenck authored Oct 26, 2023
1 parent 23d63cf commit 2480122
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions matter_server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.10.0

- Add beta flag to the add-on which installs Python Matter Server pre-releases at startup.

## 4.9.0

- Bump Python Matter Server to [3.7.0](https://github.com/home-assistant-libs/python-matter-server/releases/tag/3.7.0)
Expand Down
4 changes: 3 additions & 1 deletion matter_server/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 4.9.0
version: 4.10.0
slug: matter_server
name: Matter Server
description: Matter WebSocket Server for Home Assistant Matter support.
Expand All @@ -20,8 +20,10 @@ image: homeassistant/{arch}-addon-matter-server
init: false
options:
log_level: info
beta: false
schema:
log_level: list(debug|info|warning|error|critical)
beta: bool?
ports:
5580/tcp: null
stage: stable
Expand Down
5 changes: 5 additions & 0 deletions matter_server/rootfs/etc/s6-overlay/s6-rc.d/matter-server/run
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ if [ "$log_level" = "invalid" ]; then
log_level="info"
fi

if bashio::config.true "beta"; then
bashio::log.info 'Upgrading Python Matter Server to latest pre-release'
pip3 install --upgrade --pre python-matter-server[server]
fi

# Bind to internal hassio network only unless user requests to expose
server_port="$(bashio::addon.port 5580)"
if ! bashio::var.has_value "${server_port}"; then
Expand Down
5 changes: 5 additions & 0 deletions matter_server/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ configuration:
log_level:
name: Matter Server Log Level
description: Logging level of the Matter Server component.
beta:
name: Use the latest beta version
description: >-
Installs the latest beta of the Python Matter Server. It is recommended
to create a backup before starting the add-on with this flag enabled!
network:
5580/tcp: Matter Server WebSocket server port.

0 comments on commit 2480122

Please sign in to comment.