Repository navigation
Conversation
The official app installs a voice pack by sending the robot a Roborock URL (dnld_install_sound), which a robot cut off from the internet cannot reach. The server now serves /voice-pkg/<bucket>/info, Roborock's list with every URL pointing at this server, and /voice-pkg/<bucket>/<package|pic|wav>/<file>, fetched from Roborock once, checked against the list's MD5 and kept under <data_dir>/voice_packs. The first request for a list also stores every pack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The list's voice_pkg_md5 is not the MD5 of the file Roborock serves (an a296 nl.pkg hashes to its ETag, 75bcab..., the list says 71737e...); the robot checks it after unpacking. It is passed on untouched, and the download is checked against Roborock's ETag instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- [voice_packs] mode = mirror (default) | offline | disabled, also as the Home Assistant add-on option voice_packs_mode. offline serves only stored copies and never contacts Roborock; disabled answers 404. - Rewritten list URLs carry the advertised HTTPS port when it is not 443. - docs/voice_packs.md: how the mirror works, buckets, how a client uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Every file, not only packages, must be in the stored list before it is fetched; at most 8 buckets are mirrored. - Downloads are read in chunks and refused past 64 MB (lists 2 MB); lists use a 15 s timeout. - Refused files and failed list refreshes are not retried for 10 minutes, so a down Roborock no longer stalls every list request. - A corrupt stored list is replaced; disk errors answer 507 instead of 500. - A package is fetched again when the list shows a new md5/version for it. - The prefetch task is kept, logged, retried after a failure and cancelled on stop. An unknown region is logged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Changing the robot's voice sends
dnld_install_soundwith a URL from Roborock's voice-pack list. A robot whose internet access is blocked, as it usually is with this server, cannot download from Roborock, so voice changes fail.This adds a small mirror:
GET /voice-pkg/<bucket>/inforeturns Roborock's list for a product (e.g.vidafor the Saros 20 Neo, a295/a296) with every pack, picture and preview URL pointing at this server.GET /voice-pkg/<bucket>/{package,pic,wav}/<file>serves a file: fetched from Roborock the first time, checked against the storage ETag (an MD5), and kept under<data_dir>/voice_packs/. The first list request also downloads the whole bucket in the background, so later changes need no internet.[voice_packs] mode:mirror(default),offline(serve stored copies only, never contact Roborock) ordisabled(routes return 404). The Home Assistant add-on gets the same choice asvoice_packs_mode.docs/voice_packs.md, linked from the README, docs index and the example config.Like the cloud import and plugin proxy,
mirrormode talks to Roborock's servers;offlineanddisabledare there for anyone who doesn't want that.The official app still reads the list from Roborock directly, so it keeps sending Roborock's URLs; a client has to use this list for the robot to download locally. (LocalRock does.)
Abuse limits
The routes are public, like Roborock's own copies, because the robot downloads without credentials. To keep them from being used to make the server fetch arbitrary things:
Testing
tests/test_voice_packs.py: URL rewriting, name validation, fetch-once, offline mode, port handling, disabled mode, back-off, cap, corrupt list, republished package. Plus config and add-on tests.🤖 Generated with Claude Code