Skip to content

Add Ha app#25

Merged
Lash-L merged 8 commits intomainfrom
ha_app
May 3, 2026
Merged

Add Ha app#25
Lash-L merged 8 commits intomainfrom
ha_app

Conversation

@Lash-L
Copy link
Copy Markdown
Contributor

@Lash-L Lash-L commented May 3, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.jsonconfig.toml) and a container entrypoint that prefers HA options when present.
  • Updates runtime/admin behavior for protocol sync (exposes admin.session_secret in the admin auth payload/UI) and expands protocol/user route coverage (shared device endpoints).
  • Tightens configuration expectations for stack_fqdn (must start with api-) and removes/blocks external_tls listener 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
Comment thread src/roborock_local_server/ha_addon.py Outdated
return secret if len(secret) >= 24 else ""


def _render_config_toml(*, options: dict[str, Any], config_path: Path, cloudflare_token_path: Path) -> str:
@Lash-L Lash-L merged commit 735b881 into main May 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants