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
2 changes: 1 addition & 1 deletion homeassistant/components/daikin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/danfoss_air/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import voluptuous as vol

from homeassistant.const import CONF_HOST, Platform
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

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


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Danfoss Air component."""
conf = config[DOMAIN]

Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/datadog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
EVENT_STATE_CHANGED,
STATE_UNKNOWN,
)
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__)

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


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Datadog component."""

conf = config[DOMAIN]
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/default_config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
"""Component providing default configuration for new users."""

try:
import av
except ImportError:
av = None

from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType
from homeassistant.setup import async_setup_component

DOMAIN = "default_config"


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Initialize default configuration."""
if av is None:
return True
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/demo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
async_add_external_statistics,
get_last_statistics,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_ENTITY_ID,
EVENT_HOMEASSISTANT_START,
SOUND_PRESSURE_DB,
)
import homeassistant.core as ha
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType
import homeassistant.util.dt as dt_util

DOMAIN = "demo"
Expand Down Expand Up @@ -51,7 +54,7 @@
]


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the demo environment."""
if DOMAIN not in config:
return True
Expand Down Expand Up @@ -249,7 +252,7 @@ async def _insert_statistics(hass):
async_add_external_statistics(hass, metadata, statistics)


async def async_setup_entry(hass, config_entry):
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set the config entry up."""
# Set up demo platforms with config entry
for platform in COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM:
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/device_automation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
entity_registry as er,
)
from homeassistant.helpers.frame import report
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import IntegrationNotFound, bind_hass
from homeassistant.requirements import async_get_integration_with_requirements

Expand Down Expand Up @@ -93,7 +94,7 @@ async def async_get_device_automations(
return await _async_get_device_automations(hass, automation_type, device_ids)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up device automation."""
hass.components.websocket_api.async_register_command(
websocket_device_automation_list_actions
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/device_sun_light_trigger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
SUN_EVENT_SUNRISE,
SUN_EVENT_SUNSET,
)
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import (
async_track_point_in_utc_time,
async_track_state_change,
)
from homeassistant.helpers.sun import get_astral_event_next, is_up
from homeassistant.helpers.typing import ConfigType
import homeassistant.util.dt as dt_util

DOMAIN = "device_sun_light_trigger"
Expand Down Expand Up @@ -58,7 +59,7 @@
)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the triggers to control lights based on device presence."""
conf = config[DOMAIN]
disable_turn_off = conf[CONF_DISABLE_TURN_OFF]
Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/dialogflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from aiohttp import web
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_entry_flow, intent, template

Expand Down Expand Up @@ -61,15 +63,15 @@ async def handle_webhook(hass, webhook_id, request):
)


async def async_setup_entry(hass, entry):
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Configure based on config entry."""
hass.components.webhook.async_register(
DOMAIN, "DialogFlow", entry.data[CONF_WEBHOOK_ID], handle_webhook
)
return True


async def async_unload_entry(hass, entry):
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
hass.components.webhook.async_unregister(entry.data[CONF_WEBHOOK_ID])
return True
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/digital_ocean/__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_ACCESS_TOKEN, Platform
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 @@ -37,7 +39,7 @@
)


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Digital Ocean component."""

conf = config[DOMAIN]
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/discovery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
from homeassistant import config_entries
from homeassistant.components import zeroconf
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import async_discover, async_load_platform
from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import async_get_zeroconf
import homeassistant.util.dt as dt_util

Expand Down Expand Up @@ -124,7 +125,7 @@ class ServiceDetails(NamedTuple):
)


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Start a discovery service."""

logger = logging.getLogger(__name__)
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/dominos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
import voluptuous as vol

from homeassistant.components import http
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.typing import ConfigType
from homeassistant.util import Throttle

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


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up is called when Home Assistant is loading our component."""
dominos = Dominos(hass, config)

Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/dovado/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
CONF_USERNAME,
DEVICE_DEFAULT_NAME,
)
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 All @@ -36,7 +38,7 @@
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=30)


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Dovado component."""

hass.data[DOMAIN] = DovadoData(
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/downloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import requests
import voluptuous as vol

from homeassistant.core import ServiceCall
from homeassistant.core import HomeAssistant, ServiceCall
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.typing import ConfigType
from homeassistant.util import raise_if_invalid_filename, raise_if_invalid_path

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


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Listen for download events to download files."""
download_path = config[DOMAIN][CONF_DOWNLOAD_DIR]

Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/duckdns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import voluptuous as vol

from homeassistant.const import CONF_ACCESS_TOKEN, CONF_DOMAIN
from homeassistant.core import CALLBACK_TYPE, ServiceCall, callback
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, ServiceCall, callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_call_later
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import bind_hass
from homeassistant.util import dt as dt_util

Expand Down Expand Up @@ -39,7 +40,7 @@
SERVICE_TXT_SCHEMA = vol.Schema({vol.Required(ATTR_TXT): vol.Any(None, cv.string)})


async def async_setup(hass, config):
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Initialize the DuckDNS component."""
domain = config[DOMAIN][CONF_DOMAIN]
token = config[DOMAIN][CONF_ACCESS_TOKEN]
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/dweet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
EVENT_STATE_CHANGED,
STATE_UNKNOWN,
)
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
from homeassistant.util import Throttle

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


def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Dweet.io component."""
conf = config[DOMAIN]
name = conf.get(CONF_NAME)
Expand Down