Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Home Assistant add-on support (and a dev add-on export workflow) to the Roborock Local Server stack, alongside version bumps and a few protocol/runtime enhancements to better support HA and MITM-based onboarding/sync flows.
Changes:
- Introduces Home Assistant add-on manifests/docs plus a config generator (
options.json→config.toml) and a container entrypoint that prefers HA options when present. - Updates runtime/admin behavior for protocol sync (exposes
admin.session_secretin the admin auth payload/UI) and expands protocol/user route coverage (shared device endpoints). - Tightens configuration expectations for
stack_fqdn(must start withapi-) and removes/blocksexternal_tlslistener mode, updating tests/docs accordingly.
Reviewed changes
Copilot reviewed 35 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updates locked editable package version metadata. |
| tests/test_version_sync.py | Adds test ensuring HA add-on version matches package __version__. |
| tests/test_routine_runner.py | Clarifies scripted status transitions with comments. |
| tests/test_protocol_auth.py | Adds test for reauth using matching snapshot identity. |
| tests/test_plugin_routes.py | Updates expected proxied plugin host (api-roborock...). |
| tests/test_mqtt_tls_proxy.py | Adds tests for TLS-disabled accept path and TLS-context validation. |
| tests/test_ha_addon_export.py | Verifies dev add-on export output structure and version stamping. |
| tests/test_ha_addon.py | Adds coverage for HA options → TOML config generation and validations. |
| tests/test_container_entrypoint.py | Adds tests for entrypoint config selection precedence. |
| tests/test_configure.py | Updates defaults/expectations for stack_fqdn using api- prefix. |
| tests/test_config.py | Adds config validation tests for api- prefix and external_tls rejection. |
| tests/test_admin_api.py | Extends admin API tests (sync secret visibility; shared device query endpoints). |
| tests/conftest.py | Updates default stack_fqdn used by test helpers. |
| src/roborock_local_server/standalone_admin.py | Adds dashboard UI section to display/copy protocol sync secret. |
| src/roborock_local_server/server.py | Adds snapshot-based protocol login identity selection; exposes admin_session_secret; introduces TLS-enabled flags for HTTP/MQTT servers; adds new endpoint wiring. |
| src/roborock_local_server/ha_addon.py | New HA add-on options adapter that writes config.toml (+ Cloudflare token handling). |
| src/roborock_local_server/container_entrypoint.py | New entrypoint that chooses compose config vs HA options vs existing data config. |
| src/roborock_local_server/configure.py | Requires api- prefix for stack_fqdn during interactive configure prompts. |
| src/roborock_local_server/config.py | Enforces api- prefix and rejects unsupported network.listener_mode. |
| src/roborock_local_server/bundled_backend/mqtt_tls_proxy_server/server.py | Makes MQTT proxy TLS optional; factors out TLS context build + accept logic. |
| src/roborock_local_server/bundled_backend/https_server/routes/user/deviceshare.py | Adds /user/deviceshare/query/* handlers for received devices and rooms. |
| src/roborock_local_server/bundled_backend/https_server/endpoint_rules.py | Registers new shared-device endpoint rules. |
| src/roborock_local_server/init.py | Bumps __version__ to 0.0.2-rc6. |
| scripts/sync_home_assistant_dev_addon.ps1 | New helper script to export and robocopy dev add-on to an HA host. |
| scripts/export_home_assistant_dev_addon.py | New exporter that generates a self-contained HA dev add-on repo from the working tree. |
| roborock_local_server_addon/config.yaml | Adds HA add-on manifest for the published image; pins add-on version. |
| roborock_local_server_addon/DOCS.md | Adds add-on usage docs and TLS/broker notes. |
| roborock_local_server_addon/CHANGELOG.md | Adds initial add-on changelog file. |
| repository.yaml | Adds HA add-on repository metadata. |
| pyproject.toml | Bumps project version to 0.0.2-rc6. |
| mitm_redirect.py | Clarifies --sync-secret help text for multi-config deployments. |
| docs/roborock_app.md | Updates guidance around sync secret discovery/usage with MITM flow. |
| docs/home_assistant.md | Adds HA add-on install path and dev add-on export workflow docs. |
| config.example.toml | Updates example stack_fqdn and clarifies port comment wording. |
| README.md | Adds link to HA add-on files and adjusts badge ordering. |
| Dockerfile | Switches container CMD to run the new Python module entrypoint. |
| .gitignore | Cleans up ignores (adds dist/, .tmp*, removes duplicate dist/). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,5 @@ | |||
| # Changelog | |||
|
|
|||
| ## 0.0.2-rc1 | |||
| return secret if len(secret) >= 24 else "" | ||
|
|
||
|
|
||
| def _render_config_toml(*, options: dict[str, Any], config_path: Path, cloudflare_token_path: Path) -> str: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.