Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/DEVICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Cloud and Network.
* Use `device.b01_q10_properties.vacuum` to access vacuum commands (start, pause, stop, dock, empty dustbin, set clean mode, set fan level).
* Use `device.b01_q10_properties.command.send()` for raw DP commands.
* **Vacuums (B01 Q7)**: Use `device.b01_q7_properties` for Q7 series devices.
* The device streams full map frames on its own while cleaning, so the rendered map stays current without polling or a heartbeat. Register `device.b01_q7_properties.map_content.add_update_listener(cb)` and read `image_content` / `map_data` when notified.

## Background: Understanding Device Protocols

Expand Down
4 changes: 4 additions & 0 deletions roborock/devices/traits/b01/q7/map_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- fields `image_content`, `map_data`, and `raw_api_response` are then readable

For B01/Q7 devices, the underlying raw map payload is retrieved via `MapTrait`.

Q7 devices additionally stream map frames unprompted while cleaning; those arrive
through `update_from_push()`, which keeps the same cached fields current and
notifies registered update listeners.
"""

import asyncio
Expand Down
3 changes: 3 additions & 0 deletions tests/devices/traits/b01/q7/test_map_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ async def test_q7_map_content_updates_from_push(
fake_channel.map_push_callback(pushed_payload)

assert q7_api.map_content.image_content == b"pngbytes"
assert q7_api.map_content.map_data is dummy_map_data
assert q7_api.map_content.raw_api_response == pushed_payload
assert updates == [True]
# No RPC was needed to get here.
assert fake_channel.published_commands == []

await q7_api.close()
assert fake_channel.map_push_callback is None
Expand Down
Loading