Use TriggerActionType [core, a-d] (#76803)

This commit is contained in:
Marc Mueller 2022-08-15 17:44:12 +02:00 committed by GitHub
parent 1ebac6c7ca
commit 19cf6089d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 44 deletions

View file

@ -3,10 +3,6 @@ from __future__ import annotations
import voluptuous as vol
from homeassistant.components.automation import (
AutomationActionType,
AutomationTriggerInfo,
)
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
from homeassistant.components.homeassistant.triggers.state import (
async_attach_trigger as async_attach_state_trigger,
@ -21,6 +17,7 @@ from homeassistant.const import (
)
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_registry
from homeassistant.helpers.trigger import TriggerActionType, TriggerInfo
from homeassistant.helpers.typing import ConfigType
from .const import DOMAIN
@ -56,8 +53,8 @@ async def async_get_triggers(
async def async_attach_trigger(
hass: HomeAssistant,
config: ConfigType,
action: AutomationActionType,
automation_info: AutomationTriggerInfo,
action: TriggerActionType,
trigger_info: TriggerInfo,
) -> CALLBACK_TYPE:
"""Attach a trigger."""
state_config = {
@ -67,5 +64,5 @@ async def async_attach_trigger(
state_config = await async_validate_state_trigger_config(hass, state_config)
return await async_attach_state_trigger(
hass, state_config, action, automation_info, platform_type="device"
hass, state_config, action, trigger_info, platform_type="device"
)