Improve device condition type hinting (#54906)

This commit is contained in:
Ville Skyttä 2021-08-20 23:21:40 +03:00 committed by GitHub
parent 9633b9fe6e
commit debc6d632c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 14 deletions

View file

@ -23,6 +23,8 @@ from homeassistant.helpers.typing import ConfigType, TemplateVarsType
from . import DOMAIN
# mypy: disallow-any-generics
CONDITION_TYPES = {
"is_locked",
"is_unlocked",
@ -39,7 +41,9 @@ CONDITION_SCHEMA = DEVICE_CONDITION_BASE_SCHEMA.extend(
)
async def async_get_conditions(hass: HomeAssistant, device_id: str) -> list[dict]:
async def async_get_conditions(
hass: HomeAssistant, device_id: str
) -> list[dict[str, str]]:
"""List device conditions for Lock devices."""
registry = await entity_registry.async_get_registry(hass)
conditions = []