Fix pylint erros for sharkiq (#39428)

This commit is contained in:
springstan 2020-08-30 16:51:50 +02:00 committed by GitHub
parent 4a21b1f589
commit 70c241b51b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -30,10 +30,10 @@ async def validate_input(hass: core.HomeAssistant, data):
with async_timeout.timeout(10):
LOGGER.debug("Initialize connection to Ayla networks API")
await ayla_api.async_sign_in()
except (asyncio.TimeoutError, aiohttp.ClientError):
raise CannotConnect
except SharkIqAuthError:
raise InvalidAuth
except (asyncio.TimeoutError, aiohttp.ClientError) as errors:
raise CannotConnect from errors
except SharkIqAuthError as error:
raise InvalidAuth from error
# Return info that you want to store in the config entry.
return {"title": data[CONF_USERNAME]}

View file

@ -94,9 +94,9 @@ class SharkIqUpdateCoordinator(DataUpdateCoordinator):
)
)
raise UpdateFailed(err)
raise UpdateFailed(err) from err
except Exception as err: # pylint: disable=broad-except
LOGGER.exception("Unexpected error updating SharkIQ", exc_info=err)
raise UpdateFailed(err)
raise UpdateFailed(err) from err
return True