Created
February 10, 2014 15:13
-
-
Save ixs/8917626 to your computer and use it in GitHub Desktop.
Fetch battery charge values from iCloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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