Stop Tile setup on invalid auth (#45683)

This commit is contained in:
Aaron Bach 2021-01-29 00:57:36 -07:00 committed by GitHub
parent c7db2c35b7
commit 4f3b10d661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -4,7 +4,7 @@ from datetime import timedelta
from functools import partial from functools import partial
from pytile import async_login from pytile import async_login
from pytile.errors import SessionExpiredError, TileError from pytile.errors import InvalidAuthError, SessionExpiredError, TileError
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.exceptions import ConfigEntryNotReady
@ -43,6 +43,9 @@ async def async_setup_entry(hass, entry):
session=websession, session=websession,
) )
hass.data[DOMAIN][DATA_TILE][entry.entry_id] = await client.async_get_tiles() hass.data[DOMAIN][DATA_TILE][entry.entry_id] = await client.async_get_tiles()
except InvalidAuthError:
LOGGER.error("Invalid credentials provided")
return False
except TileError as err: except TileError as err:
raise ConfigEntryNotReady("Error during integration setup") from err raise ConfigEntryNotReady("Error during integration setup") from err

View File

@ -3,6 +3,6 @@
"name": "Tile", "name": "Tile",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/tile", "documentation": "https://www.home-assistant.io/integrations/tile",
"requirements": ["pytile==5.1.0"], "requirements": ["pytile==5.2.0"],
"codeowners": ["@bachya"] "codeowners": ["@bachya"]
} }

View File

@ -1849,7 +1849,7 @@ python_opendata_transport==0.2.1
pythonegardia==1.0.40 pythonegardia==1.0.40
# homeassistant.components.tile # homeassistant.components.tile
pytile==5.1.0 pytile==5.2.0
# homeassistant.components.touchline # homeassistant.components.touchline
pytouchline==0.7 pytouchline==0.7

View File

@ -929,7 +929,7 @@ python-velbus==2.1.2
python_awair==0.2.1 python_awair==0.2.1
# homeassistant.components.tile # homeassistant.components.tile
pytile==5.1.0 pytile==5.2.0
# homeassistant.components.traccar # homeassistant.components.traccar
pytraccar==0.9.0 pytraccar==0.9.0