diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2013-12-11 20:36:44 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2013-12-11 20:36:44 +0100 |
commit | 42789db18bb89f350c940cef3daca74d45af19e5 (patch) | |
tree | 9939dd84643009de8a45ca7b6c5d34acdc822e93 | |
parent | Generalise the meal/comment handling to the Reading object. (diff) | |
download | glucometerutils-42789db18bb89f350c940cef3daca74d45af19e5.tar glucometerutils-42789db18bb89f350c940cef3daca74d45af19e5.tar.gz glucometerutils-42789db18bb89f350c940cef3daca74d45af19e5.tar.bz2 glucometerutils-42789db18bb89f350c940cef3daca74d45af19e5.tar.lz glucometerutils-42789db18bb89f350c940cef3daca74d45af19e5.tar.xz glucometerutils-42789db18bb89f350c940cef3daca74d45af19e5.tar.zst glucometerutils-42789db18bb89f350c940cef3daca74d45af19e5.zip |
-rwxr-xr-x | glucometer.py | 6 |
1 files changed, 5 insertions, 1 deletions
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': |