Check status code on onvif snapshot (#33865)
This commit is contained in:
parent
21dfee831f
commit
1adb45f74e
1 changed files with 2 additions and 1 deletions
|
@ -516,7 +516,8 @@ class ONVIFHassCamera(Camera):
|
|||
"""Read image from a URL."""
|
||||
try:
|
||||
response = requests.get(self._snapshot, timeout=5, auth=auth)
|
||||
return response.content
|
||||
if response.status_code < 300:
|
||||
return response.content
|
||||
except requests.exceptions.RequestException as error:
|
||||
_LOGGER.error(
|
||||
"Fetch snapshot image failed from %s, falling back to FFmpeg; %s",
|
||||
|
|
Loading…
Add table
Reference in a new issue