Reolink trigger ReAuth when credentials invalid during update (#111492)

Check for CredentialsInvalidError
This commit is contained in:
starkillerOG 2024-02-26 20:41:20 +01:00 committed by GitHub
parent 53f0272357
commit 75e59167de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,6 +84,8 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
async with asyncio.timeout(host.api.timeout * (RETRY_ATTEMPTS + 2)): async with asyncio.timeout(host.api.timeout * (RETRY_ATTEMPTS + 2)):
try: try:
await host.update_states() await host.update_states()
except CredentialsInvalidError as err:
raise ConfigEntryAuthFailed(err) from err
except ReolinkError as err: except ReolinkError as err:
raise UpdateFailed(str(err)) from err raise UpdateFailed(str(err)) from err