Handle error fetching available account link services (#35485)
This commit is contained in:
parent
f4ab5ee54f
commit
c401949af8
2 changed files with 17 additions and 1 deletions
|
@ -3,6 +3,7 @@ import asyncio
|
|||
import logging
|
||||
from typing import Any
|
||||
|
||||
import aiohttp
|
||||
from hass_nabucasa import account_link
|
||||
|
||||
from homeassistant.const import MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION
|
||||
|
@ -73,7 +74,10 @@ async def _get_services(hass):
|
|||
if services is not None:
|
||||
return services
|
||||
|
||||
services = await account_link.async_fetch_available_services(hass.data[DOMAIN])
|
||||
try:
|
||||
services = await account_link.async_fetch_available_services(hass.data[DOMAIN])
|
||||
except (aiohttp.ClientError, asyncio.TimeoutError):
|
||||
return []
|
||||
|
||||
hass.data[DATA_SERVICES] = services
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue