summaryrefslogtreecommitdiffstats
path: root/glucometerutils/support/freestyle.py
diff options
context:
space:
mode:
Diffstat (limited to 'glucometerutils/support/freestyle.py')
-rw-r--r--glucometerutils/support/freestyle.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py
index 816af81..d18a81f 100644
--- a/glucometerutils/support/freestyle.py
+++ b/glucometerutils/support/freestyle.py
@@ -64,6 +64,16 @@ def _verify_checksum(message, expected_checksum_hex):
if expected_checksum != calculated_checksum:
raise exceptions.InvalidChecksum(expected_checksum, calculated_checksum)
+def convert_ketone_unit(raw_value):
+ """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.0
class FreeStyleHidDevice(hiddevice.HidDevice):
"""Base class implementing the FreeStyle HID common protocol.