2196 Commits
Author SHA1 Message Date
Paulus SchoutsenandClaude Fable 5 53bc02a3aa sandbox: A-cluster bug fixes — router state ownership, teardown leaks, wire coercion
Fixes the correctness findings from plan-review-overhead §A (+E4), each
with a regression test:

- A2+A5: core now owns entry state on both router paths. The
  ConfigEntryRouter contract changes to raise ConfigEntryError on
  failure; core maps it to SETUP_ERROR (setup) or leaves the entry
  state untouched (refused unload — previously a refused unload was
  wrongly marked NOT_LOADED while the remote entry stayed loaded).
  Every SLF001 state poke moves out of router.py into
  config_entries.py, which owns ConfigEntry.
- A4: the router setup/unload branches now honor entry.setup_lock, so
  a direct async_setup during a reload can no longer run two
  entry_setup RPCs concurrently for one entry.
- A3: SandboxBridge.async_teardown sweeps _mirrored_services off
  hass.services — a respawned sandbox's re-registration was skipped by
  the has_service guard, leaving every call on a dead channel forever.
- A6: the sandbox translation overlay merges inside
  _async_get_component_strings before the title fallback, so a provider
  dict without "title" gets the catalog/integration.name fill-in;
  _TranslationCache._async_load returns to dev-identical.
- A7: proxy init + upsert share one _apply_description with symmetric
  clearing — a dropped device_class/device_info no longer sticks.
- A8: the frame-size cap is enforced on write too (both channel
  mirrors); an oversize payload fails its own call with
  FrameTooLargeError (oversize replies come back as error frames)
  instead of making the peer abort the whole channel.
- A1: state-attribute pushes run through json_safe — a datetime
  attribute raised ValueError inside the fire-and-forget push task and
  left main's proxy permanently stale. Main-side service_data/query
  args get the same coercion (_wire_safe) before dict_to_struct.
- E4: FlowRunner.async_stop now stops the private hass (executor +
  timer leak per in-process sandbox), and InProcessSandbox.stop runs
  the graceful sandbox/shutdown first, like production.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCotUYum6AoisyrxshoiJJ
2026-07-07 15:50:43 -04:00
Paulus SchoutsenandClaude Opus 4.8 4c2feccd78 sandbox: A2 — merge catalog into descriptions + title fallback
Wire the A1 catalog hook into the two display paths a sandbox-only custom
falls through today:

- async_get_integration_descriptions (loader.py): append catalog
  descriptors to the custom integration/helper buckets so the add-
  integration picker lists them. On-disk customs carry richer metadata,
  so the disk scan wins on a domain collision.
- _async_get_component_strings (helpers/translation.py): when a domain
  has no on-disk Integration (IntegrationNotFound on main), take its
  "title" from the catalog — a localized title_translations[lang] if
  present, otherwise degrading to the descriptor name.

Tests: catalog entry appears in descriptions with picker name + defaults
+ helper-bucket routing; on-disk custom wins a collision; title fallback
uses title_translations and degrades to name when absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 15:12:23 -04:00
Paulus SchoutsenandClaude Opus 4.8 d955595517 sandbox: B3 — core translation provider hook + overlay + invalidation
Add a sandbox-agnostic seam to the translation cache, mirroring the
sandbox.sources source-resolver convention:

- async_register_sandbox_translation_provider(hass, provider): a HassKey-backed
  registry with an unregister callback. The provider is awaited inside the
  cache load and returns {language: {domain: raw_strings}} for only the domains
  it owns.
- _TranslationCache._async_load overlays the provider result onto
  translation_by_language_strings after async_get_integrations and before
  _build_category_cache, so sandboxed strings flow through the same flatten /
  English-fallback / loaded machinery as on-disk strings. A custom sandboxed
  domain (IntegrationNotFound on main) thus stops resolving to {}.
- _TranslationCache.async_invalidate + async_invalidate_translations wrapper:
  the first eviction API (translations were never unloaded), called by the
  sandbox when a custom integration is re-fetched at a new ref.

