From 277c12cf642c18b07d594c7adca88bc8cce96a33 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 11 Jan 2022 13:39:52 +0100 Subject: [PATCH] Add setup type hints to envisalink (#63785) Co-authored-by: epenet --- homeassistant/components/envisalink/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/envisalink/__init__.py b/homeassistant/components/envisalink/__init__.py index 97ea05ae6b9..bdbfa7bdf9c 100644 --- a/homeassistant/components/envisalink/__init__.py +++ b/homeassistant/components/envisalink/__init__.py @@ -12,11 +12,12 @@ from homeassistant.const import ( EVENT_HOMEASSISTANT_STOP, Platform, ) -from homeassistant.core import ServiceCall, callback +from homeassistant.core import HomeAssistant, ServiceCall, callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import async_load_platform from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.helpers.entity import Entity +from homeassistant.helpers.typing import ConfigType _LOGGER = logging.getLogger(__name__) @@ -102,9 +103,9 @@ SERVICE_SCHEMA = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up for Envisalink devices.""" - conf = config.get(DOMAIN) + conf = config[DOMAIN] host = conf.get(CONF_HOST) port = conf.get(CONF_EVL_PORT) @@ -119,7 +120,7 @@ async def async_setup(hass, config): zones = conf.get(CONF_ZONES) partitions = conf.get(CONF_PARTITIONS) connection_timeout = conf.get(CONF_TIMEOUT) - sync_connect = asyncio.Future() + sync_connect: asyncio.Future[bool] = asyncio.Future() controller = EnvisalinkAlarmPanel( host,