393 files

This commit is contained in:
Home Assistant Version Control
2026-09-27 17:16:54 +00:00
parent b05b7a897e
commit 39d97ac2db
404 changed files with 54006 additions and 11034 deletions
@@ -188,6 +188,16 @@ CONF_MEMBER_DISPLAY = "member_display"
# templates stay functional (direct WS calls still work); they are only
# removed from the pickers so a growing catalog never clutters the UI.
CONF_DISABLED_TEMPLATE_IDS = "disabled_template_ids"
# v2.93: the home profile's dwelling type — "auto" (guessed from the floor and
# area registries), "house" or "apartment". Drives the template gallery's
# recommendations only; see helpers/home_profile.py.
CONF_HOME_TYPE = "home_type"
HOME_TYPES = ("auto", "house", "apartment")
# 2.94: the state / province / region (ISO 3166-2, e.g. "US-NY") whose rules
# the templates follow — "auto" = looked up from the home location in
# data/regions (helpers/region.py). A code of another country is ignored.
CONF_HOME_REGION = "home_region"
HOME_REGION_AUTO = "auto"
# v2.24: saved filter views — named, shared combinations of the panel list's
# filters (status / user / archived) + sort + group-by that any user can apply
@@ -883,3 +893,24 @@ BATTERY_RECOVERED_PERCENT_RANGE: tuple[int, int] = (20, 100)
CONF_BATTERY_AUTO_RECORD_RECOVERY = "battery_auto_record_recovery"
# D#182: the shopping-search template is user-settable (max URL length).
MAX_PART_SEARCH_URL_TEMPLATE_LENGTH = 500
# --- Trigger / schedule field ranges (DRY audit 2026-09-26 B) ---
# ONE source for the numeric bounds the options-flow selectors, the WS trigger
# validator and the adopt endpoints spelled as literals (for_minutes 1440 x5,
# target changes 10 000 x3, runtime hours 100 000 x3, calendar offset +-15 x3,
# EWA alpha 0.1-0.9 x3). Inclusive (min, max). Keyed by the trigger_config
# storage key. The Python consumers (and helpers/schedule.py's offset clamp)
# are pinned by tests/test_dry_round4_interfaces.py; the TypeScript twins
# (frontend-src/helpers/setting-ranges.ts) by
# tests/test_frontend_const_parity.py::test_ts_field_ranges_match_backend.
TRIGGER_FIELD_RANGES: dict[str, tuple[int, int]] = {
"trigger_for_minutes": (0, 1440), # #136 hold time, one day at most
"trigger_target_changes": (1, 10_000),
}
# Runtime target hours: > 0 (the WS validator) / >= 1 (the flow selector).
TRIGGER_RUNTIME_HOURS_MAX = 100_000
# (#83) +-N-day shift of a calendar-kind occurrence ("2 days before the last
# working day") — bounded so a bogus payload cannot move a schedule by years.
SCHEDULE_OFFSET_MAX_DAYS = 15
# Adaptive scheduling smoothing factor (exponentially weighted average).
ADAPTIVE_EWA_ALPHA_RANGE: tuple[float, float] = (0.1, 0.9)