Files
core/homeassistant/components/timer/condition.py
T
Erik MontnemeryGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>frenck
05eeb6a1bc Enable duration support in all entity conditions (#169532)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-04-30 18:13:06 +02:00

18 lines
627 B
Python

"""Provides conditions for timers."""
from homeassistant.core import HomeAssistant
from homeassistant.helpers.condition import Condition, make_entity_state_condition
from . import DOMAIN, STATUS_ACTIVE, STATUS_IDLE, STATUS_PAUSED
CONDITIONS: dict[str, type[Condition]] = {
"is_active": make_entity_state_condition(DOMAIN, STATUS_ACTIVE),
"is_paused": make_entity_state_condition(DOMAIN, STATUS_PAUSED),
"is_idle": make_entity_state_condition(DOMAIN, STATUS_IDLE),
}
async def async_get_conditions(hass: HomeAssistant) -> dict[str, type[Condition]]:
"""Return the timer conditions."""
return CONDITIONS