Add timeouts to requests calls (#76851)

This commit is contained in:
Marc Mueller 2022-08-19 08:58:18 +02:00 committed by GitHub
parent 4eb4146e29
commit 1faabb8f40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 7 deletions

View file

@ -74,7 +74,9 @@ class AbodeCamera(AbodeDevice, Camera):
"""Attempt to download the most recent capture."""
if self._device.image_url:
try:
self._response = requests.get(self._device.image_url, stream=True)
self._response = requests.get(
self._device.image_url, stream=True, timeout=10
)
self._response.raise_for_status()
except requests.HTTPError as err: