Enable strict typing for downloader (#107263)

This commit is contained in:
Marc Mueller 2024-01-05 18:35:05 +01:00 committed by GitHub
parent 221fa48ea5
commit f0b47bf00c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -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.*

View file

@ -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]

View file

@ -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