From 7b9585cd8e507a0824405bf51a02a8dd84d8a6fc Mon Sep 17 00:00:00 2001 From: Minims Date: Fri, 10 Apr 2020 17:44:56 +0200 Subject: [PATCH] Fix Onvif Camera that does not have SnapshotUri such as Sricam (#33902) --- homeassistant/components/onvif/camera.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/onvif/camera.py b/homeassistant/components/onvif/camera.py index 87c96e38c32..51ea3fab0cc 100644 --- a/homeassistant/components/onvif/camera.py +++ b/homeassistant/components/onvif/camera.py @@ -411,8 +411,11 @@ class ONVIFHassCamera(Camera): req = media_service.create_type("GetSnapshotUri") req.ProfileToken = profiles[self._profile_index].token - snapshot_uri = await media_service.GetSnapshotUri(req) - self._snapshot = snapshot_uri.Uri + try: + snapshot_uri = await media_service.GetSnapshotUri(req) + self._snapshot = snapshot_uri.Uri + except ServerDisconnectedError as err: + _LOGGER.debug("Camera does not support GetSnapshotUri: %s", err) _LOGGER.debug( "ONVIF Camera Using the following URL for %s snapshot: %s",