Core never raises on a provider; degrade-to-empty is the provider's contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 15:12:23 -04:00
G JohanssonandGitHub d79653b288 Remove deprecated classes from Service (#175611) 2026-07-05 13:23:19 -04:00
005af60478 Lazy media source platforms (#174375)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 10:36:00 -05:00
631179dffe Skip compressing HTTP JSON responses below 1 KiB (#175560)
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-03 23:02:32 +02:00
7dac0506d3 Make LLMContext.assistant a required non-optional field (#175553)
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-03 15:54:54 -04:00
Franck NijhofandGitHub 353043c537 Pin recently compiled template code objects in a bounded LRU (#175399) 2026-07-03 01:25:21 +02:00
Erik MontnemeryandGitHub 16a6824799 Report errors in numerical entity triggers (#175093) 2026-06-30 15:08:44 +01:00
de6b679e6e Rewrite homeassistant started trigger (#175160)
Co-authored-by: Artur Pragacz <49985303+arturpragacz@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-30 10:27:31 +02:00
Erik MontnemeryandGitHub 34679b033a Improve tests of entity limits (#174793) 2026-06-25 20:23:50 +02:00
Nicolas MowenandGitHub 10ce428387 Handle case where GetLiveContext includes an entity with StrEnum key (#174822) 2026-06-25 19:53:32 +02:00
Martin HjelmareandGitHub c9d91d5812 Add enabled entity limit per config entry (#174194) 2026-06-24 16:07:54 +02:00
Erik MontnemeryandGitHub de9d9c66c1 Add additional sun conditions (#174537) 2026-06-24 16:00:08 +02:00
Paul BotteinandGitHub dfcc4d1ae4 Fix friendly name for restored unavailable entities (#174614) 2026-06-24 14:47:39 +01:00
c542f38387 Add checks for did_not_trigger calls to trigger tests (#174636)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 13:05:08 +01:00
Erik MontnemeryandGitHub e8824bedf5 Add additional sun triggers (#174485) 2026-06-23 14:23:29 +02:00
91f4168439 Simplify sun entity (#174464)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2026-06-22 20:29:59 +02:00
Erik MontnemeryandGitHub b6b8391cbf Remove purpose-specific triggers and conditions from labs (#174450) 2026-06-22 16:58:51 +01:00
Erik MontnemeryandGitHub 16671e29d8 Trigger add did not trigger callback (#174116) 2026-06-22 10:54:16 +02:00
d782cd8289 Fix singleton leaving a dangling Event when wrapped coroutine raises (#174400)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 23:26:44 -04:00
ae8f689388 Lazily load system_health and hardware integration platforms (#174325)
Co-authored-by: Claude <noreply@anthropic.com>
2026-06-20 10:45:07 -04:00
05553090b9 Strict port matching for network URL helpers (#173657)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-20 10:29:31 -04:00
epenetandGitHub 3b25b4cfa6 Add service helper to get a single loaded config entry (#174190) 2026-06-19 13:01:07 +02:00
Erik MontnemeryandGitHub 605f69f056 Improve tests of helpers.trigger.extract_devices/entities (#172407) 2026-06-18 09:36:54 +02:00
Erik MontnemeryGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2f9d39827d Open repair issue when deprecated trigger behavior is used (#173259)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-18 09:36:02 +02:00
66f0f170b7 Add pylint naive_now checker (#174053)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2026-06-17 11:44:42 +02:00
Erik MontnemeryandGitHub 4ff5ee0520 Fix trigger first all race (#174078) 2026-06-16 22:00:03 +02:00
Erik MontnemeryandGitHub 9cd7ea97e9 Improve condition history manager (#174069) 2026-06-16 21:17:34 +02:00
Erik MontnemeryandGitHub e6b3a97162 Avoid flooding the recorder when priming condition history (#174020) 2026-06-16 17:06:34 +02:00
Erik MontnemeryandGitHub 6ad8ad5715 Call state change listeners immediately instead of deferring them to the event loop (#173974) 2026-06-16 16:50:32 +02:00
Erik MontnemeryandGitHub c544f95979 Prime condition durations from history (#173426) 2026-06-16 07:53:41 +02:00
Franck NijhofGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
047edc035d Skip literal_eval for template results that cannot be a Python literal (#173664)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-15 17:24:29 +02:00
f0d5d1d526 Add tests showing races in entity triggers (#173492)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-06-15 12:58:03 +02:00
Franck NijhofandGitHub 2a0b5ca895 Sort aliases in LLM prompts for stable prefix caching (#173558) 2026-06-12 18:56:38 +02:00
Franck NijhofandGitHub dadfea4d62 Return enum values from config_entry_attr template function (#173554) 2026-06-12 18:49:42 +02:00
d098622021 Return all matches for duplicate names in GetLiveContext (#173157)
Co-authored-by: Claude <noreply@anthropic.com>
2026-06-07 21:50:15 -04:00
42136f1464 Bubble up conversation response in script run (#173131)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-06 13:47:49 -04:00
Michael HansenandGitHub ba9248cc94 LLM: format numeric states with display precision (#173128) 2026-06-06 12:15:48 -04:00
Erik MontnemeryandGitHub 48a690b267 Derive zone entity state from person in_zones state attribute (#172942) 2026-06-05 08:12:22 +02:00
Erik MontnemeryandGitHub ffc6eeadc2 Always include template errors in trace (#172917) 2026-06-04 16:28:05 +02:00
WendelinandGitHub 16febb36ba Automation choose: Add optional note to options (#172837) 2026-06-03 10:12:52 +02:00
Erik MontnemeryandGitHub dd7bd0c8a4 Prevent log spam when WS subscribe_condition is active (#172832) 2026-06-03 10:10:30 +02:00
Erik MontnemeryandGitHub a17cfbc2a5 Make the renamed trigger behavior options backwards compatible (#172822) 2026-06-02 12:31:57 +02:00
epenetandGitHub cad177cdff Rename constant in reload helper test (#172711) 2026-06-01 20:46:42 +02:00
G JohanssonandGitHub 4d841e4d84 Update async_update_entity_platform to not allow loaded entities (#171773) 2026-05-28 18:17:23 +02:00
Erik MontnemeryandGitHub 5bb6b20641 Add zone entered left triggers (#172412) 2026-05-28 13:22:38 +02:00
Erik MontnemeryandGitHub d42d02f20a Revert "Add zone triggers entered/left zone" (#172409) 2026-05-28 10:32:28 +02:00
Erik MontnemeryandGitHub fd1a5d0c5a Add zone triggers entered/left zone (#171751) 2026-05-28 10:05:41 +02:00
Erik MontnemeryandGitHub 4bf3a5b4bd Adjust behavior of numerical condition and trigger between and outside (#172335) 2026-05-27 17:03:58 +02:00