Skip to content

Commit 1fe67b1

Browse files
authored
Merge pull request #57 from pantheraleo-7/main
add `serial.Serial` as a valid type for the `uart` parameter
2 parents fd79daf + 5fa0d6e commit 1fe67b1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

adafruit_fingerprint.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
try:
2929
from typing import List, Tuple, Union
30+
31+
from serial import Serial
3032
except ImportError:
3133
pass
3234

@@ -114,7 +116,11 @@ class Adafruit_Fingerprint:
114116
system_id = None
115117
status_register = None
116118

117-
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+
):
118124
# Create object with UART for interface, and default 32-bit password
119125
self.password = passwd
120126
self._uart = uart

0 commit comments

Comments
 (0)