From 42789db18bb89f350c940cef3daca74d45af19e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Wed, 11 Dec 2013 19:36:44 +0000 Subject: glucometer.py: if no unit is provided on command line, use the default of the meter. --- glucometer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glucometer.py b/glucometer.py index 33fda46..6ca2cf3 100755 --- a/glucometer.py +++ b/glucometer.py @@ -54,9 +54,13 @@ def main(): if args.action == 'info': print(device.get_information_string()) elif args.action == 'dump': + unit = args.unit + if unit is None: + unit = device.get_glucose_unit() + for reading in device.get_readings(): print('"%s","%.2f","%s","%s"' % ( - reading.timestamp, reading.get_value_as(args.unit), + reading.timestamp, reading.get_value_as(unit), reading.meal, reading.comment)) elif args.action == 'datetime': if args.set == 'now': -- cgit v1.2.3