Skip to content
Permalink
Browse files

Added catch for invalid credentials

  • Loading branch information...
bachya committed Jul 3, 2019
1 parent ccc74de commit 37a796ddf83b54800bd95b7f279d0dda87e0a9dc
@@ -93,7 +93,7 @@
async def async_setup_entry(hass, config_entry):
"""Set up Notion as a config entry."""
from aionotion import async_get_client
from aionotion.errors import NotionError
from aionotion.errors import InvalidCredentialsError, NotionError

session = aiohttp_client.async_get_clientsession(hass)

@@ -102,6 +102,9 @@
config_entry.data[CONF_USERNAME],
config_entry.data[CONF_PASSWORD],
session)
except InvalidCredentialsError:
_LOGGER.error('Invalid username and/or password')
return
except NotionError as err:
_LOGGER.error('Config entry failed: %s', err)
raise ConfigEntryNotReady
@@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/components/notion",
"requirements": [
"aionotion==1.0.0"
"aionotion==1.1.0"
],
"dependencies": [],
"codeowners": [
@@ -157,7 +157,7 @@ aiolifx==0.6.7
aiolifx_effects==0.2.2

# homeassistant.components.notion
aionotion==1.0.0
aionotion==1.1.0

# homeassistant.components.hunterdouglas_powerview
aiopvapi==1.6.14
@@ -58,7 +58,7 @@ aiohttp_cors==0.7.0
aiohue==1.9.1

# homeassistant.components.notion
aionotion==1.0.0
aionotion==1.1.0

# homeassistant.components.switcher_kis
aioswitcher==2019.4.26

0 comments on commit 37a796d

Please sign in to comment.
You can’t perform that action at this time.