Skip to content

feat(web_api): add firmware/OTA info, update trigger and silent-OTA switch - #839

Open
ximex wants to merge 1 commit into
Python-roborock:mainfrom
ximex:firmware-ota
Open

feat(web_api): add firmware/OTA info, update trigger and silent-OTA switch#839
ximex wants to merge 1 commit into
Python-roborock:mainfrom
ximex:firmware-ota

Conversation

@ximex

@ximex ximex commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds cloud firmware/OTA support to RoborockApiClient, so consumers (e.g. the
Home Assistant integration) can expose a firmware update entity and an
auto-update switch. Part of #739 (Roborock Q7 / B01 feature gap).

All three endpoints live on the rriot API host (user_data.rriot.r.a,
e.g. api-eu.roborock.com) with Hawk-signed auth — the same scheme already
used for the home-data endpoints. This was confirmed by capturing the official
Android app via mitmproxy: the IoT host (usiot.roborock.com) returns an empty
body for these paths, the rriot host returns the real data.

What's added

  • FirmwareInfo dataclass (version, current_version, updatable, desc,
    release_time, force_update).
  • get_firmware_info(user_data, duid) -> GET /ota/firmware/{duid}/updatev2?lang=en.
  • start_firmware_update(user_data, duid) -> POST /ota/device/{duid}/upgrade
    (empty body). Triggers the irreversible flash.
  • set_silent_ota(user_data, duid, enabled) -> PUT /user/devices/{duid} with
    form field silentOtaSwitch (part of the signed MAC). The current value is
    reported as silent_ota_switch on the home-data device.

Notes

  • OTA progress is not available over REST (/upgrade/status returns 400 /
    empty during a flash); the device reports progress over MQTT instead.

Verification

  • Live-tested against a real account with a pending update: 03.01.80 available
    while 03.01.74 installed; install trigger and silent-OTA toggle captured
    1:1 from the app.
  • New unit tests + aioresponses fixtures; ruff clean.

Copilot AI review requested due to automatic review settings June 3, 2026 22:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds OTA/firmware-related Web API support and accompanying test coverage.

Changes:

  • Introduces FirmwareInfo container for OTA firmware metadata.
  • Adds Web API client methods to fetch firmware info, start firmware update, and toggle silent OTA updates.
  • Extends aioresponses fixtures and test suite for the new endpoints.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
tests/test_web_api.py Adds async tests validating new OTA/firmware Web API methods.
tests/fixtures/web_api_fixtures.py Mocks OTA firmware/info, upgrade, and device update endpoints.
roborock/web_api.py Implements get_firmware_info, start_firmware_update, and set_silent_ota.
roborock/data/containers.py Adds FirmwareInfo dataclass to parse OTA firmware metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_web_api.py
Comment thread roborock/web_api.py Outdated
Comment thread roborock/web_api.py Outdated
Comment thread roborock/web_api.py Outdated
Comment thread tests/fixtures/web_api_fixtures.py Outdated
Comment thread tests/fixtures/web_api_fixtures.py Outdated
Comment thread roborock/data/containers.py Outdated
@Lash-L
Lash-L marked this pull request as draft June 3, 2026 23:52
Comment thread roborock/web_api.py Outdated
Comment thread roborock/web_api.py Outdated
…oggle

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ximex
ximex marked this pull request as ready for review August 26, 2026 19:21
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.

3 participants