mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Enable strict typing for downloader (#107263)
This commit is contained in:
parent
221fa48ea5
commit
f0b47bf00c
@ -141,6 +141,7 @@ homeassistant.components.dlna_dmr.*
|
|||||||
homeassistant.components.dnsip.*
|
homeassistant.components.dnsip.*
|
||||||
homeassistant.components.doorbird.*
|
homeassistant.components.doorbird.*
|
||||||
homeassistant.components.dormakaba_dkey.*
|
homeassistant.components.dormakaba_dkey.*
|
||||||
|
homeassistant.components.downloader.*
|
||||||
homeassistant.components.dsmr.*
|
homeassistant.components.dsmr.*
|
||||||
homeassistant.components.dunehd.*
|
homeassistant.components.dunehd.*
|
||||||
homeassistant.components.efergy.*
|
homeassistant.components.efergy.*
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
"""Support for functionality to download files."""
|
"""Support for functionality to download files."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@ -61,7 +63,7 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
def download_file(service: ServiceCall) -> None:
|
def download_file(service: ServiceCall) -> None:
|
||||||
"""Start thread to download file specified in the URL."""
|
"""Start thread to download file specified in the URL."""
|
||||||
|
|
||||||
def do_download():
|
def do_download() -> None:
|
||||||
"""Download the file."""
|
"""Download the file."""
|
||||||
try:
|
try:
|
||||||
url = service.data[ATTR_URL]
|
url = service.data[ATTR_URL]
|
||||||
|
10
mypy.ini
10
mypy.ini
@ -1171,6 +1171,16 @@ disallow_untyped_defs = true
|
|||||||
warn_return_any = true
|
warn_return_any = true
|
||||||
warn_unreachable = 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.*]
|
[mypy-homeassistant.components.dsmr.*]
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
disallow_incomplete_defs = true
|
disallow_incomplete_defs = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user