From 7ceeddc76323e921f06e707717090d88df9e915f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sun, 15 Jan 2017 13:10:23 +0000 Subject: Wrap the meter information to a namedtuple, instead of a string. This matches the gdef MeterInfo message, and produces a similar (though not identical) string as before. Importantly, it allows providing semantic information. --- glucometer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'glucometer.py') diff --git a/glucometer.py b/glucometer.py index e22ff23..1cb263d 100755 --- a/glucometer.py +++ b/glucometer.py @@ -57,7 +57,11 @@ def main(): try: if args.action == 'info': - print(device.get_information_string()) + print(str(device.get_meter_info()).strip()) + try: + print('Time: %s' % device.get_datetime()) + except NotImplementedError: + print('Time: N/A') elif args.action == 'dump': unit = args.unit if unit is None: -- cgit v1.2.3