1 """Provides device conditions for switches."""
3 from __future__
import annotations
5 import voluptuous
as vol
17 CONDITION_SCHEMA = toggle_entity.CONDITION_SCHEMA.extend(
18 {vol.Required(CONF_DOMAIN): DOMAIN}
24 hass: HomeAssistant, config: ConfigType
25 ) -> ConditionCheckerType:
26 """Evaluate state based on configuration."""
27 return toggle_entity.async_condition_from_config(hass, config)
31 hass: HomeAssistant, device_id: str
32 ) -> list[dict[str, str]]:
33 """List device conditions."""
34 return await toggle_entity.async_get_conditions(hass, device_id, DOMAIN)
38 hass: HomeAssistant, config: ConfigType
39 ) -> dict[str, vol.Schema]:
40 """List condition capabilities."""
41 return await toggle_entity.async_get_condition_capabilities(hass, config)
list[dict[str, str]] async_get_conditions(HomeAssistant hass, str device_id)
dict[str, vol.Schema] async_get_condition_capabilities(HomeAssistant hass, ConfigType config)
ConditionCheckerType async_condition_from_config(HomeAssistant hass, ConfigType config)