-
-
Notifications
You must be signed in to change notification settings - Fork 38k
Battery status for Roborock Q7 #165886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Battery status for Roborock Q7 #165886
Changes from all commits
c310fbc
6ab1dc8
4023c35
6b59979
db52148
5097f40
3315e46
cddf497
24c4e93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -366,6 +366,13 @@ def _dock_error_value_fn(state: DeviceState) -> str | None: | |||||
| translation_key="main_brush_time_left", | ||||||
| entity_category=EntityCategory.DIAGNOSTIC, | ||||||
| ), | ||||||
| RoborockSensorDescriptionB01( | ||||||
| key="battery", | ||||||
| value_fn=lambda data: data.battery, | ||||||
|
||||||
| value_fn=lambda data: data.battery, | |
| value_fn=lambda data: data.quantity.battery, |
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Q7 B01 battery sensor adds a new entity that will be included by tests/components/roborock/test_sensor.py’s snapshot-based coverage. Since tests/components/roborock/snapshots/test_sensor.ambr currently has no sensor.roborock_q7_battery entry, the existing snapshot test will fail (and the new entity isn’t validated) until the snapshot is updated to include this new sensor (entry + state).
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the Roborock sensor snapshot to include the new Q7 battery entity so the existing snapshot tests stay in sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1564,6 +1564,7 @@ | |
| main_sensor=500, | ||
| mop_life=1200, | ||
| real_clean_time=3000, | ||
| quantity=100, | ||
| ) | ||
|
|
||
| Q10_STATUS = Q10Status( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't needed right? You can just access the .battery property directly from the B01Props object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated
python-roborockto the latest (5.0.0) version and tried changing it to battery and got the below error.I think because we agreed to make it an @Property instead of an enum class, this
.QUANTITYis there to tell the API to reply back with thequantityvalue that we need in order to get the battery level.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes that makes sense