Type check various base components (#25878)

* Type check various component base classes, disabling bunch of checks for now

* Type hint fixes

* Help mypy out some

* Add more type hints
This commit is contained in:
Ville Skyttä authored and Paulus Schoutsen committed 2019-08-11 20:38:18 -07:00
1 parent cf90e49b50
commit b738082dad
59 files changed
+233 -34

No files matched your search

+5 -1
View File
@@ -1,5 +1,6 @@
"""Light support for switch entities."""
import logging
from typing import cast
import voluptuous as vol
@@ -18,6 +19,9 @@ from homeassistant.helpers.typing import ConfigType, HomeAssistantType
from homeassistant.components.light import PLATFORM_SCHEMA, Light
# mypy: allow-incomplete-defs, allow-untyped-calls, allow-untyped-defs
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "Light Switch"
@@ -35,7 +39,7 @@ async def async_setup_platform(
) -> None:
"""Initialize Light Switch platform."""
async_add_entities(
[LightSwitch(config.get(CONF_NAME), config[CONF_ENTITY_ID])], True
[LightSwitch(cast(str, config.get(CONF_NAME)), config[CONF_ENTITY_ID])], True
)