1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-02-15 07:27:13 +00:00
Files
supervisor/tests
Stefan Agner b214d18f28 Cache Core config on startup and validate on Supervisor restart
Cache the Home Assistant Core configuration (components list) when Core
reaches RUNNING state in _block_till_run(), and clear it on stop or
before restart. This avoids repeated API/WebSocket calls to fetch the
config on every use.

The cached config is used in two places:
- Update verification: checks frontend component is loaded after update
  using cached config instead of a separate API call, with fallback to
  error state if cache is unavailable.
- Hardware events: checks USB component availability using cached config
  instead of a WebSocket round-trip on every device event.

Additionally, adds ensure_started() to HomeAssistantCore which validates
API readiness and populates cached state when Core is already running.
This is called on Supervisor restart to close a gap where Supervisor
had no health validation of Core and hardware events were silently
dropped because the config cache was never populated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:31:01 +01:00
..