mirror of https://github.com/home-assistant/core
Raise exception when data can't be fetched in Opensky (#103596)
This commit is contained in:
parent
0fcaa2c581
commit
6276c4483c
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from aiohttp import BasicAuth
|
from aiohttp import BasicAuth
|
||||||
from python_opensky import OpenSky
|
from python_opensky import OpenSky
|
||||||
from python_opensky.exceptions import OpenSkyUnauthenticatedError
|
from python_opensky.exceptions import OpenSkyError
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
|
@ -28,7 +28,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
),
|
),
|
||||||
contributing_user=entry.options.get(CONF_CONTRIBUTING_USER, False),
|
contributing_user=entry.options.get(CONF_CONTRIBUTING_USER, False),
|
||||||
)
|
)
|
||||||
except OpenSkyUnauthenticatedError as exc:
|
except OpenSkyError as exc:
|
||||||
raise ConfigEntryNotReady from exc
|
raise ConfigEntryNotReady from exc
|
||||||
|
|
||||||
coordinator = OpenSkyDataUpdateCoordinator(hass, client)
|
coordinator = OpenSkyDataUpdateCoordinator(hass, client)
|
||||||
|
|
Loading…
Reference in New Issue