Adjust device_automation type hints in core platforms 2/3 (#72210)

This commit is contained in:
epenet 2022-05-23 16:02:36 +02:00 committed by GitHub
parent b10ee779f9
commit 3a0e816f1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 38 additions and 28 deletions

View file

@ -6,6 +6,7 @@ import voluptuous as vol
from homeassistant.components.device_automation import toggle_entity
from homeassistant.const import CONF_DOMAIN
from homeassistant.core import Context, HomeAssistant
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
from . import DOMAIN
@ -20,7 +21,10 @@ async def async_get_actions(
async def async_call_action_from_config(
hass: HomeAssistant, config: dict, variables: dict, context: Context | None
hass: HomeAssistant,
config: ConfigType,
variables: TemplateVarsType,
context: Context | None,
) -> None:
"""Execute a device action."""
await toggle_entity.async_call_action_from_config(

View file

@ -1,8 +1,6 @@
"""Provides device automations for Fan."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant.components.automation import (
@ -24,7 +22,7 @@ TRIGGER_SCHEMA = vol.All(
async def async_get_triggers(
hass: HomeAssistant, device_id: str
) -> list[dict[str, Any]]:
) -> list[dict[str, str]]:
"""List device triggers for Fan devices."""
return await toggle_entity.async_get_triggers(hass, device_id, DOMAIN)