187 files

This commit is contained in:
Home Assistant Version Control
2026-09-03 17:54:35 +00:00
parent 16c9b4d7f4
commit d6413e19b5
187 changed files with 15542 additions and 2765 deletions
@@ -18,6 +18,7 @@ from ..const import (
UNAVAILABLE_STATES,
TriggerType,
)
from ..helpers.trigger_fallback import threshold_limits_overlap
from . import (
_get_object_entries,
)
@@ -191,6 +192,18 @@ def _validate_trigger_config(
_validate_combinator(trigger_config, errors)
_validate_trigger_values(trigger_type, trigger_config, errors)
# #156: the limits are OR-ed — below > above means every reading trips
# the trigger, so it can never recover (and never auto-completes).
if trigger_type == "threshold" and threshold_limits_overlap(
_coerce_number(trigger_config.get("trigger_above")),
_coerce_number(trigger_config.get("trigger_below")),
):
errors.append(
"trigger_config.trigger_below must not be higher than trigger_above: the limits are OR-ed, "
"so every reading would trigger the task and it could never recover. "
"Leave one of them empty."
)
# Runtime: validate trigger_on_states if provided
if trigger_type == "runtime":
on_states = trigger_config.get("trigger_on_states")