diff --git a/esphome/components/font/__init__.py b/esphome/components/font/__init__.py index ced433dc5a..aa165ebaa5 100644 --- a/esphome/components/font/__init__.py +++ b/esphome/components/font/__init__.py @@ -146,7 +146,7 @@ def download_gfonts(value): if path.is_file(): return value try: - req = requests.get(url) + req = requests.get(url, timeout=30) req.raise_for_status() except requests.exceptions.RequestException as e: raise cv.Invalid( @@ -162,7 +162,7 @@ def download_gfonts(value): ttf_url = match.group(1) try: - req = requests.get(ttf_url) + req = requests.get(ttf_url, timeout=30) req.raise_for_status() except requests.exceptions.RequestException as e: raise cv.Invalid(f"Could not download ttf file for {name} ({ttf_url}): {e}") diff --git a/esphome/components/shelly_dimmer/light.py b/esphome/components/shelly_dimmer/light.py index 003498c090..3978d37c0b 100644 --- a/esphome/components/shelly_dimmer/light.py +++ b/esphome/components/shelly_dimmer/light.py @@ -73,7 +73,7 @@ def get_firmware(value): def dl(url): try: - req = requests.get(url) + req = requests.get(url, timeout=30) req.raise_for_status() except requests.exceptions.RequestException as e: raise cv.Invalid(f"Could not download firmware file ({url}): {e}") diff --git a/esphome/dashboard/dashboard.py b/esphome/dashboard/dashboard.py index ca2767639d..e7a17cba4c 100644 --- a/esphome/dashboard/dashboard.py +++ b/esphome/dashboard/dashboard.py @@ -823,7 +823,9 @@ class LoginHandler(BaseHandler): "password": self.get_argument("password", ""), } try: - req = requests.post("http://supervisor/auth", headers=headers, data=data) + req = requests.post( + "http://supervisor/auth", headers=headers, data=data, timeout=30 + ) if req.status_code == 200: self.set_secure_cookie("authenticated", cookie_authenticated_yes) self.redirect("/") diff --git a/requirements_test.txt b/requirements_test.txt index ed48818276..8ae7563642 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -pylint==2.14.5 +pylint==2.15.0 flake8==5.0.4 black==22.6.0 # also change in .pre-commit-config.yaml when updating pyupgrade==2.37.3 # also change in .pre-commit-config.yaml when updating