summaryrefslogtreecommitdiffstats
path: root/glucometer.py
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2013-12-08 00:25:12 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2013-12-08 00:25:12 +0100
commitd00330fdf0cd12e71aaff53783c6f1b302840dc3 (patch)
tree180c9d361fc7e31dd765c4d7d6c37dde8e80cfdb /glucometer.py
parentotultra2: implement decoding of meal and comment codes. (diff)
downloadglucometerutils-d00330fdf0cd12e71aaff53783c6f1b302840dc3.tar
glucometerutils-d00330fdf0cd12e71aaff53783c6f1b302840dc3.tar.gz
glucometerutils-d00330fdf0cd12e71aaff53783c6f1b302840dc3.tar.bz2
glucometerutils-d00330fdf0cd12e71aaff53783c6f1b302840dc3.tar.lz
glucometerutils-d00330fdf0cd12e71aaff53783c6f1b302840dc3.tar.xz
glucometerutils-d00330fdf0cd12e71aaff53783c6f1b302840dc3.tar.zst
glucometerutils-d00330fdf0cd12e71aaff53783c6f1b302840dc3.zip
Diffstat (limited to 'glucometer.py')
-rwxr-xr-xglucometer.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/glucometer.py b/glucometer.py
index 1cd0303..baa21ca 100755
--- a/glucometer.py
+++ b/glucometer.py
@@ -39,6 +39,9 @@ def main():
'--set', action='store', nargs='?', const='now', default=None,
help='Set the date rather than just reading it from the device.')
+ reset = subparsers.add_parser(
+ 'zero', help='Zero out the data log of the meter.')
+
args = parser.parse_args()
driver = importlib.import_module('glucometerutils.drivers.' + args.driver)
@@ -58,6 +61,12 @@ def main():
print('%s: not a valid date' % args.set, file=sys.stderr)
else:
print(device.get_datetime())
+ elif args.action == 'zero':
+ try:
+ device.zero_log()
+ print('Device data log zeroed.')
+ except Exception as e:
+ print('Error while zeroing device log: %s' % e)
else:
return 1