diff --git a/homeassistant/components/http/__init__.py b/homeassistant/components/http/__init__.py index 4d3985a7af3..c720d134c9f 100644 --- a/homeassistant/components/http/__init__.py +++ b/homeassistant/components/http/__init__.py @@ -26,7 +26,6 @@ from .real_ip import setup_real_ip from .static import CACHE_HEADERS, CachingStaticResource from .view import HomeAssistantView # noqa: F401 - # mypy: allow-untyped-defs, no-check-untyped-defs DOMAIN = "http" diff --git a/homeassistant/components/http/auth.py b/homeassistant/components/http/auth.py index 97bd9b7d4bc..3866e770de0 100644 --- a/homeassistant/components/http/auth.py +++ b/homeassistant/components/http/auth.py @@ -11,7 +11,6 @@ from homeassistant.util import dt as dt_util from .const import KEY_AUTHENTICATED, KEY_HASS_USER, KEY_REAL_IP - # mypy: allow-untyped-defs, no-check-untyped-defs _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/http/ban.py b/homeassistant/components/http/ban.py index 7d1e24f3698..553d3657160 100644 --- a/homeassistant/components/http/ban.py +++ b/homeassistant/components/http/ban.py @@ -17,7 +17,6 @@ from homeassistant.util.yaml import dump from .const import KEY_REAL_IP - # mypy: allow-untyped-defs, no-check-untyped-defs _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/http/cors.py b/homeassistant/components/http/cors.py index de4547f4782..2d99a049e4b 100644 --- a/homeassistant/components/http/cors.py +++ b/homeassistant/components/http/cors.py @@ -1,11 +1,10 @@ """Provide CORS support for the HTTP component.""" +from aiohttp.hdrs import ACCEPT, AUTHORIZATION, CONTENT_TYPE, ORIGIN from aiohttp.web_urldispatcher import Resource, ResourceRoute, StaticResource -from aiohttp.hdrs import ACCEPT, CONTENT_TYPE, ORIGIN, AUTHORIZATION from homeassistant.const import HTTP_HEADER_X_REQUESTED_WITH from homeassistant.core import callback - # mypy: allow-untyped-defs, no-check-untyped-defs ALLOWED_CORS_HEADERS = [ @@ -23,6 +22,7 @@ def setup_cors(app, origins): """Set up CORS.""" # This import should remain here. That way the HTTP integration can always # be imported by other integrations without it's requirements being installed. + # pylint: disable=import-outside-toplevel import aiohttp_cors cors = aiohttp_cors.setup( diff --git a/homeassistant/components/http/data_validator.py b/homeassistant/components/http/data_validator.py index 5945a4ca402..017644a4d36 100644 --- a/homeassistant/components/http/data_validator.py +++ b/homeassistant/components/http/data_validator.py @@ -4,7 +4,6 @@ import logging import voluptuous as vol - # mypy: allow-untyped-defs _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/http/real_ip.py b/homeassistant/components/http/real_ip.py index f327c86a4c1..f2334ce0a2f 100644 --- a/homeassistant/components/http/real_ip.py +++ b/homeassistant/components/http/real_ip.py @@ -8,7 +8,6 @@ from homeassistant.core import callback from .const import KEY_REAL_IP - # mypy: allow-untyped-defs diff --git a/homeassistant/components/http/static.py b/homeassistant/components/http/static.py index 7d84be0f6dd..a5fe686a651 100644 --- a/homeassistant/components/http/static.py +++ b/homeassistant/components/http/static.py @@ -3,10 +3,9 @@ from pathlib import Path from aiohttp import hdrs from aiohttp.web import FileResponse -from aiohttp.web_exceptions import HTTPNotFound, HTTPForbidden +from aiohttp.web_exceptions import HTTPForbidden, HTTPNotFound from aiohttp.web_urldispatcher import StaticResource - # mypy: allow-untyped-defs CACHE_TIME = 31 * 86400 # = 1 month