1 """Provides device automations for Fan."""
3 from __future__
import annotations
5 import voluptuous
as vol
15 TRIGGER_SCHEMA = vol.All(
16 toggle_entity.TRIGGER_SCHEMA,
17 vol.Schema({vol.Required(CONF_DOMAIN): DOMAIN}, extra=vol.ALLOW_EXTRA),
22 hass: HomeAssistant, device_id: str
23 ) -> list[dict[str, str]]:
24 """List device triggers for Fan devices."""
25 return await toggle_entity.async_get_triggers(hass, device_id, DOMAIN)
29 hass: HomeAssistant, config: ConfigType
30 ) -> dict[str, vol.Schema]:
31 """List trigger capabilities."""
32 return await toggle_entity.async_get_trigger_capabilities(hass, config)
38 action: TriggerActionType,
39 trigger_info: TriggerInfo,
41 """Listen for state changes based on configuration."""
42 return await toggle_entity.async_attach_trigger(hass, config, action, trigger_info)
CALLBACK_TYPE async_attach_trigger(HomeAssistant hass, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
list[dict[str, str]] async_get_triggers(HomeAssistant hass, str device_id)
dict[str, vol.Schema] async_get_trigger_capabilities(HomeAssistant hass, ConfigType config)