Integrations: HomeAssistantType --> HomeAssistant. Last batch. (#49591)
parent
968460099a
commit
d168749a51
homeassistant/components
garmin_connect
gpslogger
gtfs
|
@ -13,7 +13,7 @@ from garminconnect import (
|
|||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_ID
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .alarm_util import calculate_next_active_alarms
|
||||
from .const import ATTRIBUTION, DOMAIN, GARMIN_ENTITY_LIST
|
||||
|
@ -22,7 +22,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities
|
||||
) -> None:
|
||||
"""Set up Garmin Connect sensor based on a config entry."""
|
||||
garmin_data = hass.data[DOMAIN][entry.entry_id]
|
||||
|
|
|
@ -19,7 +19,7 @@ from homeassistant.const import (
|
|||
CONF_USERNAME,
|
||||
TEMP_CELSIUS,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.discovery import async_load_platform
|
||||
|
@ -30,7 +30,7 @@ from homeassistant.helpers.dispatcher import (
|
|||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.event import async_track_time_interval
|
||||
from homeassistant.helpers.service import verify_domain_control
|
||||
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -96,7 +96,7 @@ SET_ZONE_OVERRIDE_SCHEMA = vol.Schema(
|
|||
)
|
||||
|
||||
|
||||
async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Create a Genius Hub system."""
|
||||
hass.data[DOMAIN] = {}
|
||||
|
||||
|
@ -129,7 +129,7 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
|||
|
||||
|
||||
@callback
|
||||
def setup_service_functions(hass: HomeAssistantType, broker):
|
||||
def setup_service_functions(hass: HomeAssistant, broker):
|
||||
"""Set up the service functions."""
|
||||
|
||||
@verify_domain_control(hass, DOMAIN)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""Support for Genius Hub binary_sensor devices."""
|
||||
from homeassistant.components.binary_sensor import BinarySensorEntity
|
||||
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from . import DOMAIN, GeniusDevice
|
||||
|
||||
|
@ -8,7 +9,7 @@ GH_STATE_ATTR = "outputOnOff"
|
|||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
|
||||
hass: HomeAssistant, config: ConfigType, async_add_entities, discovery_info=None
|
||||
) -> None:
|
||||
"""Set up the Genius Hub sensor entities."""
|
||||
if discovery_info is None:
|
||||
|
|
|
@ -13,7 +13,8 @@ from homeassistant.components.climate.const import (
|
|||
SUPPORT_PRESET_MODE,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
)
|
||||
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from . import DOMAIN, GeniusHeatingZone
|
||||
|
||||
|
@ -28,7 +29,7 @@ GH_ZONES = ["radiator", "wet underfloor"]
|
|||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
|
||||
hass: HomeAssistant, config: ConfigType, async_add_entities, discovery_info=None
|
||||
) -> None:
|
||||
"""Set up the Genius Hub climate entities."""
|
||||
if discovery_info is None:
|
||||
|
|
|
@ -6,7 +6,8 @@ from typing import Any
|
|||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
|
||||
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from . import DOMAIN, GeniusDevice, GeniusEntity
|
||||
|
@ -21,7 +22,7 @@ GH_LEVEL_MAPPING = {
|
|||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
|
||||
hass: HomeAssistant, config: ConfigType, async_add_entities, discovery_info=None
|
||||
) -> None:
|
||||
"""Set up the Genius Hub sensor entities."""
|
||||
if discovery_info is None:
|
||||
|
|
|
@ -5,8 +5,9 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.switch import DEVICE_CLASS_OUTLET, SwitchEntity
|
||||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import config_validation as cv, entity_platform
|
||||
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from . import ATTR_DURATION, DOMAIN, GeniusZone
|
||||
|
||||
|
@ -26,7 +27,7 @@ SET_SWITCH_OVERRIDE_SCHEMA = vol.Schema(
|
|||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
|
||||
hass: HomeAssistant, config: ConfigType, async_add_entities, discovery_info=None
|
||||
) -> None:
|
||||
"""Set up the Genius Hub switch entities."""
|
||||
if discovery_info is None:
|
||||
|
|
|
@ -7,7 +7,8 @@ from homeassistant.components.water_heater import (
|
|||
WaterHeaterEntity,
|
||||
)
|
||||
from homeassistant.const import STATE_OFF
|
||||
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from . import DOMAIN, GeniusHeatingZone
|
||||
|
||||
|
@ -32,7 +33,7 @@ GH_HEATERS = ["hot water temperature"]
|
|||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
|
||||
hass: HomeAssistant, config: ConfigType, async_add_entities, discovery_info=None
|
||||
) -> None:
|
||||
"""Set up the Genius Hub water_heater entities."""
|
||||
if discovery_info is None:
|
||||
|
|
|
@ -7,11 +7,10 @@ from homeassistant.const import (
|
|||
ATTR_LATITUDE,
|
||||
ATTR_LONGITUDE,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers import device_registry
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
from . import DOMAIN as GPL_DOMAIN, TRACKER_UPDATE
|
||||
from .const import (
|
||||
|
@ -23,7 +22,7 @@ from .const import (
|
|||
)
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistantType, entry, async_add_entities):
|
||||
async def async_setup_entry(hass: HomeAssistant, entry, async_add_entities):
|
||||
"""Configure a dispatcher connection based on a config entry."""
|
||||
|
||||
@callback
|
||||
|
|
|
@ -19,12 +19,9 @@ from homeassistant.const import (
|
|||
DEVICE_CLASS_TIMESTAMP,
|
||||
STATE_UNKNOWN,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.typing import (
|
||||
ConfigType,
|
||||
DiscoveryInfoType,
|
||||
HomeAssistantType,
|
||||
)
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
from homeassistant.util import slugify
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
|
@ -482,7 +479,7 @@ def get_next_departure(
|
|||
|
||||
|
||||
def setup_platform(
|
||||
hass: HomeAssistantType,
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
add_entities: Callable[[list], None],
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
|
|
|
@ -24,7 +24,6 @@ from homeassistant.core import DOMAIN as HASS_DOMAIN, Config, HomeAssistant, cal
|
|||
from homeassistant.exceptions import HomeAssistantError
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.device_registry import DeviceRegistry, async_get_registry
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
from homeassistant.loader import bind_hass
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
@ -152,7 +151,7 @@ MAP_SERVICE_API = {
|
|||
|
||||
|
||||
@bind_hass
|
||||
async def async_get_addon_info(hass: HomeAssistantType, slug: str) -> dict:
|
||||
async def async_get_addon_info(hass: HomeAssistant, slug: str) -> dict:
|
||||
"""Return add-on info.
|
||||
|
||||
The caller of the function should handle HassioAPIError.
|
||||
|
@ -162,7 +161,7 @@ async def async_get_addon_info(hass: HomeAssistantType, slug: str) -> dict:
|
|||
|
||||
|
||||
@bind_hass
|
||||
async def async_update_diagnostics(hass: HomeAssistantType, diagnostics: bool) -> dict:
|
||||
async def async_update_diagnostics(hass: HomeAssistant, diagnostics: bool) -> dict:
|
||||
"""Update Supervisor diagnostics toggle.
|
||||
|
||||
The caller of the function should handle HassioAPIError.
|
||||
|
@ -173,7 +172,7 @@ async def async_update_diagnostics(hass: HomeAssistantType, diagnostics: bool) -
|
|||
|
||||
@bind_hass
|
||||
@api_data
|
||||
async def async_install_addon(hass: HomeAssistantType, slug: str) -> dict:
|
||||
async def async_install_addon(hass: HomeAssistant, slug: str) -> dict:
|
||||
"""Install add-on.
|
||||
|
||||
The caller of the function should handle HassioAPIError.
|
||||
|
@ -185,7 +184,7 @@ async def async_install_addon(hass: HomeAssistantType, slug: str) -> dict:
|
|||
|
||||
@bind_hass
|
||||
@api_data
|
||||
async def async_uninstall_addon(hass: HomeAssistantType, slug: str) -> dict:
|
||||
async def async_uninstall_addon(hass: HomeAssistant, slug: str) -> dict:
|
||||
"""Uninstall add-on.
|
||||
|
||||
The caller of the function should handle HassioAPIError.
|
||||
|
@ -197,7 +196,7 @@ async def async_uninstall_addon(hass: HomeAssistantType, slug: str) -> dict:
|
|||
|
||||
@bind_hass
|
||||
@api_data
|
||||
async def async_update_addon(hass: HomeAssistantType, slug: str) -> dict:
|
||||
async def async_update_addon(hass: HomeAssistant, slug: str) -> dict:
|
||||
"""Update add-on.
|
||||
|
||||
The caller of the function should handle HassioAPIError.
|
||||
|
@ -209,7 +208,7 @@ async def async_update_addon(hass: HomeAssistantType, slug: str) -> dict:
|
|||
|
||||
@bind_hass
|
||||
@api_data
|
||||
async def async_start_addon(hass: HomeAssistantType, slug: str) -> dict:
|
||||
async def async_start_addon(hass: HomeAssistant, slug: str) -> dict:
|
||||
"""Start add-on.
|
||||
|
||||
The caller of the function should handle HassioAPIError.
|
||||
|
@ -221,7 +220,7 @@ async def async_start_addon(hass: HomeAssistantType, slug: str) -> dict:
|
|||
|
||||
@bind_hass
|
||||
@api_data
|
||||
async def async_stop_addon(hass: HomeAssistantType, slug: str) -> dict:
|
||||
async def async_stop_addon(hass: HomeAssistant, slug: str) -> dict:
|
||||
"""Stop add-on.
|
||||
|
||||
The caller of the function should handle HassioAPIError.
|
||||
|
@ -234,7 +233,7 @@ async def async_stop_addon(hass: HomeAssistantType, slug: str) -> dict:
|
|||
@bind_hass
|
||||
@api_data
|
||||
async def async_set_addon_options(
|
||||
hass: HomeAssistantType, slug: str, options: dict
|
||||
hass: HomeAssistant, slug: str, options: dict
|
||||
) -> dict:
|
||||
"""Set add-on options.
|
||||
|
||||
|
@ -246,9 +245,7 @@ async def async_set_addon_options(
|
|||
|
||||
|
||||
@bind_hass
|
||||
async def async_get_addon_discovery_info(
|
||||
hass: HomeAssistantType, slug: str
|
||||
) -> dict | None:
|
||||
async def async_get_addon_discovery_info(hass: HomeAssistant, slug: str) -> dict | None:
|
||||
"""Return discovery data for an add-on."""
|
||||
hassio = hass.data[DOMAIN]
|
||||
data = await hassio.retrieve_discovery_messages()
|
||||
|
@ -259,7 +256,7 @@ async def async_get_addon_discovery_info(
|
|||
@bind_hass
|
||||
@api_data
|
||||
async def async_create_snapshot(
|
||||
hass: HomeAssistantType, payload: dict, partial: bool = False
|
||||
hass: HomeAssistant, payload: dict, partial: bool = False
|
||||
) -> dict:
|
||||
"""Create a full or partial snapshot.
|
||||
|
||||
|
@ -536,9 +533,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||
return True
|
||||
|
||||
|
||||
async def async_unload_entry(
|
||||
hass: HomeAssistantType, config_entry: ConfigEntry
|
||||
) -> bool:
|
||||
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
|
||||
"""Unload a config entry."""
|
||||
unload_ok = all(
|
||||
await asyncio.gather(
|
||||
|
|
|
@ -6,7 +6,7 @@ from aiohttp import web
|
|||
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.const import ATTR_ICON, HTTP_BAD_REQUEST
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .const import ATTR_ADMIN, ATTR_ENABLE, ATTR_PANELS, ATTR_TITLE
|
||||
from .handler import HassioAPIError
|
||||
|
@ -14,7 +14,7 @@ from .handler import HassioAPIError
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def async_setup_addon_panel(hass: HomeAssistantType, hassio):
|
||||
async def async_setup_addon_panel(hass: HomeAssistant, hassio):
|
||||
"""Add-on Ingress Panel setup."""
|
||||
hassio_addon_panel = HassIOAddonPanel(hass, hassio)
|
||||
hass.http.register_view(hassio_addon_panel)
|
||||
|
|
|
@ -13,9 +13,8 @@ from homeassistant.components.http import HomeAssistantView
|
|||
from homeassistant.components.http.const import KEY_HASS_USER
|
||||
from homeassistant.components.http.data_validator import RequestDataValidator
|
||||
from homeassistant.const import HTTP_OK
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
from .const import ATTR_ADDON, ATTR_PASSWORD, ATTR_USERNAME
|
||||
|
||||
|
@ -23,7 +22,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
|
||||
@callback
|
||||
def async_setup_auth_view(hass: HomeAssistantType, user: User):
|
||||
def async_setup_auth_view(hass: HomeAssistant, user: User):
|
||||
"""Auth setup."""
|
||||
hassio_auth = HassIOAuth(hass, user)
|
||||
hassio_password_reset = HassIOPasswordReset(hass, user)
|
||||
|
@ -35,7 +34,7 @@ def async_setup_auth_view(hass: HomeAssistantType, user: User):
|
|||
class HassIOBaseAuth(HomeAssistantView):
|
||||
"""Hass.io view to handle auth requests."""
|
||||
|
||||
def __init__(self, hass: HomeAssistantType, user: User):
|
||||
def __init__(self, hass: HomeAssistant, user: User):
|
||||
"""Initialize WebView."""
|
||||
self.hass = hass
|
||||
self.user = user
|
||||
|
|
|
@ -12,8 +12,7 @@ from aiohttp.web_exceptions import HTTPBadGateway
|
|||
from multidict import CIMultiDict
|
||||
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
||||
from .const import X_HASSIO, X_INGRESS_PATH
|
||||
|
||||
|
@ -21,7 +20,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
|
||||
@callback
|
||||
def async_setup_ingress_view(hass: HomeAssistantType, host: str):
|
||||
def async_setup_ingress_view(hass: HomeAssistant, host: str):
|
||||
"""Auth setup."""
|
||||
websession = hass.helpers.aiohttp_client.async_get_clientsession()
|
||||
|
||||
|
|
Loading…
Reference in New Issue