Skip to content

Add the official Voice Assistant page, with Chat History and voice language switching - #119

Open
virtitnerd wants to merge 3 commits into
DonSidro:masterfrom
virtitnerd:pr2/voice-assistant
Open

virtitnerd wants to merge 3 commits into
DonSidro:masterfrom
virtitnerd:pr2/voice-assistant

Conversation

@virtitnerd

Copy link
Copy Markdown
Contributor

Voice control robots such as the Qrevo Curv 2 Flow have a Voice Assistant page in the official app: the on/off switch, example commands, the voice language, the volume and the robot's chat history. LocalRock had none of it. This adds that page under Robot settings, with the official wording and behaviour, and lets you switch the robot's voice language through the local server.

Requires

What's in it

  • Where it lives. On robots that advertise voice control (feature bit 37) the Volume row in Robot settings becomes a Voice Assistant row, as the official app keeps the volume on that page. Other robots keep the Volume row as before. Bit 37 is no longer listed on the Beta page as a feature without controls.
  • The Voice Assistant switch, read with get_voice_service_switch and set with set_voice_service_switch. The set call takes only the bare {"data":1} object; the wrapped shapes the Beta switches try first time out instead of being refused, so it does not go through the Beta feature path.
  • "Say Hello Rocky" and example commands. Two rows of command chips, 16 phrases shuffled from the official English list as the plugin does, and a "More voice interaction instructions" link to a Voice Commands page with the full list in its official groups (Clean, Dock Control, Pause and resume, Robot Settings, Room Cleaning).
  • The official voice data footnote under the switch.
  • Language, from get_current_sound, named the way the official Language page names its packs. It opens the Language page described below.
  • Volume, with the same picker Robot settings uses.
  • Chat History, shown when the robot answers get_voice_history_summary. The page reads get_voice_history in windows of 100 ids like the official page (newest 1000 at most) and opens on the newest line. Speaker 1 is you and draws on the right; the robot's replies draw on the left. Only your lines carry a stamp (2026/11/12 09:03), when a minute has passed since the last one.
  • Language page. Lists the robot's voice packs with Current or Use, as the official SoundPackagePage does. The list comes from the server's GET /voice-pkg/info?model=<model>, filtered by the robot's location and sorted by voice_pri. Use sends dnld_install_sound with sid, url, md5, sver and an empty ota_url, then polls get_sound_progress and get_current_sound every 2 s until the new pack is in use, the robot reports a failure, or 5 minutes pass. The download and install failures use the official messages. The install runs in the view model, so leaving the page does not stop it.
  • Preloading. The switch, the language and the chat history count are read with the robot's other one-shot reads, so the page opens complete. The history itself is read only when Chat History opens.

How it was tested

testDebugUnitTest and compileCommonMainKotlinMetadata pass on this branch, and assembleDebug builds. Unit tests cover the switch reply and its bare-object params, the history summary and history replies the Curv sent, the id windows, the language names, the chat stamps (including time zone offsets and a leap day), the voice pack list filter and order, get_current_sound and get_sound_progress parsing, the install steps against the plugin's progress rules, and the dnld_install_sound params.

On a Qrevo Curv 2 Flow on 2026-11-14, with the server route deployed:

  • the Language page listed more than 20 voice packs
  • switching to Deutsch finished in about 4 s, and get_current_sound then reported sid_in_use 103
  • switching back to English restored sid 3
  • Chat History showed the robot's entry

The branch was also merged with every other open PR without conflicts.

Notes

  • The voice pack URLs in the list point at the local server, and the robot downloads the pack from that URL itself, so the server name must resolve on the robot's network (it already does for a robot onboarded to the server).
  • The chat stamps are formatted in common code from the device's UTC offset, so no date library is added; localUtcOffsetSeconds has Android and iOS implementations next to formatCleanRecordTime.
  • The Voice Commands list is the plugin's English list for non-Beryl robots; its own misspellings ("vaccum harder") are kept.

virtitnerd and others added 3 commits November 14, 2026 22:20
Voice control robots (newFeatureSet bit 37) answer the calls the official
Voice Assistant page uses:
- get_voice_service_switch / set_voice_service_switch, which takes only the
  bare {"data":1} object; the wrapped shapes time out instead of being refused
- get_current_sound for the voice language
- get_voice_history_summary and get_voice_history, read in windows of 100 ids
  like the official chat page, newest 1000 at most

VoiceAssistant holds what was read; a read that fails keeps the earlier
answer. Speaker 1 is the user. Chat stamps follow the official format
(2026/11/12 09:03) and only user lines carry one, when a minute has passed.
Bit 37 is no longer listed as an advertised feature without controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On voice control robots the Volume row in Robot settings becomes a Voice
Assistant row, and the page follows the official card order:
- the Voice Assistant switch, "Say Hello Rocky" and two rows of example
  command chips (16 phrases shuffled from the official list, as the plugin
  does), with "More voice interaction instructions" opening a Voice
  Commands page
- the official voice data footnote
- Volume, with the same picker Robot settings uses
- Chat History, when the robot answers get_voice_history_summary, opening
  the robot's voice log; the user's lines draw on the right

The switch and the history count are preloaded with the robot's other
one-shot reads, so the page opens complete; the history itself is read
only when Chat History opens. Other robots keep the Volume row as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Language row shows the robot's voice language and opens a Language page
that lists its voice packs with Current or Use, as the official
SoundPackagePage does. The list comes from the local server's
GET /voice-pkg/info?model=<model> passthrough of the plugin's voice-pkg
info file, filtered by the robot's location and sorted by voice_pri.

Use sends dnld_install_sound with sid, url, md5, sver and an empty
ota_url, then polls get_sound_progress and get_current_sound every 2 s
until the new pack is in use, the robot reports a failure, or 5 minutes
pass. Without the server route the page shows "Voice packs unavailable"
with Retry, and the rest of the Voice Assistant page works as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant