Skip to content

Commit 7570e51

Browse files
committed
feat: add some more actions
1 parent 8cd51cc commit 7570e51

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,63 @@ async def send(self, command: RoborockB01Q7Methods, params: dict) -> Any:
109109
params=params,
110110
)
111111

112+
async def start_clean(self) -> dict[str, Any]:
113+
"""Start cleaning."""
114+
return await send_decoded_command(
115+
self._channel,
116+
dps=10000,
117+
command=RoborockB01Q7Methods.SET_ROOM_CLEAN,
118+
params={
119+
"clean_type": CleanTaskTypeMapping.ALL.code,
120+
"ctrl_value": SCDeviceCleanParam.START.code,
121+
"room_ids": [],
122+
},
123+
)
124+
125+
async def pause_clean(self) -> dict[str, Any]:
126+
"""Pause cleaning."""
127+
return await send_decoded_command(
128+
self._channel,
129+
dps=10000,
130+
command=RoborockB01Q7Methods.SET_ROOM_CLEAN,
131+
params={
132+
"clean_type": CleanTaskTypeMapping.ALL.code,
133+
"ctrl_value": SCDeviceCleanParam.PAUSE.code,
134+
"room_ids": [],
135+
},
136+
)
137+
138+
async def stop_clean(self) -> dict[str, Any]:
139+
"""Stop cleaning."""
140+
return await send_decoded_command(
141+
self._channel,
142+
dps=10000,
143+
command=RoborockB01Q7Methods.SET_ROOM_CLEAN,
144+
params={
145+
"clean_type": CleanTaskTypeMapping.ALL.code,
146+
"ctrl_value": SCDeviceCleanParam.STOP.code,
147+
"room_ids": [],
148+
},
149+
)
150+
151+
async def return_to_dock(self) -> dict[str, Any]:
152+
"""Return to dock."""
153+
return await send_decoded_command(
154+
self._channel,
155+
dps=10000,
156+
command=RoborockB01Q7Methods.START_RECHARGE,
157+
params={},
158+
)
159+
160+
async def find_me(self) -> dict[str, Any]:
161+
"""Locate the robot."""
162+
return await send_decoded_command(
163+
self._channel,
164+
dps=10000,
165+
command=RoborockB01Q7Methods.FIND_DEVICE,
166+
params={},
167+
)
168+
112169

113170
def create(channel: MqttChannel) -> Q7PropertiesApi:
114171
"""Create traits for B01 devices."""

0 commit comments

Comments
 (0)