Skip to content

Commit 2d7cf36

Browse files
committed
2 parents 2f5cc5d + d4805d5 commit 2d7cf36

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

roborock/data/b01_q7/b01_q7_containers.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ class B01Props(RoborockBase):
114114
wind: SCWindMapping | None = None
115115
water: WaterLevelMapping | None = None
116116
mode: CleanTypeMapping | None = None
117-
quantity: int | None = None
118-
battery: int | None = None
117+
quantity: int | None = None # The Q7 L5 reports its battery level as 'quantity'
119118
alarm: int | None = None
120119
volume: int | None = None
121120
hypa: int | None = None
@@ -169,6 +168,13 @@ class B01Props(RoborockBase):
169168
serial_number: str | None = None
170169
recommend: Recommend | None = None
171170
add_sweep_status: int | None = None
171+
172+
@property
173+
def battery(self) -> int | None:
174+
"""
175+
Returns device battery level as a percentage.
176+
"""
177+
return self.quantity
172178

173179
@property
174180
def main_brush_time_left(self) -> int | None:

roborock/devices/traits/b01/q7/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def set_clean_path_preference(self, preference: CleanPathPreferenceMapping
8484
async def set_repeat_state(self, repeat: CleanRepeatMapping) -> None:
8585
"""Set the cleaning repeat state (cycles)."""
8686
await self.set_prop(RoborockB01Props.REPEAT_STATE, repeat.code)
87-
87+
8888
async def start_clean(self) -> None:
8989
"""Start cleaning."""
9090
await self.send(

roborock/roborock_message.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ class RoborockB01Props(StrEnum):
165165
WATER = "water"
166166
MODE = "mode"
167167
QUANTITY = "quantity"
168-
BATTERY = "quantity"
169168
ALARM = "alarm"
170169
VOLUME = "volume"
171170
HYPA = "hypa"

0 commit comments

Comments
 (0)