257 files

This commit is contained in:
Home Assistant Version Control
2026-10-02 16:06:24 +00:00
parent 7c55603942
commit c29f5cc088
258 changed files with 24621 additions and 3136 deletions
@@ -148,7 +148,9 @@ THRESHOLD_PERCENT_RANGE: tuple[int, int] = (1, 90)
# --- Config Keys: Advanced Feature Visibility ---
CONF_ADVANCED_ADAPTIVE = "advanced_adaptive_visible"
CONF_ADVANCED_PREDICTIONS = "advanced_predictions_visible"
# advanced_predictions_visible was removed in 2.96 (audit 2026-09-28): it never
# gated anything — sensor predictions are on for every sensor task and switched
# off per task (adaptive_config.sensor_prediction_enabled). Stored values are ignored.
CONF_ADVANCED_SEASONAL = "advanced_seasonal_visible"
CONF_ADVANCED_ENVIRONMENTAL = "advanced_environmental_visible"
CONF_ADVANCED_BUDGET = "advanced_budget_visible"
@@ -543,6 +545,7 @@ CONF_TRIGGER_TO_STATE = "trigger_to_state"
CONF_TRIGGER_TARGET_CHANGES = "trigger_target_changes"
CONF_TRIGGER_RUNTIME_HOURS = "trigger_runtime_hours"
CONF_TRIGGER_ON_STATES = "trigger_on_states"
CONF_TRIGGER_DAYS_BEFORE = "trigger_days_before"
# --- Config Keys: Adaptive Scheduling ---
CONF_ADAPTIVE_CONFIG = "adaptive_config"
@@ -599,6 +602,11 @@ CONF_BUDGET_CURRENCY = "budget_currency"
# Decimal places for every displayed amount — KPIs, budgets, costs in lists and
# reports, budget alerts, buy-task notes. 0 = whole numbers (the default).
CONF_CURRENCY_DECIMALS = "currency_decimals"
# #104: when the value of spare parts counts as spending — when they are
# bought (the buy reminder's cost; default, the behaviour so far) or when
# they are used (every completion books the parts it consumed).
CONF_PARTS_COST_MODE = "parts_cost_mode"
PARTS_COST_MODES = ("purchase", "use")
DEFAULT_CURRENCY_DECIMALS = 0
BUDGET_CURRENCIES: dict[str, str] = {
@@ -757,6 +765,9 @@ class TriggerType(StrEnum):
COUNTER = "counter"
STATE_CHANGE = "state_change"
RUNTIME = "runtime"
# A sensor that REPORTS the date the maintenance is due (a purifier's
# "filter change due" timestamp): fires N days before that date.
DUE_DATE = "due_date"
COMPOUND = "compound"
@@ -913,6 +924,8 @@ MAX_PART_SEARCH_URL_TEMPLATE_LENGTH = 500
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),
# due_date: fire this many days before the date the sensor reports.
"trigger_days_before": (0, 365),
}
# Runtime target hours: > 0 (the WS validator) / >= 1 (the flow selector).
TRIGGER_RUNTIME_HOURS_MAX = 100_000