mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Partially revert setup typing update (#110901)
This commit is contained in:
parent
3275b28e2a
commit
85864e77ac
@ -17,7 +17,13 @@ from .const import (
|
|||||||
PLATFORM_FORMAT,
|
PLATFORM_FORMAT,
|
||||||
Platform,
|
Platform,
|
||||||
)
|
)
|
||||||
from .core import CALLBACK_TYPE, DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant, callback
|
from .core import (
|
||||||
|
CALLBACK_TYPE,
|
||||||
|
DOMAIN as HOMEASSISTANT_DOMAIN,
|
||||||
|
Event,
|
||||||
|
HomeAssistant,
|
||||||
|
callback,
|
||||||
|
)
|
||||||
from .exceptions import DependencyError, HomeAssistantError
|
from .exceptions import DependencyError, HomeAssistantError
|
||||||
from .helpers.issue_registry import IssueSeverity, async_create_issue
|
from .helpers.issue_registry import IssueSeverity, async_create_issue
|
||||||
from .helpers.typing import ConfigType, EventType
|
from .helpers.typing import ConfigType, EventType
|
||||||
@ -528,7 +534,7 @@ def _async_when_setup(
|
|||||||
|
|
||||||
listeners: list[CALLBACK_TYPE] = []
|
listeners: list[CALLBACK_TYPE] = []
|
||||||
|
|
||||||
async def _matched_event(event: EventType[EventComponentLoaded]) -> None:
|
async def _matched_event(event: Event) -> None:
|
||||||
"""Call the callback when we matched an event."""
|
"""Call the callback when we matched an event."""
|
||||||
for listener in listeners:
|
for listener in listeners:
|
||||||
listener()
|
listener()
|
||||||
@ -542,13 +548,13 @@ def _async_when_setup(
|
|||||||
listeners.append(
|
listeners.append(
|
||||||
hass.bus.async_listen(
|
hass.bus.async_listen(
|
||||||
EVENT_COMPONENT_LOADED,
|
EVENT_COMPONENT_LOADED,
|
||||||
_matched_event, # type: ignore[arg-type]
|
_matched_event,
|
||||||
event_filter=_async_is_component_filter, # type: ignore[arg-type]
|
event_filter=_async_is_component_filter, # type: ignore[arg-type]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if start_event:
|
if start_event:
|
||||||
listeners.append(
|
listeners.append(
|
||||||
hass.bus.async_listen(EVENT_HOMEASSISTANT_START, _matched_event) # type: ignore[arg-type]
|
hass.bus.async_listen(EVENT_HOMEASSISTANT_START, _matched_event)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user