Skip to content

Commit 080d673

Browse files
committed
chore: address PR comments
1 parent eda0a93 commit 080d673

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

roborock/devices/b01_channel.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def send_decoded_command(
2828
dps: int,
2929
command: CommandType,
3030
params: ParamsType,
31-
) -> dict | None:
31+
) -> dict[str, Any] | None:
3232
"""Send a command on the MQTT channel and get a decoded response."""
3333
msg_id = str(get_next_int(100000000000, 999999999999))
3434
_LOGGER.debug(
@@ -104,6 +104,17 @@ def find_response(response_message: RoborockMessage) -> None:
104104
raise RoborockException(
105105
f"B01 command timed out after {_TIMEOUT}s (method={command}, msg_id={msg_id}, dps={dps}, params={params})"
106106
) from ex
107+
except RoborockException as ex:
108+
_LOGGER.warning(
109+
"Error sending B01 decoded command (method=%s msg_id=%s dps=%s params=%s): %s",
110+
command,
111+
msg_id,
112+
dps,
113+
params,
114+
ex,
115+
)
116+
raise
117+
107118
except Exception as ex:
108119
_LOGGER.exception(
109120
"Error sending B01 decoded command (method=%s msg_id=%s dps=%s params=%s): %s",

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@ async def query_values(self, props: list[RoborockB01Props]) -> B01Props | None:
3838
raise TypeError(f"Unexpected response type for GET_PROP: {type(result).__name__}: {result!r}")
3939
return B01Props.from_dict(result)
4040

41-
async def set_prop(self, prop: RoborockB01Props, value: Any) -> Any:
41+
async def set_prop(self, prop: RoborockB01Props, value: Any) -> None:
4242
"""Set a property on the device."""
4343
await self.send(
4444
command=RoborockB01Q7Methods.SET_PROP,
4545
params={prop: value},
4646
)
4747

48-
async def set_fan_speed(self, fan_speed: SCWindMapping) -> Any:
48+
async def set_fan_speed(self, fan_speed: SCWindMapping) -> None:
4949
"""Set the fan speed (wind)."""
50-
return await self.set_prop(RoborockB01Props.WIND, fan_speed.code)
50+
await self.set_prop(RoborockB01Props.WIND, fan_speed.code)
5151

52-
async def set_water_level(self, water_level: WaterLevelMapping) -> Any:
52+
async def set_water_level(self, water_level: WaterLevelMapping) -> None:
5353
"""Set the water level (water)."""
54-
return await self.set_prop(RoborockB01Props.WATER, water_level.code)
54+
await self.set_prop(RoborockB01Props.WATER, water_level.code)
5555

56-
async def start_clean(self) -> Any:
56+
async def start_clean(self) -> None:
5757
"""Start cleaning."""
58-
return await self.send(
58+
await self.send(
5959
command=RoborockB01Q7Methods.SET_ROOM_CLEAN,
6060
params={
6161
"clean_type": CleanTaskTypeMapping.ALL.code,
@@ -64,9 +64,9 @@ async def start_clean(self) -> Any:
6464
},
6565
)
6666

67-
async def pause_clean(self) -> Any:
67+
async def pause_clean(self) -> None:
6868
"""Pause cleaning."""
69-
return await self.send(
69+
await self.send(
7070
command=RoborockB01Q7Methods.SET_ROOM_CLEAN,
7171
params={
7272
"clean_type": CleanTaskTypeMapping.ALL.code,
@@ -75,9 +75,9 @@ async def pause_clean(self) -> Any:
7575
},
7676
)
7777

78-
async def stop_clean(self) -> Any:
78+
async def stop_clean(self) -> None:
7979
"""Stop cleaning."""
80-
return await self.send(
80+
await self.send(
8181
command=RoborockB01Q7Methods.SET_ROOM_CLEAN,
8282
params={
8383
"clean_type": CleanTaskTypeMapping.ALL.code,
@@ -86,16 +86,16 @@ async def stop_clean(self) -> Any:
8686
},
8787
)
8888

89-
async def return_to_dock(self) -> Any:
89+
async def return_to_dock(self) -> None:
9090
"""Return to dock."""
91-
return await self.send(
91+
await self.send(
9292
command=RoborockB01Q7Methods.START_RECHARGE,
9393
params={},
9494
)
9595

96-
async def find_me(self) -> Any:
96+
async def find_me(self) -> None:
9797
"""Locate the robot."""
98-
return await self.send(
98+
await self.send(
9999
command=RoborockB01Q7Methods.FIND_DEVICE,
100100
params={},
101101
)

0 commit comments

Comments
 (0)