mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 03:19:34 +00:00
Correct homeassistant.helpers.trigger._trigger_action_wrapper (#153983)
This commit is contained in:
@@ -169,7 +169,7 @@ class CalendarEventListener:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
job: HassJob[..., Coroutine[Any, Any, None]],
|
job: HassJob[..., Coroutine[Any, Any, None] | Any],
|
||||||
trigger_data: dict[str, Any],
|
trigger_data: dict[str, Any],
|
||||||
fetcher: QueuedEventFetcher,
|
fetcher: QueuedEventFetcher,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|||||||
@@ -260,11 +260,11 @@ class TriggerConfig:
|
|||||||
class TriggerActionType(Protocol):
|
class TriggerActionType(Protocol):
|
||||||
"""Protocol type for trigger action callback."""
|
"""Protocol type for trigger action callback."""
|
||||||
|
|
||||||
async def __call__(
|
def __call__(
|
||||||
self,
|
self,
|
||||||
run_variables: dict[str, Any],
|
run_variables: dict[str, Any],
|
||||||
context: Context | None = None,
|
context: Context | None = None,
|
||||||
) -> Any:
|
) -> Coroutine[Any, Any, Any] | Any:
|
||||||
"""Define action callback type."""
|
"""Define action callback type."""
|
||||||
|
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ class PluggableActionsEntry:
|
|||||||
actions: dict[
|
actions: dict[
|
||||||
object,
|
object,
|
||||||
tuple[
|
tuple[
|
||||||
HassJob[[dict[str, Any], Context | None], Coroutine[Any, Any, None]],
|
HassJob[[dict[str, Any], Context | None], Coroutine[Any, Any, None] | Any],
|
||||||
dict[str, Any],
|
dict[str, Any],
|
||||||
],
|
],
|
||||||
] = field(default_factory=dict)
|
] = field(default_factory=dict)
|
||||||
@@ -477,7 +477,7 @@ def _trigger_action_wrapper(
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
@functools.wraps(action)
|
@functools.wraps(action)
|
||||||
async def with_vars(
|
def with_vars(
|
||||||
run_variables: dict[str, Any], context: Context | None = None
|
run_variables: dict[str, Any], context: Context | None = None
|
||||||
) -> Any:
|
) -> Any:
|
||||||
"""Wrap action with extra vars."""
|
"""Wrap action with extra vars."""
|
||||||
|
|||||||
Reference in New Issue
Block a user