Skip to content

Commit 7752db9

Browse files
authored
feat: improve some typing (#204)
1 parent 459782e commit 7752db9

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

roborock/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def __init__(self, endpoint: str, device_info: DeviceData, queue_timeout: int =
4949
def __del__(self) -> None:
5050
self.release()
5151

52-
def release(self):
52+
def release(self) -> None:
5353
self.sync_disconnect()
5454

55-
async def async_release(self):
55+
async def async_release(self) -> None:
5656
await self.async_disconnect()
5757

5858
@property

roborock/version_1_apis/roborock_mqtt_client_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ async def _send_command(
7171
roborock_message = RoborockMessage(timestamp=timestamp, protocol=request_protocol, payload=payload)
7272
return await self.send_message(roborock_message)
7373

74-
async def get_map_v1(self):
74+
async def get_map_v1(self) -> bytes | None:
7575
return await self.send_command(RoborockCommand.GET_MAP_V1)

roborock/version_a01_apis/roborock_client_a01.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ def on_message_received(self, messages: list[RoborockMessage]) -> None:
137137
if queue and queue.protocol == protocol:
138138
queue.resolve((converted_response, None))
139139

140-
async def update_values(self, dyad_data_protocols: list[RoborockDyadDataProtocol | RoborockZeoProtocol]):
140+
async def update_values(
141+
self, dyad_data_protocols: list[RoborockDyadDataProtocol | RoborockZeoProtocol]
142+
) -> dict[RoborockDyadDataProtocol | RoborockZeoProtocol, typing.Any]:
141143
"""This should handle updating for each given protocol."""
142144
raise NotImplementedError

roborock/version_a01_apis/roborock_mqtt_client_a01.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ async def send_message(self, roborock_message: RoborockMessage):
5757
dps_responses[dps] = response[0]
5858
return dps_responses
5959

60-
async def update_values(self, dyad_data_protocols: list[RoborockDyadDataProtocol | RoborockZeoProtocol]):
60+
async def update_values(
61+
self, dyad_data_protocols: list[RoborockDyadDataProtocol | RoborockZeoProtocol]
62+
) -> dict[RoborockDyadDataProtocol | RoborockZeoProtocol, typing.Any]:
6163
payload = {"dps": {RoborockDyadDataProtocol.ID_QUERY: str([int(protocol) for protocol in dyad_data_protocols])}}
6264
return await self.send_message(
6365
RoborockMessage(

0 commit comments

Comments
 (0)