Conversation
Codecov Report❌ Patch coverage is
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR implements basic property getter support for B01 Q7 devices by adding request-response message handling with message ID tracking, fixing encryption/decryption padding for A01/B01 protocols, and making all B01Props fields optional to support partial property queries.
- Implements async request-response pattern with message ID matching and timeout handling in B01 channel
- Fixes AES CBC mode encryption by adding proper PKCS7 padding/unpadding for A01 and B01 protocols
- Updates B01Props to return actual property data instead of None, with all fields optional to support querying subsets of properties
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| roborock/protocols/b01_protocol.py | Adds msg_id parameter to encode_mqtt_payload for request-response correlation |
| roborock/protocol.py | Adds pad/unpad calls to A01/B01 encryption/decryption and improves EOF handling in message parsing |
| roborock/devices/traits/b01/q7/init.py | Changes query_values to return B01Props instead of None and adds import for B01Props |
| roborock/devices/b01_channel.py | Implements full request-response handling with message ID matching, subscription management, and timeout handling |
| roborock/data/b01_q7/b01_q7_containers.py | Makes all B01Props fields optional to support partial property queries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Will add test |
|
okay tests are out, ready for a review whenever @allenporter Tests are mainly AI generated with some changes based off of a01 protocols and the v1 traits. |
roborock/devices/b01_channel.py
Outdated
| await mqtt_channel.publish(roborock_message) | ||
| msg_id = str(get_next_int(100000000000, 999999999999)) | ||
| roborock_message = encode_mqtt_payload(dps, command, params, msg_id) | ||
| finished = asyncio.Event() |
There was a problem hiding this comment.
asyncio.Future seems more appropriate here than event + separate result object.
Co-authored-by: Allen Porter <allen.porter@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Allen Porter <allen.porter@gmail.com>
| _LOGGER.info("Failed to decode b01 message: %s: %s", response_message, ex) | ||
| return | ||
|
|
||
| for dps_value in decoded_dps.values(): |
There was a problem hiding this comment.
For a future PR consider if decode_rpc_response should return a dict of parsed values similar to a01 decode then unit tests for corner cases can be more narrow without the full test setup.
No description provided.