summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Martin <s.martin49@gmail.com>2017-09-23 11:27:52 +0200
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2017-09-25 16:12:06 +0200
commit43ad03892a948823435fd0d5a76f1a3e050c2fd9 (patch)
tree4fc53b5a0b8ee7dddd20258c899975fc73349cc4
parentcommon: introduce the KetoneReading class (diff)
downloadglucometerutils-43ad03892a948823435fd0d5a76f1a3e050c2fd9.tar
glucometerutils-43ad03892a948823435fd0d5a76f1a3e050c2fd9.tar.gz
glucometerutils-43ad03892a948823435fd0d5a76f1a3e050c2fd9.tar.bz2
glucometerutils-43ad03892a948823435fd0d5a76f1a3e050c2fd9.tar.lz
glucometerutils-43ad03892a948823435fd0d5a76f1a3e050c2fd9.tar.xz
glucometerutils-43ad03892a948823435fd0d5a76f1a3e050c2fd9.tar.zst
glucometerutils-43ad03892a948823435fd0d5a76f1a3e050c2fd9.zip
-rw-r--r--glucometerutils/drivers/fslibre.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/glucometerutils/drivers/fslibre.py b/glucometerutils/drivers/fslibre.py
index c8b8c5e..c4c5365 100644
--- a/glucometerutils/drivers/fslibre.py
+++ b/glucometerutils/drivers/fslibre.py
@@ -113,11 +113,14 @@ def _parse_arresult(record):
return None
comment_parts = []
+ measure_method = None
if parsed_record['reading-type'] == 2:
comment_parts.append('(Scan)')
+ measure_method = common.CGM
elif parsed_record['reading-type'] == 0:
comment_parts.append('(Blood)')
+ measure_method = common.BLOOD_SAMPLE
else:
# ketone reading
return None
@@ -161,7 +164,8 @@ def _parse_arresult(record):
return common.GlucoseReading(
_extract_timestamp(parsed_record),
parsed_record['value'],
- comment='; '.join(comment_parts))
+ comment='; '.join(comment_parts),
+ measure_method=measure_method)
class Device(freestyle.FreeStyleHidDevice):
"""Glucometer driver for FreeStyle Libre devices."""
@@ -201,7 +205,8 @@ class Device(freestyle.FreeStyleHidDevice):
yield common.GlucoseReading(
_extract_timestamp(parsed_record),
parsed_record['value'],
- comment='(Sensor)')
+ comment='(Sensor)',
+ measure_method=common.CGM)
# Then get the results of explicit scans and blood tests (and other
# events).