Skip to content

Commit a3b7cee

Browse files
fix: s8 model name and adding api methods get_child_lock_status and get_sound_volume
1 parent ebb41b4 commit a3b7cee

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

roborock/api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
from .code_mappings import RoborockDockTypeCode
2121
from .containers import (
22+
ChildLockStatus,
2223
CleanRecord,
2324
CleanSummary,
2425
Consumable,
@@ -369,6 +370,19 @@ async def get_room_mapping(self) -> list[RoomMapping] | None:
369370
]
370371
return None
371372

373+
@fallback_cache
374+
async def get_child_lock_status(self) -> ChildLockStatus | None:
375+
"""Gets current child lock status."""
376+
child_lock_status = await self.send_command(RoborockCommand.GET_CHILD_LOCK_STATUS)
377+
if isinstance(child_lock_status, dict):
378+
return ChildLockStatus.from_dict(child_lock_status)
379+
return None
380+
381+
@fallback_cache
382+
async def get_sound_volume(self) -> int | None:
383+
"""Gets current volume level."""
384+
return await self.send_command(RoborockCommand.GET_SOUND_VOLUME)
385+
372386

373387
class RoborockApiClient:
374388
def __init__(self, username: str, base_url=None) -> None:

roborock/const.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
ROBOROCK_1S = "roborock.vacuum.m1s"
3333
ROBOROCK_C1 = "roborock.vacuum.c1"
3434
ROBOROCK_S8_PRO_ULTRA = "roborock.vacuum.a70"
35-
ROBOROCK_S8 = "roborock.vacuum.a60" # CHECK THIS
36-
ROBOROCK_WILD = "roborock.vacuum.*" # wildcard
35+
ROBOROCK_S8 = "roborock.vacuum.a51"
3736

3837
SUPPORTED_VACUUMS = (
3938
[ # These are the devices that show up when you add a device - more could be supported and just not show up

roborock/containers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ class RoomMapping(RoborockBase):
474474
iot_id: str
475475

476476

477+
@dataclass
478+
class ChildLockStatus(RoborockBase):
479+
lock_status: int
480+
481+
477482
@dataclass
478483
class BroadcastMessage(RoborockBase):
479484
duid: str

0 commit comments

Comments
 (0)