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:
Ville Skyttä 2019-09-29 20:07:49 +03:00 committed by GitHub
parent 4f55235aa2
commit f259ff17d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 184 additions and 68 deletions

View file

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