summaryrefslogtreecommitdiffstats
path: root/glucometer.py
diff options
context:
space:
mode:
Diffstat (limited to 'glucometer.py')
-rwxr-xr-xglucometer.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/glucometer.py b/glucometer.py
index 1131042..e22ff23 100755
--- a/glucometer.py
+++ b/glucometer.py
@@ -53,6 +53,8 @@ def main():
driver = importlib.import_module('glucometerutils.drivers.' + args.driver)
device = driver.Device(args.device)
+ device.connect()
+
try:
if args.action == 'info':
print(device.get_information_string())
@@ -95,5 +97,7 @@ def main():
print('Error while executing \'%s\': %s' % (args.action, str(err)))
return 1
+ device.disconnect()
+
if __name__ == "__main__":
main()