Allow overriding trigger runner helper

This commit is contained in:
abmantis
2025-10-01 16:24:50 +01:00
parent c3f45d594b
commit bdd448fbe0
4 changed files with 71 additions and 46 deletions

View File

@@ -23,8 +23,8 @@ from homeassistant.helpers.automation import move_top_level_schema_fields_to_opt
from homeassistant.helpers.trigger import (
DATA_PLUGGABLE_ACTIONS,
PluggableAction,
RunTriggerActionCallback,
Trigger,
TriggerActionRunnerType,
_async_get_trigger_platform,
async_initialize_triggers,
async_validate_trigger_config,
@@ -463,8 +463,8 @@ async def test_platform_multiple_triggers(hass: HomeAssistant) -> None:
class MockTrigger1(MockTrigger):
"""Mock trigger 1."""
async def async_attach(
self, run_action: TriggerActionRunnerType
async def async_attach_runner(
self, run_action: RunTriggerActionCallback
) -> CALLBACK_TYPE:
"""Attach a trigger."""
run_action("trigger 1 desc", {"extra": "test_trigger_1"})
@@ -472,8 +472,8 @@ async def test_platform_multiple_triggers(hass: HomeAssistant) -> None:
class MockTrigger2(MockTrigger):
"""Mock trigger 2."""
async def async_attach(
self, run_action: TriggerActionRunnerType
async def async_attach_runner(
self, run_action: RunTriggerActionCallback
) -> CALLBACK_TYPE:
"""Attach a trigger."""
run_action("trigger 2 desc", {"extra": "test_trigger_2"})