mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fixed lint errors
This commit is contained in:
parent
90007a04d3
commit
c60bb35d4a
@ -30,7 +30,6 @@ REQUIREMENTS = ['https://github.com/picklepete/pyicloud/archive/'
|
|||||||
'certifi']
|
'certifi']
|
||||||
|
|
||||||
|
|
||||||
#pylint: disable=unused-argument
|
|
||||||
def get_scanner(hass, config):
|
def get_scanner(hass, config):
|
||||||
""" Validates config and returns a iPhone Scanner. """
|
""" Validates config and returns a iPhone Scanner. """
|
||||||
if not validate_config(config,
|
if not validate_config(config,
|
||||||
@ -64,7 +63,9 @@ class ICloudDeviceScanner(object):
|
|||||||
# Get the data from iCloud
|
# Get the data from iCloud
|
||||||
try:
|
try:
|
||||||
_LOGGER.info('Logging into iCloud Services')
|
_LOGGER.info('Logging into iCloud Services')
|
||||||
self._api = PyiCloudService(self.username, self.password, verify=True)
|
self._api = PyiCloudService(self.username,
|
||||||
|
self.password,
|
||||||
|
verify=True)
|
||||||
except PyiCloudFailedLoginException:
|
except PyiCloudFailedLoginException:
|
||||||
_LOGGER.exception("Failed login to iCloud Service." +
|
_LOGGER.exception("Failed login to iCloud Service." +
|
||||||
"Verify Username and Password")
|
"Verify Username and Password")
|
||||||
@ -119,7 +120,9 @@ class ICloudDeviceScanner(object):
|
|||||||
for device in self._api.devices:
|
for device in self._api.devices:
|
||||||
try:
|
try:
|
||||||
devices[device.status()['name']] = {
|
devices[device.status()['name']] = {
|
||||||
'device_id': re.sub(r'(\s*|\W*)', device.status()['name'], ''),
|
'device_id': re.sub(r'(\s*|\W*)',
|
||||||
|
device.status()['name'],
|
||||||
|
''),
|
||||||
'host_name': device.status()['name'],
|
'host_name': device.status()['name'],
|
||||||
'gps': (device.location()['latitude'],
|
'gps': (device.location()['latitude'],
|
||||||
device.location()['longitude']),
|
device.location()['longitude']),
|
||||||
@ -128,4 +131,4 @@ class ICloudDeviceScanner(object):
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
# Device is not tracked.
|
# Device is not tracked.
|
||||||
continue
|
continue
|
||||||
return devices
|
return devices
|
||||||
|
Loading…
x
Reference in New Issue
Block a user