Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions homeassistant/components/agent_dvr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Support for Agent."""

from agent import AgentError
from agent.a import Agent

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
Expand All @@ -16,7 +17,7 @@
PLATFORMS = [Platform.ALARM_CONTROL_PANEL, Platform.CAMERA]


async def async_setup_entry(hass, config_entry):
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set up the Agent component."""
hass.data.setdefault(AGENT_DOMAIN, {})

Expand Down Expand Up @@ -52,7 +53,7 @@ async def async_setup_entry(hass, config_entry):
return True


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
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/alert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
STATE_OFF,
STATE_ON,
)
from homeassistant.core import ServiceCall
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import event, service
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.helpers.typing import ConfigType
from homeassistant.util.dt import now

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -77,7 +78,7 @@ def is_on(hass, entity_id):
return hass.states.is_state(entity_id, STATE_ON)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Alert component."""
entities = []

Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/ambiclimate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType

from . import config_flow
from .const import DOMAIN
Expand All @@ -24,7 +25,7 @@
PLATFORMS = [Platform.CLIMATE]


async def async_setup(hass, config) -> bool:
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up Ambiclimate components."""
if DOMAIN not in config:
return True
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/android_ip_webcam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
CONF_TIMEOUT,
CONF_USERNAME,
)
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import discovery
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
Expand All @@ -28,6 +28,7 @@
)
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.helpers.typing import ConfigType
from homeassistant.util.dt import utcnow

ATTR_AUD_CONNS = "Audio Connections"
Expand Down Expand Up @@ -183,7 +184,7 @@
)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the IP Webcam component."""

webcams = hass.data[DATA_IP_WEBCAM] = {}
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/androidtv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.storage import STORAGE_DIR
from homeassistant.helpers.typing import ConfigType

from .const import (
ANDROID_DEV,
Expand Down Expand Up @@ -125,7 +126,7 @@ def _migrate_aftv_entity(hass, aftv, entry_unique_id):
_LOGGER.warning("Migration of old entity failed: %s", exp)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Android TV integration."""
return True

Expand Down Expand Up @@ -163,7 +164,7 @@ async def async_close_connection(event):
return True


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
aftv = hass.data[DOMAIN][entry.entry_id][ANDROID_DEV]
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/apache_kafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
STATE_UNAVAILABLE,
STATE_UNKNOWN,
)
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entityfilter import FILTER_SCHEMA
from homeassistant.helpers.typing import ConfigType
from homeassistant.util import ssl as ssl_util

DOMAIN = "apache_kafka"
Expand Down Expand Up @@ -45,7 +47,7 @@
)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Activate the Apache Kafka integration."""
conf = config[DOMAIN]

Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/apcupsd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import voluptuous as vol

from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.typing import ConfigType
from homeassistant.util import Throttle

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -34,7 +36,7 @@
)


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Use config values to set up a function enabling status retrieval."""
conf = config[DOMAIN]
host = conf[CONF_HOST]
Expand Down
7 changes: 4 additions & 3 deletions homeassistant/components/apple_tv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from homeassistant.components.media_player import DOMAIN as MP_DOMAIN
from homeassistant.components.remote import DOMAIN as REMOTE_DOMAIN
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_CONNECTIONS,
ATTR_IDENTIFIERS,
Expand All @@ -21,7 +22,7 @@
CONF_NAME,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.dispatcher import (
Expand All @@ -45,7 +46,7 @@
PLATFORMS = [MP_DOMAIN, REMOTE_DOMAIN]


async def async_setup_entry(hass, entry):
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up a config entry for Apple TV."""
manager = AppleTVManager(hass, entry)
hass.data.setdefault(DOMAIN, {})[entry.unique_id] = manager
Expand Down Expand Up @@ -73,7 +74,7 @@ async def setup_platforms():
return True


async def async_unload_entry(hass, entry):
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload an Apple TV config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/aqualogic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType

_LOGGER = logging.getLogger(__name__)

Expand All @@ -32,7 +34,7 @@
)


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up AquaLogic platform."""
host = config[DOMAIN][CONF_HOST]
port = config[DOMAIN][CONF_PORT]
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/arcam_fmj/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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:
"""Cleanup before removing config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/arduino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.typing import ConfigType

_LOGGER = logging.getLogger(__name__)

Expand All @@ -21,7 +23,7 @@
)


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Arduino component."""
_LOGGER.warning(
"The %s integration has been deprecated. Please move your "
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/arlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import voluptuous as vol

from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME
from homeassistant.core import ServiceCall
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import 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

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -43,7 +44,7 @@
)


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up an Arlo component."""
conf = config[DOMAIN]
username = conf[CONF_USERNAME]
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/asuswrt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Support for ASUSWRT devices."""

import voluptuous as vol

from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
Expand All @@ -16,6 +15,7 @@
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType

from .const import (
CONF_DNSMASQ,
Expand Down Expand Up @@ -72,7 +72,7 @@
)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the AsusWrt integration."""
if (conf := config.get(DOMAIN)) is None:
return True
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/atag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def _async_update_data():
return True


async def async_unload_entry(hass, entry):
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload Atag config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
from homeassistant.components.http.data_validator import RequestDataValidator
from homeassistant.components.http.view import HomeAssistantView
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import bind_hass
from homeassistant.util import dt as dt_util

Expand Down Expand Up @@ -186,7 +187,7 @@ def create_auth_code(hass, client_id: str, credential: Credentials) -> str:
return hass.data[DOMAIN](client_id, credential)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Component to allow users to login."""
store_result, retrieve_result = _create_auth_code_store()

Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/automation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
trace_path,
)
from homeassistant.helpers.trigger import async_initialize_triggers
from homeassistant.helpers.typing import TemplateVarsType
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
from homeassistant.loader import bind_hass
from homeassistant.util.dt import parse_datetime

Expand Down Expand Up @@ -220,7 +220,7 @@ def areas_in_automation(hass: HomeAssistant, entity_id: str) -> list[str]:
return list(automation_entity.referenced_areas)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up all automations."""
hass.data[DOMAIN] = component = EntityComponent(LOGGER, DOMAIN, hass)

Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/awair/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
from python_awair import Awair
from python_awair.exceptions import AuthError

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_ACCESS_TOKEN, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
Expand All @@ -18,7 +20,7 @@
PLATFORMS = [Platform.SENSOR]


async def async_setup_entry(hass, config_entry) -> bool:
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set up Awair integration from a config entry."""
session = async_get_clientsession(hass)
coordinator = AwairDataUpdateCoordinator(hass, config_entry, session)
Expand All @@ -33,7 +35,7 @@ async def async_setup_entry(hass, config_entry) -> bool:
return True


async def async_unload_entry(hass, config_entry) -> bool:
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Unload Awair configuration."""
unload_ok = await hass.config_entries.async_unload_platforms(
config_entry, PLATFORMS
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/axis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Support for Axis devices."""

import logging

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_DEVICE, CONF_MAC, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import format_mac
from homeassistant.helpers.entity_registry import async_migrate_entries

Expand All @@ -13,7 +13,7 @@
_LOGGER = logging.getLogger(__name__)


async def async_setup_entry(hass, config_entry):
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set up the Axis component."""
hass.data.setdefault(AXIS_DOMAIN, {})

Expand All @@ -33,7 +33,7 @@ async def async_setup_entry(hass, config_entry):
return True


async def async_unload_entry(hass, config_entry):
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Unload Axis device config entry."""
device = hass.data[AXIS_DOMAIN].pop(config_entry.unique_id)
return await device.async_reset()
Expand Down