Skip to content

Commit

Permalink
Retry onvif setup when it is unexpectedly cancelled
Browse files Browse the repository at this point in the history
fixes #92308
  • Loading branch information
bdraco committed Apr 30, 2023
1 parent 1a92568 commit e0ae543
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions homeassistant/components/onvif/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
f"Could not setup camera {device.device.host}:{device.device.port}: {err}"
) from err
except asyncio.CancelledError as err:
# After https://github.com/agronholm/anyio/issues/374 is resolved
# this may be able to be removed
await device.device.close()
raise ConfigEntryNotReady(f"Setup was unexpectedly canceled: {err}") from err

Expand Down

0 comments on commit e0ae543

Please sign in to comment.