From 75553e709828709863ce7b2802290d5c653af297 Mon Sep 17 00:00:00 2001 From: Asadullah Shaikh Date: Sun, 6 Apr 2025 13:29:36 +0530 Subject: [PATCH] add `serial.Serial` as a valid type for `uart` parameter of `Adafruit_Fingerprint.__init__` --- adafruit_fingerprint.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/adafruit_fingerprint.py b/adafruit_fingerprint.py index 7236ff0..8951327 100644 --- a/adafruit_fingerprint.py +++ b/adafruit_fingerprint.py @@ -26,6 +26,7 @@ """ try: from typing import Tuple, List, Union + from serial import Serial except ImportError: pass @@ -115,7 +116,11 @@ class Adafruit_Fingerprint: system_id = None status_register = None - def __init__(self, uart: UART, passwd: Tuple[int, int, int, int] = (0, 0, 0, 0)): + def __init__( + self, + uart: Union[UART, "Serial"], + passwd: Tuple[int, int, int, int] = (0, 0, 0, 0), + ): # Create object with UART for interface, and default 32-bit password self.password = passwd self._uart = uart