Files
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

22 lines
854 B
Python

"""Provides conditions for lawn mowers."""
from homeassistant.core import HomeAssistant
from homeassistant.helpers.condition import Condition, make_entity_state_condition
from .const import DOMAIN, LawnMowerActivity
CONDITIONS: dict[str, type[Condition]] = {
"is_docked": make_entity_state_condition(DOMAIN, LawnMowerActivity.DOCKED),
"is_encountering_an_error": make_entity_state_condition(
DOMAIN, LawnMowerActivity.ERROR
),
"is_mowing": make_entity_state_condition(DOMAIN, LawnMowerActivity.MOWING),
"is_paused": make_entity_state_condition(DOMAIN, LawnMowerActivity.PAUSED),
"is_returning": make_entity_state_condition(DOMAIN, LawnMowerActivity.RETURNING),
}
async def async_get_conditions(hass: HomeAssistant) -> dict[str, type[Condition]]:
"""Return the conditions for lawn mowers."""
return CONDITIONS