Update docstrings

This commit is contained in:
Fabian Affolter 2015-12-15 10:42:05 +01:00
parent a35dcf860e
commit fcdaa923c5

View File

@ -1,16 +1,8 @@
""" """
homeassistant.components.device_tracker.icloud homeassistant.components.device_tracker.icloud
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports scanning iCloud devices. Device tracker platform that supports scanning iCloud devices.
It does require that your device has beend registered with Find My iPhone.
Note: that this may cause battery drainage as it wakes up your device to
get the current location.
Note: You may receive an email from Apple stating that someone has logged
into your account.
For more details about this platform, please refer to the documentation at For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.icloud/ https://home-assistant.io/components/device_tracker.icloud/
""" """
@ -31,9 +23,7 @@ DEFAULT_INTERVAL = 8
def setup_scanner(hass, config, see): def setup_scanner(hass, config, see):
""" """ Set up the iCloud Scanner. """
Set up the iCloud Scanner
"""
from pyicloud import PyiCloudService from pyicloud import PyiCloudService
from pyicloud.exceptions import PyiCloudFailedLoginException from pyicloud.exceptions import PyiCloudFailedLoginException
from pyicloud.exceptions import PyiCloudNoDevicesException from pyicloud.exceptions import PyiCloudNoDevicesException
@ -57,21 +47,17 @@ def setup_scanner(hass, config, see):
return return
def keep_alive(now): def keep_alive(now):
""" """ Keeps authenticating iCloud connection. """
Keeps authenticating icloud connection
"""
api.authenticate() api.authenticate()
_LOGGER.info("Authenticate against iCloud.") _LOGGER.info("Authenticate against iCloud")
track_utc_time_change(hass, keep_alive, second=0) track_utc_time_change(hass, keep_alive, second=0)
def update_icloud(now): def update_icloud(now):
""" """ Authenticate against iCloud and scan for devices. """
Authenticate against iCloud and scan for devices.
"""
try: try:
# The session timeouts if we are not using it so we # The session timeouts if we are not using it so we
# have to re-authenticate. This will send an email. # have to re-authenticate. This will send an email.
api.authenticate() api.authenticate()
# Loop through every device registered with the iCloud account # Loop through every device registered with the iCloud account
for device in api.devices: for device in api.devices: