Skip to content

Commit cd0191b

Browse files
committed
Migrate to serialx
1 parent 63ea14f commit cd0191b

5 files changed

Lines changed: 5 additions & 10 deletions

File tree

plugwise_usb/connection/manager.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import logging
88
from typing import Any
99

10-
from serial import EIGHTBITS, PARITY_NONE, STOPBITS_ONE, SerialException
11-
from serial_asyncio_fast import SerialTransport, create_serial_connection
10+
from serialx import SerialException, SerialTransport, create_serial_connection
1211

1312
from ..api import StickEvent
1413
from ..exceptions import StickError
@@ -132,10 +131,6 @@ async def setup_connection_to_stick(self, serial_path: str) -> None:
132131
lambda: self._receiver,
133132
url=serial_path,
134133
baudrate=115200,
135-
bytesize=EIGHTBITS,
136-
stopbits=STOPBITS_ONE,
137-
parity=PARITY_NONE,
138-
xonxoff=False,
139134
),
140135
timeout=5,
141136
)

plugwise_usb/connection/receiver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import logging
3434
from typing import Any, Final
3535

36-
from serial_asyncio_fast import SerialTransport
36+
from serialx import SerialTransport
3737

3838
from ..api import StickEvent
3939
from ..constants import MESSAGE_FOOTER, MESSAGE_HEADER

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ maintainers = [
2727
]
2828
requires-python = ">=3.13.0"
2929
dependencies = [
30-
"pyserial-asyncio-fast",
3130
"aiofiles",
3231
"crcmod",
3332
"semver",
33+
"serialx",
3434
]
3535

3636
[project.urls]

requirements_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
pytest-asyncio
55
radon==6.0.1
66
types-python-dateutil
7-
pyserial-asyncio-fast
87
aiofiles
98
freezegun
109
pytest-cov
10+
serialx

tests/test_usb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ async def test_stick_connect_without_port(self) -> None:
366366

367367
with pytest.raises(pw_exceptions.StickError):
368368
await stick.connect()
369-
stick.port = "null"
369+
stick.port = None
370370
with pytest.raises(pw_exceptions.StickError):
371371
await stick.connect()
372372
await stick.disconnect()

0 commit comments

Comments
 (0)