diff --git a/homeassistant/components/scene/__init__.py b/homeassistant/components/scene/__init__.py index 16e09f2cf39..7dc58d8df6c 100644 --- a/homeassistant/components/scene/__init__.py +++ b/homeassistant/components/scene/__init__.py @@ -14,6 +14,7 @@ from homeassistant.const import CONF_PLATFORM, SERVICE_TURN_ON from homeassistant.core import DOMAIN as HA_DOMAIN, HomeAssistant from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_component import EntityComponent +from homeassistant.helpers.typing import ConfigType # mypy: allow-untyped-defs, no-check-untyped-defs @@ -58,7 +59,7 @@ PLATFORM_SCHEMA = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the scenes.""" component = hass.data[DOMAIN] = EntityComponent( logging.getLogger(__name__), DOMAIN, hass diff --git a/homeassistant/components/scsgate/__init__.py b/homeassistant/components/scsgate/__init__.py index 6a190e64b7d..c34968d761b 100644 --- a/homeassistant/components/scsgate/__init__.py +++ b/homeassistant/components/scsgate/__init__.py @@ -9,8 +9,9 @@ from scsgate.tasks import GetStatusTask import voluptuous as vol from homeassistant.const import CONF_DEVICE, CONF_NAME -from homeassistant.core import EVENT_HOMEASSISTANT_STOP +from homeassistant.core import EVENT_HOMEASSISTANT_STOP, HomeAssistant import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.typing import ConfigType _LOGGER = logging.getLogger(__name__) @@ -27,7 +28,7 @@ SCSGATE_SCHEMA = vol.Schema( ) -def setup(hass, config): +def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the SCSGate component.""" device = config[DOMAIN][CONF_DEVICE] scsgate = None diff --git a/homeassistant/components/sharkiq/__init__.py b/homeassistant/components/sharkiq/__init__.py index d3246b5ac9e..23f92c3bfdc 100644 --- a/homeassistant/components/sharkiq/__init__.py +++ b/homeassistant/components/sharkiq/__init__.py @@ -1,5 +1,4 @@ """Shark IQ Integration.""" - import asyncio from contextlib import suppress @@ -13,7 +12,9 @@ from sharkiqpy import ( ) from homeassistant import exceptions +from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME +from homeassistant.core import HomeAssistant from .const import _LOGGER, API_TIMEOUT, DOMAIN, PLATFORMS from .update_coordinator import SharkIqUpdateCoordinator @@ -39,7 +40,7 @@ async def async_connect_or_timeout(ayla_api: AylaApi) -> bool: return True -async def async_setup_entry(hass, config_entry): +async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: """Initialize the sharkiq platform via config entry.""" ayla_api = get_ayla_api( username=config_entry.data[CONF_USERNAME], @@ -83,7 +84,7 @@ async def async_update_options(hass, config_entry): await hass.config_entries.async_reload(config_entry.entry_id) -async def async_unload_entry(hass, config_entry): +async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: """Unload a config entry.""" unload_ok = await hass.config_entries.async_unload_platforms( config_entry, PLATFORMS diff --git a/homeassistant/components/shiftr/__init__.py b/homeassistant/components/shiftr/__init__.py index 378d83d725e..6f4282915ac 100644 --- a/homeassistant/components/shiftr/__init__.py +++ b/homeassistant/components/shiftr/__init__.py @@ -8,8 +8,10 @@ from homeassistant.const import ( EVENT_HOMEASSISTANT_STOP, EVENT_STATE_CHANGED, ) +from homeassistant.core import HomeAssistant from homeassistant.helpers import state as state_helper import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.typing import ConfigType DOMAIN = "shiftr" @@ -28,7 +30,7 @@ CONFIG_SCHEMA = vol.Schema( ) -def setup(hass, config): +def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Initialize the Shiftr.io MQTT consumer.""" conf = config[DOMAIN] username = conf.get(CONF_USERNAME) diff --git a/homeassistant/components/sky_hub/__init__.py b/homeassistant/components/sky_hub/__init__.py index 9c875507c09..40637d866ff 100644 --- a/homeassistant/components/sky_hub/__init__.py +++ b/homeassistant/components/sky_hub/__init__.py @@ -1,6 +1,8 @@ """The sky_hub component.""" +from homeassistant.core import HomeAssistant +from homeassistant.helpers.typing import ConfigType -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the sky_hub component.""" return True diff --git a/homeassistant/components/skybell/__init__.py b/homeassistant/components/skybell/__init__.py index 2acb729d767..129397085f2 100644 --- a/homeassistant/components/skybell/__init__.py +++ b/homeassistant/components/skybell/__init__.py @@ -11,8 +11,10 @@ from homeassistant.const import ( CONF_USERNAME, __version__, ) +from homeassistant.core import HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity +from homeassistant.helpers.typing import ConfigType _LOGGER = logging.getLogger(__name__) @@ -40,7 +42,7 @@ CONFIG_SCHEMA = vol.Schema( ) -def setup(hass, config): +def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Skybell component.""" conf = config[DOMAIN] username = conf.get(CONF_USERNAME) diff --git a/homeassistant/components/sleepiq/__init__.py b/homeassistant/components/sleepiq/__init__.py index 3fc065264ca..58f0ba89831 100644 --- a/homeassistant/components/sleepiq/__init__.py +++ b/homeassistant/components/sleepiq/__init__.py @@ -6,9 +6,11 @@ from sleepyq import Sleepyq import voluptuous as vol from homeassistant.const import CONF_PASSWORD, CONF_USERNAME +from homeassistant.core import HomeAssistant from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity +from homeassistant.helpers.typing import ConfigType from homeassistant.util import Throttle from .const import DOMAIN @@ -30,7 +32,7 @@ CONFIG_SCHEMA = vol.Schema( ) -def setup(hass, config): +def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the SleepIQ component. Will automatically load sensor components to support diff --git a/homeassistant/components/slide/__init__.py b/homeassistant/components/slide/__init__.py index 2fd3df1acb7..eee48719685 100644 --- a/homeassistant/components/slide/__init__.py +++ b/homeassistant/components/slide/__init__.py @@ -1,5 +1,4 @@ """Component for the Slide API.""" - from datetime import timedelta import logging @@ -15,9 +14,11 @@ from homeassistant.const import ( STATE_OPEN, STATE_OPENING, ) +from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv from homeassistant.helpers.discovery import async_load_platform from homeassistant.helpers.event import async_call_later, async_track_time_interval +from homeassistant.helpers.typing import ConfigType from .const import ( API, @@ -50,7 +51,7 @@ CONFIG_SCHEMA = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Slide platform.""" async def update_slides(now=None): diff --git a/homeassistant/components/smarttub/__init__.py b/homeassistant/components/smarttub/__init__.py index 4a8aa10a51d..f6e36a847e5 100644 --- a/homeassistant/components/smarttub/__init__.py +++ b/homeassistant/components/smarttub/__init__.py @@ -1,5 +1,7 @@ """SmartTub integration.""" +from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform +from homeassistant.core import HomeAssistant from .const import DOMAIN, SMARTTUB_CONTROLLER from .controller import SmartTubController @@ -13,7 +15,7 @@ PLATFORMS = [ ] -async def async_setup_entry(hass, entry): +async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up a smarttub config entry.""" controller = SmartTubController(hass) @@ -30,7 +32,7 @@ async def async_setup_entry(hass, entry): return True -async def async_unload_entry(hass, entry): +async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Remove a smarttub config entry.""" unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) if unload_ok: diff --git a/homeassistant/components/smarty/__init__.py b/homeassistant/components/smarty/__init__.py index 72d5071882f..233dfa3bb27 100644 --- a/homeassistant/components/smarty/__init__.py +++ b/homeassistant/components/smarty/__init__.py @@ -1,5 +1,4 @@ """Support to control a Salda Smarty XP/XV ventilation unit.""" - from datetime import timedelta import ipaddress import logging @@ -8,10 +7,12 @@ from pysmarty import Smarty import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_NAME +from homeassistant.core import HomeAssistant from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv from homeassistant.helpers.dispatcher import dispatcher_send from homeassistant.helpers.event import track_time_interval +from homeassistant.helpers.typing import ConfigType DOMAIN = "smarty" DATA_SMARTY = "smarty" @@ -35,7 +36,7 @@ RPM = "rpm" SIGNAL_UPDATE_SMARTY = "smarty_update" -def setup(hass, config): +def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the smarty environment.""" conf = config[DOMAIN] diff --git a/homeassistant/components/sms/__init__.py b/homeassistant/components/sms/__init__.py index f987507ca1f..9b091942556 100644 --- a/homeassistant/components/sms/__init__.py +++ b/homeassistant/components/sms/__init__.py @@ -1,11 +1,11 @@ """The sms component.""" - import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_DEVICE, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv +from homeassistant.helpers.typing import ConfigType from .const import DOMAIN, SMS_GATEWAY from .gateway import create_sms_gateway @@ -18,7 +18,7 @@ CONFIG_SCHEMA = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Configure Gammu state machine.""" hass.data.setdefault(DOMAIN, {}) if not (sms_config := config.get(DOMAIN, {})): diff --git a/homeassistant/components/snips/__init__.py b/homeassistant/components/snips/__init__.py index 67449198392..01471b13bc7 100644 --- a/homeassistant/components/snips/__init__.py +++ b/homeassistant/components/snips/__init__.py @@ -6,8 +6,9 @@ import logging import voluptuous as vol from homeassistant.components import mqtt -from homeassistant.core import ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.helpers import config_validation as cv, intent +from homeassistant.helpers.typing import ConfigType DOMAIN = "snips" CONF_INTENTS = "intents" @@ -87,7 +88,7 @@ SERVICE_SCHEMA_FEEDBACK = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Activate Snips component.""" async def async_set_feedback(site_ids, state): diff --git a/homeassistant/components/solarlog/__init__.py b/homeassistant/components/solarlog/__init__.py index c0457b729f5..0ebcc3782c9 100644 --- a/homeassistant/components/solarlog/__init__.py +++ b/homeassistant/components/solarlog/__init__.py @@ -27,7 +27,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: return True -async def async_unload_entry(hass, entry): +async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" return await hass.config_entries.async_unload_platforms(entry, PLATFORMS) diff --git a/homeassistant/components/soma/__init__.py b/homeassistant/components/soma/__init__.py index 65171070537..541ba0a5a90 100644 --- a/homeassistant/components/soma/__init__.py +++ b/homeassistant/components/soma/__init__.py @@ -1,5 +1,4 @@ """Support for Soma Smartshades.""" - from api.soma_api import SomaApi import voluptuous as vol @@ -9,6 +8,7 @@ from homeassistant.const import CONF_HOST, CONF_PORT, Platform from homeassistant.core import HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import DeviceInfo, Entity +from homeassistant.helpers.typing import ConfigType from .const import API, DOMAIN, HOST, PORT @@ -29,7 +29,7 @@ CONFIG_SCHEMA = vol.Schema( PLATFORMS = [Platform.COVER, Platform.SENSOR] -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Soma component.""" if DOMAIN not in config: return True diff --git a/homeassistant/components/somfy/__init__.py b/homeassistant/components/somfy/__init__.py index c021d408288..ae12c4ea266 100644 --- a/homeassistant/components/somfy/__init__.py +++ b/homeassistant/components/somfy/__init__.py @@ -18,6 +18,7 @@ from homeassistant.helpers import ( config_validation as cv, device_registry as dr, ) +from homeassistant.helpers.typing import ConfigType from . import api, config_flow from .const import COORDINATOR, DOMAIN @@ -52,7 +53,7 @@ PLATFORMS = [ ] -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Somfy component.""" hass.data[DOMAIN] = {} domain_config = config.get(DOMAIN, {}) diff --git a/homeassistant/components/songpal/__init__.py b/homeassistant/components/songpal/__init__.py index e4b7b4a0c0b..64e71af3e6a 100644 --- a/homeassistant/components/songpal/__init__.py +++ b/homeassistant/components/songpal/__init__.py @@ -1,5 +1,4 @@ """The songpal component.""" - import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry diff --git a/homeassistant/components/spc/__init__.py b/homeassistant/components/spc/__init__.py index 25520c9d42a..1e6e643bf1c 100644 --- a/homeassistant/components/spc/__init__.py +++ b/homeassistant/components/spc/__init__.py @@ -6,9 +6,11 @@ from pyspcwebgw.area import Area from pyspcwebgw.zone import Zone import voluptuous as vol +from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client, discovery import homeassistant.helpers.config_validation as cv from homeassistant.helpers.dispatcher import async_dispatcher_send +from homeassistant.helpers.typing import ConfigType _LOGGER = logging.getLogger(__name__) @@ -34,7 +36,7 @@ CONFIG_SCHEMA = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the SPC component.""" async def async_upate_callback(spc_object): diff --git a/homeassistant/components/spider/__init__.py b/homeassistant/components/spider/__init__.py index be1a5bd29c6..b3c1918aad4 100644 --- a/homeassistant/components/spider/__init__.py +++ b/homeassistant/components/spider/__init__.py @@ -4,10 +4,12 @@ import logging from spiderpy.spiderapi import SpiderApi, SpiderApiException, UnauthorizedException import voluptuous as vol -from homeassistant.config_entries import SOURCE_IMPORT +from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME +from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.typing import ConfigType from .const import DEFAULT_SCAN_INTERVAL, DOMAIN, PLATFORMS @@ -32,7 +34,7 @@ CONFIG_SCHEMA = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up a config entry.""" hass.data[DOMAIN] = {} if DOMAIN not in config: @@ -50,7 +52,7 @@ async def async_setup(hass, config): return True -async def async_setup_entry(hass, entry): +async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up Spider via config entry.""" try: api = await hass.async_add_executor_job( @@ -73,7 +75,7 @@ async def async_setup_entry(hass, entry): return True -async def async_unload_entry(hass, entry): +async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload Spider entry.""" unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) if not unload_ok: diff --git a/homeassistant/components/splunk/__init__.py b/homeassistant/components/splunk/__init__.py index 6b40f9b7d58..1a2a868608e 100644 --- a/homeassistant/components/splunk/__init__.py +++ b/homeassistant/components/splunk/__init__.py @@ -18,11 +18,13 @@ from homeassistant.const import ( CONF_VERIFY_SSL, EVENT_STATE_CHANGED, ) +from homeassistant.core import HomeAssistant from homeassistant.helpers import state as state_helper from homeassistant.helpers.aiohttp_client import async_get_clientsession import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entityfilter import FILTER_SCHEMA from homeassistant.helpers.json import JSONEncoder +from homeassistant.helpers.typing import ConfigType _LOGGER = logging.getLogger(__name__) @@ -52,7 +54,7 @@ CONFIG_SCHEMA = vol.Schema( ) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Splunk component.""" conf = config[DOMAIN] host = conf.get(CONF_HOST) diff --git a/homeassistant/components/squeezebox/__init__.py b/homeassistant/components/squeezebox/__init__.py index f7a20ba4aef..89b3300fc5a 100644 --- a/homeassistant/components/squeezebox/__init__.py +++ b/homeassistant/components/squeezebox/__init__.py @@ -19,7 +19,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: return True -async def async_unload_entry(hass, entry): +async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" # Stop player discovery task for this config entry. hass.data[DOMAIN][entry.entry_id][PLAYER_DISCOVERY_UNSUB]() diff --git a/homeassistant/components/statsd/__init__.py b/homeassistant/components/statsd/__init__.py index 9830279a5e2..bfc972a17a1 100644 --- a/homeassistant/components/statsd/__init__.py +++ b/homeassistant/components/statsd/__init__.py @@ -5,8 +5,10 @@ import statsd import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_PORT, CONF_PREFIX, EVENT_STATE_CHANGED +from homeassistant.core import HomeAssistant from homeassistant.helpers import state as state_helper import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.typing import ConfigType _LOGGER = logging.getLogger(__name__) @@ -39,7 +41,7 @@ CONFIG_SCHEMA = vol.Schema( ) -def setup(hass, config): +def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the StatsD component.""" conf = config[DOMAIN] diff --git a/homeassistant/components/stiebel_eltron/__init__.py b/homeassistant/components/stiebel_eltron/__init__.py index 3712b47671f..dfec82975af 100644 --- a/homeassistant/components/stiebel_eltron/__init__.py +++ b/homeassistant/components/stiebel_eltron/__init__.py @@ -7,8 +7,10 @@ import voluptuous as vol from homeassistant.components.modbus.const import CONF_HUB, DEFAULT_HUB, MODBUS_DOMAIN from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME +from homeassistant.core import HomeAssistant from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.typing import ConfigType from homeassistant.util import Throttle DOMAIN = "stiebel_eltron" @@ -30,7 +32,7 @@ _LOGGER = logging.getLogger(__name__) MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=30) -def setup(hass, config): +def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the STIEBEL ELTRON unit. Will automatically load climate platform. diff --git a/homeassistant/components/streamlabswater/__init__.py b/homeassistant/components/streamlabswater/__init__.py index d566b3c7af9..c09f6040fed 100644 --- a/homeassistant/components/streamlabswater/__init__.py +++ b/homeassistant/components/streamlabswater/__init__.py @@ -5,9 +5,10 @@ from streamlabswater import streamlabswater import voluptuous as vol from homeassistant.const import CONF_API_KEY, Platform -from homeassistant.core import ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.typing import ConfigType DOMAIN = "streamlabswater" @@ -39,7 +40,7 @@ SET_AWAY_MODE_SCHEMA = vol.Schema( ) -def setup(hass, config): +def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the streamlabs water integration.""" conf = config[DOMAIN] diff --git a/homeassistant/components/subaru/__init__.py b/homeassistant/components/subaru/__init__.py index 220478da8bd..a252e61b690 100644 --- a/homeassistant/components/subaru/__init__.py +++ b/homeassistant/components/subaru/__init__.py @@ -36,7 +36,7 @@ from .const import ( _LOGGER = logging.getLogger(__name__) -async def async_setup_entry(hass, entry): +async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up Subaru from a config entry.""" config = entry.data websession = aiohttp_client.async_get_clientsession(hass) diff --git a/homeassistant/components/sun/__init__.py b/homeassistant/components/sun/__init__.py index 489eab6b5be..fd819e5ad33 100644 --- a/homeassistant/components/sun/__init__.py +++ b/homeassistant/components/sun/__init__.py @@ -8,13 +8,14 @@ from homeassistant.const import ( SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET, ) -from homeassistant.core import callback +from homeassistant.core import HomeAssistant, callback from homeassistant.helpers import event from homeassistant.helpers.entity import Entity from homeassistant.helpers.sun import ( get_astral_location, get_location_astral_event_next, ) +from homeassistant.helpers.typing import ConfigType from homeassistant.util import dt as dt_util # mypy: allow-untyped-calls, allow-untyped-defs, no-check-untyped-defs @@ -72,7 +73,7 @@ _PHASE_UPDATES = { } -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Track the state of the sun.""" if config.get(CONF_ELEVATION) is not None: _LOGGER.warning( diff --git a/homeassistant/components/supla/__init__.py b/homeassistant/components/supla/__init__.py index 51e6c377bdc..647714bc461 100644 --- a/homeassistant/components/supla/__init__.py +++ b/homeassistant/components/supla/__init__.py @@ -9,9 +9,11 @@ from asyncpysupla import SuplaAPI import voluptuous as vol from homeassistant.const import CONF_ACCESS_TOKEN +from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import async_load_platform +from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.update_coordinator import ( CoordinatorEntity, DataUpdateCoordinator, @@ -51,7 +53,7 @@ CONFIG_SCHEMA = vol.Schema( ) -async def async_setup(hass, base_config): +async def async_setup(hass: HomeAssistant, base_config: ConfigType) -> bool: """Set up the Supla component.""" server_confs = base_config[DOMAIN][CONF_SERVERS] diff --git a/homeassistant/components/system_log/__init__.py b/homeassistant/components/system_log/__init__.py index f04414aef4c..655d1e9ee5f 100644 --- a/homeassistant/components/system_log/__init__.py +++ b/homeassistant/components/system_log/__init__.py @@ -10,8 +10,9 @@ import voluptuous as vol from homeassistant import __path__ as HOMEASSISTANT_PATH from homeassistant.components.http import HomeAssistantView from homeassistant.const import EVENT_HOMEASSISTANT_CLOSE, EVENT_HOMEASSISTANT_STOP -from homeassistant.core import ServiceCall, callback +from homeassistant.core import HomeAssistant, ServiceCall, callback import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.typing import ConfigType CONF_MAX_ENTRIES = "max_entries" CONF_FIRE_EVENT = "fire_event" @@ -194,7 +195,7 @@ class LogErrorHandler(logging.Handler): self.hass.bus.fire(EVENT_SYSTEM_LOG, entry.to_dict()) -async def async_setup(hass, config): +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the logger component.""" if (conf := config.get(DOMAIN)) is None: conf = CONFIG_SCHEMA({DOMAIN: {}})[DOMAIN]