From ab35ceab5a035dec225693485acd2ba2a75a8c18 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 a0bfbab9b4f..6ec06a10988 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",