WHY: any single typed fetch failure was a failed pass, so the whole board flipped unavailable on one dropped poll and stayed dark until the API answered again — even though HA's coordinator machinery keeps the last good data on a failed pass and the panel could safely keep rendering it for a while. The coordinator now caches every successful snapshot with its time.monotonic stamp; while the elapsed time since the last success is within the configured staleness threshold (CONF_SNAPSHOT_STALENESS, seconds, default 3x the update interval = 900 s) a typed failure serves that cache instead: the panel keeps rendering last-good data, entities stay available, and the outage is logged as a clear warning. Past the threshold — or before the first success — the pass fails as before (typed error logged and chained into UpdateFailed); a later successful fetch refreshes the cache and the entities recover with no config-entry reload. The threshold rides the options flow (validated as a positive int at least the update interval, with a dedicated error string) and the strings files; the clock is read through a _monotonic seam so the staleness tests drive it deterministically.
43 lines
1.6 KiB
JSON
43 lines
1.6 KiB
JSON
{
|
|
"title": "NestQuest",
|
|
"config": {
|
|
"step": {
|
|
"user": {
|
|
"title": "Add NestQuest",
|
|
"description": "Set up NestQuest to start coordinating the household. No additional configuration is required."
|
|
}
|
|
},
|
|
"abort": {
|
|
"single_instance_allowed": "NestQuest is already configured. Only a single instance is allowed."
|
|
},
|
|
"create_entry": {
|
|
"default": "NestQuest was successfully configured."
|
|
}
|
|
},
|
|
"options": {
|
|
"step": {
|
|
"init": {
|
|
"title": "NestQuest Settings",
|
|
"description": "Adjust how NestQuest plans, rolls over days, idles its panel, and reaches the NestQuest API service.",
|
|
"data": {
|
|
"horizon_days": "Generation horizon (days)",
|
|
"day_rollover_time": "Day rollover time (HH:MM)",
|
|
"panel_idle_timeout": "Panel idle timeout (seconds)",
|
|
"snapshot_staleness": "Last-good snapshot staleness (seconds)",
|
|
"api_base_url": "NestQuest API base URL (http://host:port)",
|
|
"panel_token": "Panel service token",
|
|
"admin_user_ids": "Admin users (parents)"
|
|
}
|
|
}
|
|
},
|
|
"errors": {
|
|
"invalid": "Invalid value.",
|
|
"invalid_time": "Time must use 24-hour HH:MM format.",
|
|
"invalid_url": "Enter the API base URL as a full http:// or https:// URL with a host.",
|
|
"invalid_staleness": "Last-good snapshot staleness must be at least the update interval.",
|
|
"no_admins": "Select at least one admin user; an empty allowlist would lock everyone out.",
|
|
"invalid_admin": "Invalid admin selection."
|
|
}
|
|
}
|
|
}
|