mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Type check homeassistant.scripts (#25464)
* Run mypy on homeassistant.scripts, disabling bunch of checks for now * Declare async_initialize in AuthProvider * Add some type hints * Remove unreachable code * Help mypy out * Script docstring fixes
This commit is contained in:
committed by
Paulus Schoutsen
parent
10b120f11f
commit
e8e84fb764
@@ -5,17 +5,22 @@ from contextlib import suppress
|
||||
from datetime import datetime
|
||||
import logging
|
||||
from timeit import default_timer as timer
|
||||
from typing import Callable, Dict
|
||||
|
||||
from homeassistant import core
|
||||
from homeassistant.const import (
|
||||
ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED)
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
BENCHMARKS = {}
|
||||
|
||||
# mypy: allow-untyped-calls, allow-untyped-defs, no-check-untyped-defs
|
||||
# mypy: no-warn-return-any
|
||||
|
||||
BENCHMARKS = {} # type: Dict[str, Callable]
|
||||
|
||||
|
||||
def run(args):
|
||||
"""Handle ensure configuration commandline script."""
|
||||
"""Handle benchmark commandline script."""
|
||||
# Disable logging
|
||||
logging.getLogger('homeassistant.core').setLevel(logging.CRITICAL)
|
||||
|
||||
@@ -40,8 +45,6 @@ def run(args):
|
||||
loop.run_until_complete(hass.async_stop())
|
||||
loop.close()
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def benchmark(func):
|
||||
"""Decorate to mark a benchmark."""
|
||||
|
||||
Reference in New Issue
Block a user