mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 20:25:07 +02:00
Check status code on onvif snapshot (#33865)
This commit is contained in:
@@ -516,7 +516,8 @@ class ONVIFHassCamera(Camera):
|
|||||||
"""Read image from a URL."""
|
"""Read image from a URL."""
|
||||||
try:
|
try:
|
||||||
response = requests.get(self._snapshot, timeout=5, auth=auth)
|
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:
|
except requests.exceptions.RequestException as error:
|
||||||
_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",
|
||||||
|
Reference in New Issue
Block a user