Add typing of EVENT_COMPONENT_LOADED to integration_platform helper (#110826)
This commit is contained in:
parent
5d23a1f84f
commit
165d79b553
1 changed files with 8 additions and 4 deletions
|
@ -10,16 +10,18 @@ from types import ModuleType
|
|||
from typing import Any
|
||||
|
||||
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 (
|
||||
Integration,
|
||||
async_get_integrations,
|
||||
async_get_loaded_integration,
|
||||
bind_hass,
|
||||
)
|
||||
from homeassistant.setup import ATTR_COMPONENT
|
||||
from homeassistant.setup import ATTR_COMPONENT, EventComponentLoaded
|
||||
from homeassistant.util.logging import catch_log_exception
|
||||
|
||||
from .typing import EventType
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
DATA_INTEGRATION_PLATFORMS = "integration_platforms"
|
||||
|
||||
|
@ -61,10 +63,12 @@ def _get_platform(
|
|||
|
||||
@callback
|
||||
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:
|
||||
"""Process integration platforms for a component."""
|
||||
component_name: str = event.data[ATTR_COMPONENT]
|
||||
component_name = event.data[ATTR_COMPONENT]
|
||||
if "." in component_name:
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue