diff --git a/homeassistant/components/reolink/__init__.py b/homeassistant/components/reolink/__init__.py index 028b2c89311..bb8c9427a9c 100644 --- a/homeassistant/components/reolink/__init__.py +++ b/homeassistant/components/reolink/__init__.py @@ -100,10 +100,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b async with asyncio.timeout(host.api.timeout * (RETRY_ATTEMPTS + 2)): try: return await host.api.check_new_firmware() - except (ReolinkError, asyncio.exceptions.CancelledError) as err: - task = asyncio.current_task() - if task is not None: - task.uncancel() + except ReolinkError as err: if starting: _LOGGER.debug( "Error checking Reolink firmware update at startup " @@ -133,15 +130,16 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b update_interval=FIRMWARE_UPDATE_INTERVAL, ) # Fetch initial data so we have data when entities subscribe - try: - # If camera WAN blocked, firmware check fails, do not prevent setup - await asyncio.gather( - device_coordinator.async_config_entry_first_refresh(), - firmware_coordinator.async_config_entry_first_refresh(), - ) - except ConfigEntryNotReady: + results = await asyncio.gather( + device_coordinator.async_config_entry_first_refresh(), + firmware_coordinator.async_config_entry_first_refresh(), + return_exceptions=True, + ) + # If camera WAN blocked, firmware check fails, do not prevent setup + # so don't check firmware_coordinator exceptions + if isinstance(results[0], BaseException): await host.stop() - raise + raise results[0] hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = ReolinkData( host=host,