summaryrefslogtreecommitdiffstats
path: root/glucometer.py
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2013-08-03 11:02:15 +0200
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2013-08-03 11:02:15 +0200
commit90e8273a7b055b8afea389bc1173a79e44910cad (patch)
tree8a67ae87ba21bec660d04f1634463cf5af27756d /glucometer.py
parentglucometer: fix script to actually work and provide actions. (diff)
downloadglucometerutils-90e8273a7b055b8afea389bc1173a79e44910cad.tar
glucometerutils-90e8273a7b055b8afea389bc1173a79e44910cad.tar.gz
glucometerutils-90e8273a7b055b8afea389bc1173a79e44910cad.tar.bz2
glucometerutils-90e8273a7b055b8afea389bc1173a79e44910cad.tar.lz
glucometerutils-90e8273a7b055b8afea389bc1173a79e44910cad.tar.xz
glucometerutils-90e8273a7b055b8afea389bc1173a79e44910cad.tar.zst
glucometerutils-90e8273a7b055b8afea389bc1173a79e44910cad.zip
Diffstat (limited to 'glucometer.py')
-rw-r--r--glucometer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/glucometer.py b/glucometer.py
index a288dae..db00417 100644
--- a/glucometer.py
+++ b/glucometer.py
@@ -26,6 +26,9 @@ def main(argv=sys.argv):
parser_dump = subparsers.add_parser(
'dump', help='Dump the readings stored in the device.')
+ parser_dump.add_argument(
+ '--unit', action='store', choices=common.VALID_UNITS,
+ help='Select the unit to use for the dumped data.')
parser_date = subparsers.add_parser(
'datetime', help='Reads or sets the date and time of the glucometer.')
@@ -39,7 +42,7 @@ def main(argv=sys.argv):
device = driver.Device(args.device)
if args.action == 'dump':
- for reading in device.GetReadings():
+ for reading in device.GetReadings(args.unit):
print('%s,%f' % reading)
elif args.action == 'datetime':
if args.set: