summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.com>2019-03-31 01:11:33 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.com>2019-03-31 01:11:33 +0100
commit7fdc40613d01823746513e430db3f0018b63b145 (patch)
treeb283590bc87ffd2e3d466085e4dc43e3e72136c9
parentReplace epydoc metadata with SPDX identifiers. (diff)
downloadglucometerutils-7fdc40613d01823746513e430db3f0018b63b145.tar
glucometerutils-7fdc40613d01823746513e430db3f0018b63b145.tar.gz
glucometerutils-7fdc40613d01823746513e430db3f0018b63b145.tar.bz2
glucometerutils-7fdc40613d01823746513e430db3f0018b63b145.tar.lz
glucometerutils-7fdc40613d01823746513e430db3f0018b63b145.tar.xz
glucometerutils-7fdc40613d01823746513e430db3f0018b63b145.tar.zst
glucometerutils-7fdc40613d01823746513e430db3f0018b63b145.zip
-rw-r--r--glucometerutils/drivers/fslibre.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/glucometerutils/drivers/fslibre.py b/glucometerutils/drivers/fslibre.py
index f8e3117..ecf6dd6 100644
--- a/glucometerutils/drivers/fslibre.py
+++ b/glucometerutils/drivers/fslibre.py
@@ -93,8 +93,15 @@ def _extract_timestamp(parsed_record):
def _convert_ketone_unit(raw_value):
- """Convert raw ketone value as read in the device to its value in mmol/L."""
- return int((raw_value + 1) / 2.) / 10.
+ """Convert raw ketone value as read in the device to its value in mmol/L.
+
+ As per
+ https://flameeyes.github.io/glucometer-protocols/abbott/freestyle-libre.html
+ this is actually not using any mg/dL→mmol/L conversion, but rather the same
+ as the meter uses for blood glucose.
+
+ """
+ return raw_value // 18
def _parse_arresult(record):