Skip to content

Commit b8dce3e

Browse files
committed
Merge remote-tracking branch 'origin/main' into switch_to_uv
# Conflicts: # poetry.lock # pyproject.toml
2 parents 13e2399 + 5a4a03b commit b8dce3e

File tree

13 files changed

+29
-28
lines changed

13 files changed

+29
-28
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ classifiers = [
2121
dependencies = [
2222
"click>=8",
2323
"aiohttp>=3.8.2,<4",
24-
"async-timeout",
2524
"pycryptodome~=3.18",
2625
"pycryptodomex~=3.18 ; sys_platform == 'darwin'",
2726
"paho-mqtt>=1.6.1,<3.0.0",

roborock/devices/a01_channel.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@
2929
async def send_decoded_command(
3030
mqtt_channel: MqttChannel,
3131
params: dict[RoborockDyadDataProtocol, Any],
32-
) -> dict[RoborockDyadDataProtocol, Any]:
33-
...
32+
) -> dict[RoborockDyadDataProtocol, Any]: ...
3433

3534

3635
@overload
3736
async def send_decoded_command(
3837
mqtt_channel: MqttChannel,
3938
params: dict[RoborockZeoProtocol, Any],
40-
) -> dict[RoborockZeoProtocol, Any]:
41-
...
39+
) -> dict[RoborockZeoProtocol, Any]: ...
4240

4341

4442
async def send_decoded_command(

roborock/devices/traits/traits_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, trait: Trait) -> None:
4242
"""
4343
for item in fields(self):
4444
trait_type = _get_trait_type(item)
45-
if trait_type == type(trait):
45+
if trait_type is type(trait):
4646
setattr(self, item.name, trait)
4747
break
4848

roborock/devices/traits/v1/map_content.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Trait for fetching the map content from Roborock devices."""
2+
23
import logging
34
from dataclasses import dataclass
45

roborock/devices/traits/v1/maps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
with maps and rooms, such as map names and room names. These override the
55
base container datatypes to add additional fields.
66
"""
7+
78
import logging
89
from typing import Self
910

roborock/devices/v1_rpc_channel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
and local connections, preferring local when available.
77
"""
88

9-
109
import asyncio
1110
import logging
1211
from collections.abc import Callable

roborock/roborock_future.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from __future__ import annotations
22

3+
import asyncio
34
from asyncio import Future
45
from typing import Any
56

6-
import async_timeout
7-
87
from .exceptions import VacuumError
98

109

@@ -30,7 +29,7 @@ def set_exception(self, exc: VacuumError) -> None:
3029

3130
async def async_get(self, timeout: float | int) -> tuple[Any, VacuumError | None]:
3231
try:
33-
async with async_timeout.timeout(timeout):
32+
async with asyncio.timeout(timeout):
3433
return await self.fut
3534
finally:
3635
self.fut.cancel()

roborock/version_1_apis/roborock_local_client_v1.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from dataclasses import dataclass
66
from enum import StrEnum
77

8-
import async_timeout
9-
108
from .. import CommandVacuumError, DeviceData, RoborockCommand
119
from ..api import RoborockClient
1210
from ..exceptions import RoborockConnectionException, RoborockException, VacuumError
@@ -101,7 +99,7 @@ async def async_connect(self) -> None:
10199
try:
102100
if not self.is_connected():
103101
self._sync_disconnect()
104-
async with async_timeout.timeout(self.queue_timeout):
102+
async with asyncio.timeout(self.queue_timeout):
105103
self._logger.debug(f"Connecting to {self.host}")
106104
loop = get_running_loop()
107105
self.transport, _ = await loop.create_connection( # type: ignore

tests/devices/traits/v1/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""""Fixtures for V1 trait tests."""
1+
"""Fixtures for V1 trait tests."""
22

33
from unittest.mock import AsyncMock
44

tests/mqtt/test_roborock_session.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ def new_client(*args: Any, **kwargs: Any) -> mqtt.Client:
6060
task = event_loop.create_task(poll_sockets(client))
6161
return client
6262

63-
with patch("aiomqtt.client.Client._on_socket_open"), patch("aiomqtt.client.Client._on_socket_close"), patch(
64-
"aiomqtt.client.Client._on_socket_register_write"
65-
), patch("aiomqtt.client.Client._on_socket_unregister_write"), patch(
66-
"aiomqtt.client.mqtt.Client", side_effect=new_client
63+
with (
64+
patch("aiomqtt.client.Client._on_socket_open"),
65+
patch("aiomqtt.client.Client._on_socket_close"),
66+
patch("aiomqtt.client.Client._on_socket_register_write"),
67+
patch("aiomqtt.client.Client._on_socket_unregister_write"),
68+
patch("aiomqtt.client.mqtt.Client", side_effect=new_client),
6769
):
6870
yield
6971
if task:

0 commit comments

Comments
 (0)