mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Add typing of EVENT_COMPONENT_LOADED to integration_platform helper (#110826)
This commit is contained in:
parent
5d23a1f84f
commit
165d79b553
@ -10,16 +10,18 @@ from types import ModuleType
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import EVENT_COMPONENT_LOADED
|
from homeassistant.const import EVENT_COMPONENT_LOADED
|
||||||
from homeassistant.core import Event, HassJob, HomeAssistant, callback
|
from homeassistant.core import HassJob, HomeAssistant, callback
|
||||||
from homeassistant.loader import (
|
from homeassistant.loader import (
|
||||||
Integration,
|
Integration,
|
||||||
async_get_integrations,
|
async_get_integrations,
|
||||||
async_get_loaded_integration,
|
async_get_loaded_integration,
|
||||||
bind_hass,
|
bind_hass,
|
||||||
)
|
)
|
||||||
from homeassistant.setup import ATTR_COMPONENT
|
from homeassistant.setup import ATTR_COMPONENT, EventComponentLoaded
|
||||||
from homeassistant.util.logging import catch_log_exception
|
from homeassistant.util.logging import catch_log_exception
|
||||||
|
|
||||||
|
from .typing import EventType
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
DATA_INTEGRATION_PLATFORMS = "integration_platforms"
|
DATA_INTEGRATION_PLATFORMS = "integration_platforms"
|
||||||
|
|
||||||
@ -61,10 +63,12 @@ def _get_platform(
|
|||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_process_integration_platforms_for_component(
|
def _async_process_integration_platforms_for_component(
|
||||||
hass: HomeAssistant, integration_platforms: list[IntegrationPlatform], event: Event
|
hass: HomeAssistant,
|
||||||
|
integration_platforms: list[IntegrationPlatform],
|
||||||
|
event: EventType[EventComponentLoaded],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Process integration platforms for a component."""
|
"""Process integration platforms for a component."""
|
||||||
component_name: str = event.data[ATTR_COMPONENT]
|
component_name = event.data[ATTR_COMPONENT]
|
||||||
if "." in component_name:
|
if "." in component_name:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user