From 8cb8efc8b9601c96a621cbefc4eda43690e4ed28 Mon Sep 17 00:00:00 2001 From: Stefanie Tellex Date: Fri, 29 Oct 2021 21:21:22 -0400 Subject: [PATCH 1/3] freedomlite initial commit --- glucometerutils/drivers/fsfreedomlite.py | 266 +++++++++++++++++++++++ 1 file changed, 266 insertions(+) create mode 100644 glucometerutils/drivers/fsfreedomlite.py diff --git a/glucometerutils/drivers/fsfreedomlite.py b/glucometerutils/drivers/fsfreedomlite.py new file mode 100644 index 0000000..f2a9db8 --- /dev/null +++ b/glucometerutils/drivers/fsfreedomlite.py @@ -0,0 +1,266 @@ +# -*- coding: utf-8 -*- +# +# SPDX-FileCopyrightText: © 2021 Stefanie Tellex +# SPDX-License-Identifier: MIT +"""Driver for FreeStyle Freedom Lite devices. + +Supported features: + - get readings (ignores ketone results); + - use the glucose unit preset on the device by default; + - get and set date and time; + - get serial number and software version. + +Expected device path: /dev/ttyUSB0 or similar serial port device. + +Further information on the device protocol can be found at + +https://protocols.glucometers.tech/abbott/freestyle-optium +""" + +import datetime +import logging +import re +from typing import Generator, NoReturn, Sequence + +from glucometerutils import common, driver, exceptions +from glucometerutils.support import serial + +_CLOCK_RE = re.compile( + r"^Clock:\t(?P[A-Z][a-z]{2}) (?P[0-9]{2}) (?P[0-9]{4})\t" + r"(?P