Check status code on onvif snapshot (#33865)
parent
21dfee831f
commit
1adb45f74e
|
@ -516,6 +516,7 @@ 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)
|
||||||
|
if response.status_code < 300:
|
||||||
return response.content
|
return response.content
|
||||||
except requests.exceptions.RequestException as error:
|
except requests.exceptions.RequestException as error:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
|
|
Loading…
Reference in New Issue