Skip to content

Commit 75553e7

Browse files
committed
add serial.Serial as a valid type for uart parameter of Adafruit_Fingerprint.__init__
1 parent dc4edf2 commit 75553e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adafruit_fingerprint.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"""
2727
try:
2828
from typing import Tuple, List, Union
29+
from serial import Serial
2930
except ImportError:
3031
pass
3132

@@ -115,7 +116,11 @@ class Adafruit_Fingerprint:
115116
system_id = None
116117
status_register = None
117118

118-
def __init__(self, uart: UART, passwd: Tuple[int, int, int, int] = (0, 0, 0, 0)):
119+
def __init__(
120+
self,
121+
uart: Union[UART, "Serial"],
122+
passwd: Tuple[int, int, int, int] = (0, 0, 0, 0),
123+
):
119124
# Create object with UART for interface, and default 32-bit password
120125
self.password = passwd
121126
self._uart = uart

0 commit comments

Comments
 (0)