Fix onvif snapshot fallback (#79394)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>pull/79642/head
parent
a0ba102492
commit
ebb213eb14
|
@ -142,16 +142,21 @@ class ONVIFCameraEntity(ONVIFBaseEntity, Camera):
|
|||
|
||||
if self.device.capabilities.snapshot:
|
||||
try:
|
||||
image = await self.device.device.get_snapshot(
|
||||
if image := await self.device.device.get_snapshot(
|
||||
self.profile.token, self._basic_auth
|
||||
)
|
||||
return image
|
||||
):
|
||||
return image
|
||||
except ONVIFError as err:
|
||||
LOGGER.error(
|
||||
"Fetch snapshot image failed from %s, falling back to FFmpeg; %s",
|
||||
self.device.name,
|
||||
err,
|
||||
)
|
||||
else:
|
||||
LOGGER.error(
|
||||
"Fetch snapshot image failed from %s, falling back to FFmpeg",
|
||||
self.device.name,
|
||||
)
|
||||
|
||||
assert self._stream_uri
|
||||
return await ffmpeg.async_get_image(
|
||||
|
|
Loading…
Reference in New Issue