Skip to content

Commit

Permalink
Fix GetDeviceID.py.
Browse files Browse the repository at this point in the history
Appears the shape of a device dict has changed since this script was
last updated, i.e., 'type' is now 'deviceType'.

Closes #42.
  • Loading branch information
charlescbeebe committed May 10, 2016
1 parent da8745e commit d8ee071
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions GetDeviceID.py
Expand Up @@ -18,6 +18,16 @@
api.login(user, passwd)
devices = api.get_registered_devices()

# `devices` is a list of dictionaries like this:
# {u'carrier': u'Google',
# u'deviceType': 2,
# u'id': u'0x1111111111111111',
# u'lastAccessedFormatted': u'January 1, 1999',
# u'lastAccessedTimeMillis': 915148800,
# u'lastEventTimeMillis': 915148800,
# u'manufacturer': u'LGE',
# u'model': u'Nexus 5',
# u'name': u''}]
for device in devices:
if device['type'] == 'PHONE':
print "Name:{d[name]}\tid:{d[id]}".format(d=device)
if device['deviceType'] == 2:
print "Device:{d[manufacturer]} {d[model]}\tid:{d[id]}".format(d=device)

0 comments on commit d8ee071

Please sign in to comment.