mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Fix onvif snapshot fallback (#79394)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
f1f01429f4
commit
82af726e21
@ -142,16 +142,21 @@ class ONVIFCameraEntity(ONVIFBaseEntity, Camera):
|
|||||||
|
|
||||||
if self.device.capabilities.snapshot:
|
if self.device.capabilities.snapshot:
|
||||||
try:
|
try:
|
||||||
image = await self.device.device.get_snapshot(
|
if image := await self.device.device.get_snapshot(
|
||||||
self.profile.token, self._basic_auth
|
self.profile.token, self._basic_auth
|
||||||
)
|
):
|
||||||
return image
|
return image
|
||||||
except ONVIFError as err:
|
except ONVIFError as err:
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"Fetch snapshot image failed from %s, falling back to FFmpeg; %s",
|
"Fetch snapshot image failed from %s, falling back to FFmpeg; %s",
|
||||||
self.device.name,
|
self.device.name,
|
||||||
err,
|
err,
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
LOGGER.error(
|
||||||
|
"Fetch snapshot image failed from %s, falling back to FFmpeg",
|
||||||
|
self.device.name,
|
||||||
|
)
|
||||||
|
|
||||||
assert self._stream_uri
|
assert self._stream_uri
|
||||||
return await ffmpeg.async_get_image(
|
return await ffmpeg.async_get_image(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user