Skip to content

Commit f20e4f1

Browse files
update typing hints for UART pins of ModbusRTU and Serial in serial.py, related to brainelectronics#17 and brainelectronics#43
1 parent a934bda commit f20e4f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

umodbus/serial.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ModbusRTU(Modbus):
4141
:param parity: The parity, default None
4242
:type parity: Optional[int]
4343
:param pins: The pins as list [TX, RX]
44-
:type pins: List[int, int]
44+
:type pins: List[Union[int, Pin], Union[int, Pin]]
4545
:param ctrl_pin: The control pin
4646
:type ctrl_pin: int
4747
:param uart_id: The ID of the used UART
@@ -53,7 +53,7 @@ def __init__(self,
5353
data_bits: int = 8,
5454
stop_bits: int = 1,
5555
parity: Optional[int] = None,
56-
pins: List[int, int] = None,
56+
pins: List[Union[int, Pin], Union[int, Pin]] = None,
5757
ctrl_pin: int = None,
5858
uart_id: int = 1):
5959
super().__init__(
@@ -76,7 +76,7 @@ def __init__(self,
7676
data_bits: int = 8,
7777
stop_bits: int = 1,
7878
parity=None,
79-
pins: List[int, int] = None,
79+
pins: List[Union[int, Pin], Union[int, Pin]] = None,
8080
ctrl_pin: int = None):
8181
"""
8282
Setup Serial/RTU Modbus
@@ -92,7 +92,7 @@ def __init__(self,
9292
:param parity: The parity, default None
9393
:type parity: Optional[int]
9494
:param pins: The pins as list [TX, RX]
95-
:type pins: List[int, int]
95+
:type pins: List[Union[int, Pin], Union[int, Pin]]
9696
:param ctrl_pin: The control pin
9797
:type ctrl_pin: int
9898
"""

0 commit comments

Comments
 (0)