diff options
author | Leonard Lausen <leonard@lausen.nl> | 2017-10-02 02:55:28 +0200 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2017-10-02 10:00:08 +0200 |
commit | ed1cbf4c6fde93c0b8d2cf4f492b3be52cade093 (patch) | |
tree | 9721bc7aae7e9e58d82a6a9b6bb375baea54df40 | |
parent | Fix ketone reading (diff) | |
download | glucometerutils-ed1cbf4c6fde93c0b8d2cf4f492b3be52cade093.tar glucometerutils-ed1cbf4c6fde93c0b8d2cf4f492b3be52cade093.tar.gz glucometerutils-ed1cbf4c6fde93c0b8d2cf4f492b3be52cade093.tar.bz2 glucometerutils-ed1cbf4c6fde93c0b8d2cf4f492b3be52cade093.tar.lz glucometerutils-ed1cbf4c6fde93c0b8d2cf4f492b3be52cade093.tar.xz glucometerutils-ed1cbf4c6fde93c0b8d2cf4f492b3be52cade093.tar.zst glucometerutils-ed1cbf4c6fde93c0b8d2cf4f492b3be52cade093.zip |
-rwxr-xr-x | glucometer.py | 2 | ||||
-rw-r--r-- | glucometerutils/drivers/fsprecisionneo.py | 3 | ||||
-rw-r--r-- | glucometerutils/support/hiddevice.py | 4 | ||||
-rw-r--r-- | glucometerutils/support/serial.py | 4 |
4 files changed, 4 insertions, 9 deletions
diff --git a/glucometer.py b/glucometer.py index 827cf2d..88c44b4 100755 --- a/glucometer.py +++ b/glucometer.py @@ -82,7 +82,7 @@ def main(): print(inspect.getdoc(driver)) return 0 - device = driver.Device(args.device, args.with_ketone) + device = driver.Device(args.device) device.connect() device_info = device.get_meter_info() diff --git a/glucometerutils/drivers/fsprecisionneo.py b/glucometerutils/drivers/fsprecisionneo.py index e1c2082..6fd07c2 100644 --- a/glucometerutils/drivers/fsprecisionneo.py +++ b/glucometerutils/drivers/fsprecisionneo.py @@ -74,8 +74,7 @@ class Device(freestyle.FreeStyleHidDevice): cls = None if record and record[0] == _TYPE_GLUCOSE_READING: cls = common.GlucoseReading - elif self.with_ketone and record or (record and record[0] == - _TYPE_KETONE_READING): + elif record and record[0] == _TYPE_KETONE_READING: cls = common.KetoneReading else: continue diff --git a/glucometerutils/support/hiddevice.py b/glucometerutils/support/hiddevice.py index 0ffa028..86203ba 100644 --- a/glucometerutils/support/hiddevice.py +++ b/glucometerutils/support/hiddevice.py @@ -42,7 +42,7 @@ class HidDevice(object): TIMEOUT_MS = None - def __init__(self, device, with_ketone=False): + def __init__(self, device): 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 ' @@ -54,8 +54,6 @@ class HidDevice(object): raise exceptions.ConnectionFailed( message='Path %s does not exist.' % device) - self.with_ketone = with_ketone - # If the user passed a device, try opening it. if device: self.handle_ = open(device, 'w+b') diff --git a/glucometerutils/support/serial.py b/glucometerutils/support/serial.py index 6f8b486..d4f352b 100644 --- a/glucometerutils/support/serial.py +++ b/glucometerutils/support/serial.py @@ -45,11 +45,9 @@ class SerialDevice(object): TIMEOUT = 1 - def __init__(self, device, with_ketone=False): + def __init__(self, device): assert self.BAUDRATE is not None - self.with_ketone = with_ketone - if not device and self.DEFAULT_CABLE_ID: logging.info( 'No --device parameter provided, looking for default cable.') |