Skip to content

Instantly share code, notes, and snippets.

@ixs
Created February 10, 2014 15:13
Show Gist options
  • Save ixs/8917626 to your computer and use it in GitHub Desktop.
Save ixs/8917626 to your computer and use it in GitHub Desktop.
Fetch battery charge values from iCloud
#!/usr/bin/python
from pyicloud import PyiCloudService
api = PyiCloudService('user', 'password')
for dev in api.devices:
print "%-20s %-15s %3i%%" % (dev.content["deviceDisplayName"], dev.content["batteryStatus"], dev.content["batteryLevel"] * 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment