Fix pylint erros for sharkiq ()

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
homeassistant/components/sharkiq

View file

@ -30,10 +30,10 @@ async def validate_input(hass: core.HomeAssistant, data):
with async_timeout.timeout(10): with async_timeout.timeout(10):
LOGGER.debug("Initialize connection to Ayla networks API") LOGGER.debug("Initialize connection to Ayla networks API")
await ayla_api.async_sign_in() await ayla_api.async_sign_in()
except (asyncio.TimeoutError, aiohttp.ClientError): except (asyncio.TimeoutError, aiohttp.ClientError) as errors:
raise CannotConnect raise CannotConnect from errors
except SharkIqAuthError: except SharkIqAuthError as error:
raise InvalidAuth raise InvalidAuth from error
# Return info that you want to store in the config entry. # Return info that you want to store in the config entry.
return {"title": data[CONF_USERNAME]} 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 except Exception as err: # pylint: disable=broad-except
LOGGER.exception("Unexpected error updating SharkIQ", exc_info=err) LOGGER.exception("Unexpected error updating SharkIQ", exc_info=err)
raise UpdateFailed(err) raise UpdateFailed(err) from err
return True return True