Type hint additions (#26831)
* Type hint additions * Remove optional from sidebar_icon comment Co-Authored-By: Franck Nijhof <frenck@frenck.nl> * Remove optional from sidebar_title comment Co-Authored-By: Franck Nijhof <frenck@frenck.nl> * Fix issues after rebase and mypy 0.730
This commit is contained in:
parent
4f55235aa2
commit
f259ff17d5
27 changed files with 184 additions and 68 deletions
|
@ -1,5 +1,5 @@
|
|||
"""Device automation helpers for toggle entity."""
|
||||
from typing import List
|
||||
from typing import Any, Dict, List
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.core import Context, HomeAssistant, CALLBACK_TYPE
|
||||
|
@ -19,6 +19,9 @@ from homeassistant.helpers import condition, config_validation as cv, service
|
|||
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
|
||||
from . import TRIGGER_BASE_SCHEMA
|
||||
|
||||
|
||||
# mypy: allow-untyped-calls, allow-untyped-defs
|
||||
|
||||
ENTITY_ACTIONS = [
|
||||
{
|
||||
# Turn entity off
|
||||
|
@ -88,7 +91,7 @@ async def async_call_action_from_config(
|
|||
variables: TemplateVarsType,
|
||||
context: Context,
|
||||
domain: str,
|
||||
):
|
||||
) -> None:
|
||||
"""Change state based on configuration."""
|
||||
config = ACTION_SCHEMA(config)
|
||||
action_type = config[CONF_TYPE]
|
||||
|
@ -156,7 +159,7 @@ async def _async_get_automations(
|
|||
hass: HomeAssistant, device_id: str, automation_templates: List[dict], domain: str
|
||||
) -> List[dict]:
|
||||
"""List device automations."""
|
||||
automations = []
|
||||
automations: List[Dict[str, Any]] = []
|
||||
entity_registry = await hass.helpers.entity_registry.async_get_registry()
|
||||
|
||||
entries = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue