Skip to content

Fix the app agreement route, fan power from set_clean_motor_mode, and device rename - #260

Merged
Lash-L merged 3 commits into
Python-roborock:mainfrom
virtitnerd:pr/small-fixes
Nov 15, 2026
Merged

Lash-L merged 3 commits into
Python-roborock:mainfrom
virtitnerd:pr/small-fixes

Conversation

@virtitnerd

Copy link
Copy Markdown
Contributor

Three small fixes found while using the official app against the local server. Each is its own commit.

Let the app agreement route be read before login

The route that answers is /api/v4/app/agreement/latest, but the list of public paths named
/api/v4/agreement/latest, so the route that answers needed a token. The real path is now in the list (the old one
stays).

Record fan power from the dict set_clean_motor_mode sends

The fan power handler only read an int or a list of ints. The app's set_clean_motor_mode sends
[{"fan_power": 102, "water_box_mode": 202, ...}], so the stored fan power went stale. The handler now reads
fan_power from a dict, alone or as the first item of a list, and ignores non-int values.

Persist device name and silentOtaSwitch from PUT /user/devices/<duid>

Renaming a robot in the app, or toggling silent OTA, was never stored, so the app showed the old values again. The
server now handles the PUT: for a known device it stores the change under device_overrides in the web inventory
and answers with the updated device detail. The override is applied to the device detail and home data (over the
cloud snapshot), mirrored onto the inventory's device records, and kept across cloud inventory imports. Names are
trimmed and limited to 64 characters, silentOtaSwitch must be true or false, and anything else (including other
fields) is ignored.

Testing

New tests in tests/test_device_put.py (name and switch stored and shown in the detail and home data, bad values and
other fields ignored, unknown device stores nothing, override kept across a reload and a cloud import) and tests/test_fan_power_handler.py, and a case in tests/test_protocol_auth.py for the agreement path
with and without a trailing slash. Full suite: 468 passed.

virtitnerd and others added 3 commits November 13, 2026 18:02
The route that answers is /api/v4/app/agreement/latest, but the public path list named /api/v4/agreement/latest, so the route that answers needed a token.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The handler only read an int or a list of ints, so the app's [{fan_power, water_box_mode, ...}] body left the stored fan power stale.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Store local overrides under device_overrides in the web inventory, mirror
them onto inventory device records, apply them to device detail and home
data (over the cloud snapshot), and keep them across cloud inventory imports.

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

@Lash-L Lash-L 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.

TY!

@Lash-L
Lash-L merged commit 3f811ca into Python-roborock:main Nov 15, 2026
3 checks passed
@virtitnerd
virtitnerd deleted the pr/small-fixes branch November 17, 2026 05:07
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