From 7cf66fa72dae45875c6415d9b4ccfea52794d15c Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:11:33 +0100 Subject: [PATCH] Add basic type hints to alexa (#62878) Co-authored-by: epenet --- homeassistant/components/alexa/__init__.py | 4 +++- homeassistant/components/alexa/smart_home_http.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/alexa/__init__.py b/homeassistant/components/alexa/__init__.py index d388a22983f..d28ff5dc804 100644 --- a/homeassistant/components/alexa/__init__.py +++ b/homeassistant/components/alexa/__init__.py @@ -8,7 +8,9 @@ from homeassistant.const import ( CONF_NAME, CONF_PASSWORD, ) +from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv, entityfilter +from homeassistant.helpers.typing import ConfigType from . import flash_briefings, intent, smart_home_http from .const import ( @@ -78,7 +80,7 @@ CONFIG_SCHEMA = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Activate the Alexa component.""" if DOMAIN not in config: return True diff --git a/homeassistant/components/alexa/smart_home_http.py b/homeassistant/components/alexa/smart_home_http.py index 237828987e8..9651b8cad15 100644 --- a/homeassistant/components/alexa/smart_home_http.py +++ b/homeassistant/components/alexa/smart_home_http.py @@ -4,7 +4,9 @@ import logging from homeassistant import core from homeassistant.components.http.view import HomeAssistantView from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, ENTITY_CATEGORIES +from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er +from homeassistant.helpers.typing import ConfigType from .auth import Auth from .config import AbstractConfig @@ -85,7 +87,7 @@ class AlexaConfig(AbstractConfig): return await self._auth.async_do_auth(code) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> None: """Activate Smart Home functionality of Alexa component. This is optional, triggered by having a `smart_home:` sub-section in the