mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 10:38:22 +00:00
Check status code on onvif snapshot (#33865)
This commit is contained in:
parent
9efbf2f880
commit
995f5db913
@ -516,6 +516,7 @@ class ONVIFHassCamera(Camera):
|
||||
"""Read image from a URL."""
|
||||
try:
|
||||
response = requests.get(self._snapshot, timeout=5, auth=auth)
|
||||
if response.status_code < 300:
|
||||
return response.content
|
||||
except requests.exceptions.RequestException as error:
|
||||
_LOGGER.error(
|
||||
|
Loading…
x
Reference in New Issue
Block a user