Skip to content

Commit 11976c5

Browse files
committed
chore: clarify comments and docstrings
1 parent 84af81c commit 11976c5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

roborock/devices/device.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ async def start_connect(self) -> None:
147147
called. The device will automatically attempt to reconnect if the connection
148148
is lost.
149149
"""
150-
# We don't care about the value of the future, just that we wait long enough
151-
# to let the first connection attempt happen.
150+
# The future will be set to True if the first attempt succeeds, False if
151+
# it fails, or an exception if an unexpected error occurs.
152+
# We use this to wait a short time for the first attempt to complete. We
153+
# don't actually care about the result, just that we waited long enough.
152154
start_attempt: asyncio.Future[bool] = asyncio.Future()
153155

154156
async def connect_loop() -> None:

tests/devices/test_device_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,6 @@ async def test_start_connect_failure(home_data: HomeData, channel_failure: Mock,
252252
],
253253
)
254254
async def test_start_connect_unexpected_error(home_data: HomeData, channel_failure: Mock, mock_sleep: Mock) -> None:
255-
"""Test that some exceptions from start_connect are propagated."""
255+
"""Test that some unexpected errors from start_connect are propagated."""
256256
with pytest.raises(Exception, match="Unexpected error"):
257257
await create_device_manager(USER_PARAMS)

0 commit comments

Comments
 (0)