Typing misc fixes (#27543)

* Make async_get_conditions return type hint more specific

* Exclude script/scaffold/templates/ from pre-commit mypy
This commit is contained in:
Ville Skyttä 2019-10-14 23:03:37 +03:00 committed by Paulus Schoutsen
parent 2f6c2fadd0
commit 759ad08930
7 changed files with 24 additions and 13 deletions

View file

@ -1,5 +1,5 @@
"""Implemenet device conditions for binary sensor."""
from typing import List
from typing import Dict, List
import voluptuous as vol
from homeassistant.core import HomeAssistant
@ -193,9 +193,11 @@ CONDITION_SCHEMA = cv.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."""
conditions: List[dict] = []
conditions: List[Dict[str, str]] = []
entity_registry = await async_get_registry(hass)
entries = [
entry