mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Adjust device_automation type hints in webostv (#72200)
This commit is contained in:
parent
a57697d6e9
commit
7005526892
@ -7,7 +7,10 @@ from homeassistant.components.automation import (
|
|||||||
AutomationActionType,
|
AutomationActionType,
|
||||||
AutomationTriggerInfo,
|
AutomationTriggerInfo,
|
||||||
)
|
)
|
||||||
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
|
from homeassistant.components.device_automation import (
|
||||||
|
DEVICE_TRIGGER_BASE_SCHEMA,
|
||||||
|
GetAutomationsResult,
|
||||||
|
)
|
||||||
from homeassistant.components.device_automation.exceptions import (
|
from homeassistant.components.device_automation.exceptions import (
|
||||||
InvalidDeviceAutomationConfig,
|
InvalidDeviceAutomationConfig,
|
||||||
)
|
)
|
||||||
@ -58,7 +61,7 @@ async def async_validate_trigger_config(
|
|||||||
|
|
||||||
async def async_get_triggers(
|
async def async_get_triggers(
|
||||||
_hass: HomeAssistant, device_id: str
|
_hass: HomeAssistant, device_id: str
|
||||||
) -> list[dict[str, str]]:
|
) -> GetAutomationsResult:
|
||||||
"""List device triggers for device."""
|
"""List device triggers for device."""
|
||||||
triggers = []
|
triggers = []
|
||||||
base_trigger = {
|
base_trigger = {
|
||||||
@ -77,7 +80,7 @@ async def async_attach_trigger(
|
|||||||
config: ConfigType,
|
config: ConfigType,
|
||||||
action: AutomationActionType,
|
action: AutomationActionType,
|
||||||
automation_info: AutomationTriggerInfo,
|
automation_info: AutomationTriggerInfo,
|
||||||
) -> CALLBACK_TYPE | None:
|
) -> CALLBACK_TYPE:
|
||||||
"""Attach a trigger."""
|
"""Attach a trigger."""
|
||||||
if (trigger_type := config[CONF_TYPE]) == TURN_ON_PLATFORM_TYPE:
|
if (trigger_type := config[CONF_TYPE]) == TURN_ON_PLATFORM_TYPE:
|
||||||
trigger_config = {
|
trigger_config = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user