mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 20:25:07 +02:00
Fix onvif snapshot fallback (#79394)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user