diff --git a/.strict-typing b/.strict-typing index 67d7866ba62..db30bfb3494 100644 --- a/.strict-typing +++ b/.strict-typing @@ -141,6 +141,7 @@ homeassistant.components.dlna_dmr.* homeassistant.components.dnsip.* homeassistant.components.doorbird.* homeassistant.components.dormakaba_dkey.* +homeassistant.components.downloader.* homeassistant.components.dsmr.* homeassistant.components.dunehd.* homeassistant.components.efergy.* diff --git a/homeassistant/components/downloader/__init__.py b/homeassistant/components/downloader/__init__.py index 9aca80b04da..1922fde3102 100644 --- a/homeassistant/components/downloader/__init__.py +++ b/homeassistant/components/downloader/__init__.py @@ -1,4 +1,6 @@ """Support for functionality to download files.""" +from __future__ import annotations + from http import HTTPStatus import logging import os @@ -61,7 +63,7 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool: def download_file(service: ServiceCall) -> None: """Start thread to download file specified in the URL.""" - def do_download(): + def do_download() -> None: """Download the file.""" try: url = service.data[ATTR_URL] diff --git a/mypy.ini b/mypy.ini index 8d621949810..e5326bf16af 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1171,6 +1171,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.downloader.*] +check_untyped_defs = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +warn_return_any = true +warn_unreachable = true + [mypy-homeassistant.components.dsmr.*] check_untyped_defs = true disallow_incomplete_defs = true