mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fixing formatting
This commit is contained in:
parent
fff6b24449
commit
8074854731
@ -33,6 +33,9 @@ REQUIREMENTS = ['https://github.com/picklepete/pyicloud/archive/'
|
|||||||
|
|
||||||
|
|
||||||
def setup_scanner(hass, config, see):
|
def setup_scanner(hass, config, see):
|
||||||
|
"""
|
||||||
|
Set up the iCloud Scanner
|
||||||
|
"""
|
||||||
|
|
||||||
# Get the username and password from the configuration
|
# Get the username and password from the configuration
|
||||||
username = config[CONF_USERNAME]
|
username = config[CONF_USERNAME]
|
||||||
@ -45,11 +48,17 @@ def setup_scanner(hass, config, see):
|
|||||||
password,
|
password,
|
||||||
verify=True)
|
verify=True)
|
||||||
except PyiCloudFailedLoginException as e:
|
except PyiCloudFailedLoginException as e:
|
||||||
_LOGGER.exception('Error logging into iCloud Service: {0}'.format(str(e)))
|
_LOGGER.exception(
|
||||||
|
'Error logging into iCloud Service: {0}'.format(str(e))
|
||||||
|
)
|
||||||
|
|
||||||
def update_icloud(now):
|
def update_icloud(now):
|
||||||
|
"""
|
||||||
|
Authenticate against iCloud and scan for devices.
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
# The session timeouts if we are not using it so we have to re-authenticate. This will send an email.
|
# The session timeouts if we are not using it so we
|
||||||
|
# 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:
|
||||||
@ -69,7 +78,7 @@ def setup_scanner(hass, config, see):
|
|||||||
else:
|
else:
|
||||||
# No location found for the device so continue
|
# No location found for the device so continue
|
||||||
continue
|
continue
|
||||||
except PyiCloudNoDevicesException as e:
|
except PyiCloudNoDevicesException:
|
||||||
_LOGGER.exception('No iCloud Devices found!')
|
_LOGGER.exception('No iCloud Devices found!')
|
||||||
|
|
||||||
track_utc_time_change(
|
track_utc_time_change(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user