mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Rename class; add doc
This commit is contained in:
@@ -237,7 +237,7 @@ class Trigger(abc.ABC):
|
||||
|
||||
@abc.abstractmethod
|
||||
async def async_attach_runner(
|
||||
self, run_action: TriggerActionRunnerCallback
|
||||
self, run_action: TriggerActionRunner
|
||||
) -> CALLBACK_TYPE:
|
||||
"""Attach the trigger to an action runner."""
|
||||
|
||||
@@ -277,7 +277,7 @@ class TriggerConfig:
|
||||
options: dict[str, Any] | None = None
|
||||
|
||||
|
||||
class TriggerActionRunnerCallback(Protocol):
|
||||
class TriggerActionRunner(Protocol):
|
||||
"""Protocol type for the trigger action runner helper callback."""
|
||||
|
||||
@callback
|
||||
@@ -287,7 +287,11 @@ class TriggerActionRunnerCallback(Protocol):
|
||||
extra_trigger_payload: dict[str, Any],
|
||||
context: Context | None = None,
|
||||
) -> asyncio.Future[Any] | None:
|
||||
"""Define trigger action runner type."""
|
||||
"""Define trigger action runner type.
|
||||
|
||||
:return: A future that allows awaiting for the action to finish if it is a
|
||||
coroutine, or None if it is a callback.
|
||||
"""
|
||||
|
||||
|
||||
class TriggerActionPayloadBuilder(Protocol):
|
||||
|
||||
Reference in New Issue
Block a user