Fix circular import (#34441)

pull/30283/head^2
Paulus Schoutsen 2020-04-19 14:41:52 -07:00 committed by GitHub
parent f492a7678d
commit 26f78132ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 4 deletions

View File

@ -2,7 +2,17 @@
import asyncio
from functools import partial, wraps
import logging
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Set,
Tuple,
)
import voluptuous as vol
@ -24,12 +34,15 @@ from homeassistant.exceptions import (
)
from homeassistant.helpers import template
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.typing import ConfigType, HomeAssistantType, TemplateVarsType
from homeassistant.loader import async_get_integration, bind_hass
from homeassistant.util.yaml import load_yaml
from homeassistant.util.yaml.loader import JSON_TYPE
if TYPE_CHECKING:
from homeassistant.helpers.entity import Entity # noqa
# mypy: allow-untyped-defs, no-check-untyped-defs
CONF_SERVICE_ENTITY_ID = "entity_id"
@ -143,10 +156,10 @@ def extract_entity_ids(
@bind_hass
async def async_extract_entities(
hass: HomeAssistantType,
entities: Iterable[Entity],
entities: Iterable["Entity"],
service_call: ha.ServiceCall,
expand_group: bool = True,
) -> List[Entity]:
) -> List["Entity"]:
"""Extract a list of entity objects from a service call.
Will convert group entity ids to the entity ids it represents.