Skip to content

fix(api): return DeviceSortContainerV2 from GET /api/v1/home/{id}/devices/order - #210

Merged
Lash-L merged 1 commit into
Python-roborock:mainfrom
SmarthomeElektroniker:fix/home-devices-order-container
Oct 30, 2026
Merged

Lash-L merged 1 commit into
Python-roborock:mainfrom
SmarthomeElektroniker:fix/home-devices-order-container

Conversation

@SmarthomeElektroniker

Copy link
Copy Markdown
Contributor

Problem

The Android app reads the device order through IHomeApiV2:

GET /api/v1/home/{homeId}/devices/order
→ ApiWrapper<DeviceSortContainerV2>

From the app's serializers:

DeviceSortContainerV2 = {"type": DeviceSortType, "listOrders": [DeviceSortBeanV2]}
DeviceSortBeanV2      = {"source": DeviceSource, "did": String, "order": Int}
DeviceSortType        = HOME
DeviceSource          = UNDEFINED | TUYA | RR | THIRD_PARTY

The server returned a bare list of duids:

{"code": 200, "msg": "success", "data": ["<duid>"]}

The app fails with:

RR/rrRunCatching: Expected start of the object '{', but had '[' at path: $.data

Fix

{"code": 200, "msg": "success",
 "data": {"type": "HOME",
          "listOrders": [{"source": "RR", "did": "<duid>", "order": 0}]}}

getHomeDetail.deviceListOrder stays a flat list. That is a different type.

Tests

tests/test_home_devices_order.py checks the container shape and the order of two devices.

Full suite: passing.

Live check (Oct 2026): verified together with the other fixes of this series (all based on current main) against the Android app 4.60.06 and a real Q7 Max (roborock.vacuum.a38). The app called /api/v1/home/<id>/devices/order and the home screen loaded without the Expected start of the object error.

Notes (not changed here)

IHomeApiV2 also has POST on the same path to save the order, and that method returns Boolean. match_home_devices_order ignores the HTTP method, so a POST currently gets the GET payload as well. Persisting the order is out of scope for this PR.

🤖 Generated with Claude Code

…ices/order

The Android app (IHomeApiV2, GET /api/v1/home/{homeId}/devices/order) expects
ApiWrapper<DeviceSortContainerV2>:

    {"type": "HOME", "listOrders": [{"source": "RR", "did": <duid>, "order": <int>}]}

The server returned a bare list of duids, which fails in the app with
"Expected start of the object '{', but had '[' at path: $.data".

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 66b00b6 into Python-roborock:main Oct 30, 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