Adjust device_automation type hints in webostv (#72200)

This commit is contained in:
epenet 2022-05-19 21:33:01 +02:00 committed by GitHub
parent a57697d6e9
commit 7005526892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,10 @@ from homeassistant.components.automation import (
AutomationActionType,
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 (
InvalidDeviceAutomationConfig,
)
@ -58,7 +61,7 @@ async def async_validate_trigger_config(
async def async_get_triggers(
_hass: HomeAssistant, device_id: str
) -> list[dict[str, str]]:
) -> GetAutomationsResult:
"""List device triggers for device."""
triggers = []
base_trigger = {
@ -77,7 +80,7 @@ async def async_attach_trigger(
config: ConfigType,
action: AutomationActionType,
automation_info: AutomationTriggerInfo,
) -> CALLBACK_TYPE | None:
) -> CALLBACK_TYPE:
"""Attach a trigger."""
if (trigger_type := config[CONF_TYPE]) == TURN_ON_PLATFORM_TYPE:
trigger_config = {