Prevent IQVIA from blocking other integrations' startup (#60001)

This commit is contained in:
Aaron Bach 2021-11-19 14:01:26 -07:00 committed by GitHub
parent dedc4a8285
commit 8f6796f428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View File

@ -51,6 +51,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
websession = aiohttp_client.async_get_clientsession(hass)
client = Client(entry.data[CONF_ZIP_CODE], session=websession)
# We disable the client's request retry abilities here to avoid a lengthy (and
# blocking) startup:
client.disable_request_retries()
async def async_get_data_from_api(
api_coro: Callable[..., Awaitable]
) -> dict[str, Any]:
@ -90,6 +94,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# API calls fail:
raise ConfigEntryNotReady()
# Once we've successfully authenticated, we re-enable client request retries:
client.enable_request_retries()
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = coordinators

View File

@ -3,7 +3,7 @@
"name": "IQVIA",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/iqvia",
"requirements": ["numpy==1.21.4", "pyiqvia==1.1.0"],
"requirements": ["numpy==1.21.4", "pyiqvia==2021.11.0"],
"codeowners": ["@bachya"],
"iot_class": "cloud_polling"
}

View File

@ -1556,7 +1556,7 @@ pyipma==2.0.5
pyipp==0.11.0
# homeassistant.components.iqvia
pyiqvia==1.1.0
pyiqvia==2021.11.0
# homeassistant.components.irish_rail_transport
pyirishrail==0.0.2

View File

@ -944,7 +944,7 @@ pyipma==2.0.5
pyipp==0.11.0
# homeassistant.components.iqvia
pyiqvia==1.1.0
pyiqvia==2021.11.0
# homeassistant.components.isy994
pyisy==3.0.0