Automation trigger info type hint improvements (#55402)

* Make automation trigger info a TypedDict

* zwave_js trigger type hint fixes

* Remove redundant automation trigger info field presence checks

* Use async_initialize_triggers in mqtt and tasmota device_trigger tests
This commit is contained in:
Ville Skyttä 2021-09-04 03:25:51 +03:00 committed by GitHub
parent 0749e045bb
commit b10fc89a6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 344 additions and 210 deletions

View file

@ -5,7 +5,10 @@ from typing import Any
import voluptuous as vol
from homeassistant.components.automation import AutomationActionType
from homeassistant.components.automation import (
AutomationActionType,
AutomationTriggerInfo,
)
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
from homeassistant.components.homeassistant.triggers import state
from homeassistant.const import (
@ -71,7 +74,7 @@ async def async_attach_trigger(
hass: HomeAssistant,
config: ConfigType,
action: AutomationActionType,
automation_info: dict,
automation_info: AutomationTriggerInfo,
) -> CALLBACK_TYPE:
"""Attach a trigger."""
# TODO Implement your own logic to attach triggers.