Rename class; add doc

This commit is contained in:
abmantis
2025-10-02 16:19:41 +01:00
parent b8660b4248
commit 82f1ae3519
4 changed files with 16 additions and 20 deletions

View File

@@ -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):