summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Martin <s.martin49@gmail.com>2017-09-23 11:47:33 +0200
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2017-09-25 16:12:06 +0200
commitd8310057c9b618196f61e5f1e61806b54c59fbfe (patch)
tree5fb5a255c3954c6b64291181f487839a6e6cefb1
parentfsprecisionneo: add ketone reading support (diff)
downloadglucometerutils-d8310057c9b618196f61e5f1e61806b54c59fbfe.tar
glucometerutils-d8310057c9b618196f61e5f1e61806b54c59fbfe.tar.gz
glucometerutils-d8310057c9b618196f61e5f1e61806b54c59fbfe.tar.bz2
glucometerutils-d8310057c9b618196f61e5f1e61806b54c59fbfe.tar.lz
glucometerutils-d8310057c9b618196f61e5f1e61806b54c59fbfe.tar.xz
glucometerutils-d8310057c9b618196f61e5f1e61806b54c59fbfe.tar.zst
glucometerutils-d8310057c9b618196f61e5f1e61806b54c59fbfe.zip
-rwxr-xr-xglucometer.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/glucometer.py b/glucometer.py
index 385653c..88c44b4 100755
--- a/glucometer.py
+++ b/glucometer.py
@@ -54,6 +54,9 @@ def main():
'--sort-by', action='store', default='timestamp',
choices=common._ReadingBase._fields,
help='Field to order the dumped data by.')
+ parser_dump.add_argument(
+ '--with-ketone', action='store_true', default=False,
+ help='Enable ketone reading if available on the glucometer.')
parser_date = subparsers.add_parser(
'datetime', help='Reads or sets the date and time of the glucometer.')
@@ -99,6 +102,10 @@ def main():
readings = device.get_readings()
+ if not args.with_ketone:
+ readings = (reading for reading in readings
+ if not isinstance(reading, common.KetoneReading))
+
if args.sort_by is not None:
readings = sorted(
readings, key=lambda reading: getattr(reading, args.sort_by))