diff --git a/homeassistant/components/device_automation/trigger.py b/homeassistant/components/device_automation/trigger.py index 933c5c4c60a..e4a740d6599 100644 --- a/homeassistant/components/device_automation/trigger.py +++ b/homeassistant/components/device_automation/trigger.py @@ -1,4 +1,7 @@ """Offer device oriented automation.""" +from __future__ import annotations + +from collections.abc import Awaitable from typing import Protocol, cast import voluptuous as vol @@ -14,6 +17,8 @@ from homeassistant.helpers.typing import ConfigType from . import ( DEVICE_TRIGGER_BASE_SCHEMA, DeviceAutomationType, + GetAutomationCapabilitiesResult, + GetAutomationsResult, async_get_device_automation_platform, ) from .exceptions import InvalidDeviceAutomationConfig @@ -33,7 +38,6 @@ class DeviceAutomationTriggerProtocol(Protocol): self, hass: HomeAssistant, config: ConfigType ) -> ConfigType: """Validate config.""" - raise NotImplementedError async def async_attach_trigger( self, @@ -43,7 +47,16 @@ class DeviceAutomationTriggerProtocol(Protocol): automation_info: AutomationTriggerInfo, ) -> CALLBACK_TYPE: """Attach a trigger.""" - raise NotImplementedError + + def async_get_trigger_capabilities( + self, hass: HomeAssistant, config: ConfigType + ) -> GetAutomationCapabilitiesResult | Awaitable[GetAutomationCapabilitiesResult]: + """List trigger capabilities.""" + + def async_get_triggers( + self, hass: HomeAssistant, device_id: str + ) -> GetAutomationsResult | Awaitable[GetAutomationsResult]: + """List triggers.""" async def async_validate_trigger_config(