Fix pylint erros for sharkiq (#39428)

This commit is contained in:
springstan authored and GitHub committed 2020-08-30 09:51:50 -05:00
1 parent 4a21b1f589
commit 70c241b51b
2 files changed
+6 -6

No files matched your search

@@ -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]}
@@ -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