diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-12-12 22:29:59 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-12-12 22:29:59 +0100 |
commit | 25d8e64a0676b78c42a210846b31d0279664e112 (patch) | |
tree | cdf56cacc88689302db8ce573f31ff61fbab6aba /glucometerutils/support/hiddevice.py | |
parent | Fix indentation of common.py. (diff) | |
download | glucometerutils-25d8e64a0676b78c42a210846b31d0279664e112.tar glucometerutils-25d8e64a0676b78c42a210846b31d0279664e112.tar.gz glucometerutils-25d8e64a0676b78c42a210846b31d0279664e112.tar.bz2 glucometerutils-25d8e64a0676b78c42a210846b31d0279664e112.tar.lz glucometerutils-25d8e64a0676b78c42a210846b31d0279664e112.tar.xz glucometerutils-25d8e64a0676b78c42a210846b31d0279664e112.tar.zst glucometerutils-25d8e64a0676b78c42a210846b31d0279664e112.zip |
Diffstat (limited to 'glucometerutils/support/hiddevice.py')
-rw-r--r-- | glucometerutils/support/hiddevice.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/glucometerutils/support/hiddevice.py b/glucometerutils/support/hiddevice.py index 07596c2..585882e 100644 --- a/glucometerutils/support/hiddevice.py +++ b/glucometerutils/support/hiddevice.py @@ -10,7 +10,7 @@ import logging import os try: - from typing import Optional + from typing import Optional, Text except: pass @@ -48,6 +48,7 @@ class HidDevice(object): TIMEOUT_MS = None # type: Optional[int] def __init__(self, device): + # type: (Optional[Text]) -> None if None in (self.USB_VENDOR_ID, self.USB_PRODUCT_ID) and not device: raise exceptions.CommandLineError( '--device parameter is required, should point to a /dev/hidraw ' @@ -79,12 +80,14 @@ class HidDevice(object): message='Unable to connect to meter: %s.' % e) def _write(self, report): + # type: (bytes) -> None """Writes a report to the HID handle.""" if self.handle_.write(report) < 0: raise exceptions.CommandError() def _read(self, size=64): + # type: (int) -> bytes """Read a report from the HID handle. This is important as it handles the one incompatible interface between |