summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.com>2022-12-17 15:30:40 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-12-17 15:39:51 +0100
commit8ae066ea8b6bcc21a2e47f0be4440e78f4055980 (patch)
treef6ad895d625e4921a0333efe752a4c62cfd1f340
parentpre-commit autoupdate (diff)
downloadglucometerutils-8ae066ea8b6bcc21a2e47f0be4440e78f4055980.tar
glucometerutils-8ae066ea8b6bcc21a2e47f0be4440e78f4055980.tar.gz
glucometerutils-8ae066ea8b6bcc21a2e47f0be4440e78f4055980.tar.bz2
glucometerutils-8ae066ea8b6bcc21a2e47f0be4440e78f4055980.tar.lz
glucometerutils-8ae066ea8b6bcc21a2e47f0be4440e78f4055980.tar.xz
glucometerutils-8ae066ea8b6bcc21a2e47f0be4440e78f4055980.tar.zst
glucometerutils-8ae066ea8b6bcc21a2e47f0be4440e78f4055980.zip
-rw-r--r--glucometerutils/support/hiddevice.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/glucometerutils/support/hiddevice.py b/glucometerutils/support/hiddevice.py
index e9a5d01..bd35a8f 100644
--- a/glucometerutils/support/hiddevice.py
+++ b/glucometerutils/support/hiddevice.py
@@ -19,6 +19,8 @@ class HidSession:
methods abstracting the HID library.
"""
+ handle_: Optional[BinaryIO]
+
def __init__(
self,
usb_id: Optional[Tuple[int, int]],
@@ -51,7 +53,7 @@ class HidSession:
# If the user passed a device, try opening it.
if device:
- self.handle_ = open(device, "w+b") # type: Optional[BinaryIO]
+ self.handle_ = open(device, "w+b")
else:
self.handle_ = None
logging.info("No --device parameter provided, using hidapi library.")