From 032b8cda9ee824abc8bbd1d31b32de75debcb1fa Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Tue, 17 Sep 2019 01:17:52 +0200 Subject: [PATCH] Output objects when using device xml. --- get_updates.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/get_updates.py b/get_updates.py index 3f5a53f..fba1fc7 100644 --- a/get_updates.py +++ b/get_updates.py @@ -64,9 +64,18 @@ if opts.devicexml: with open(opts.devicexml, "rt") as f: device_xml = f.read() print("Querying Garmin Express ...", end="", flush=True) - result = us.get_unit_updates(device_xml) + reply = us.get_unit_updates(device_xml) print(" done.") - print(result) + + results = [] + if reply: + for i in range(0, len(reply.update_info)): + ui = reply.update_info[i] + r = updateserver.UpdateInfo() + r.fill_from_protobuf(ui) + results.append(r) + + print(results) sys.exit(0) # If no GarminDevice.xml read from file, continue here