Commit Graph
16400 Commits
Author SHA1 Message Date
Kevin Ahrendt b7b607ad69 [voice_assistant] Note the background task exception in the threading comment
model_load_task is declared below the comment and runs off the main loop, so the
blanket main-loop-only claim was wrong for it.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt e5b425bc6a [voice_assistant] Add unit tests for runtime model config handling
Covers the two Python behaviours a build YAML cannot: the conditional AUTO_LOAD
that keeps sha256 and json out of builds that do not download models, and the
validator rejecting http_request_id without micro_wake_word.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt 757f7aee4f [micro_wake_word] Own the enabled-state preference key
voice_assistant derived the same fnv1_hash(id) key independently to restore
downloaded models, with nothing tying the two together. Expose the derivation as
WakeWordModel::enabled_preference_key so the component that owns the persistence
format owns the key too.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt 398f29dced [voice_assistant] Reject external wake words without a usable model hash
equals_hex needs exactly 64 hex characters, so an empty or truncated model_hash
downloaded the whole model and then failed with a hash mismatch, which points at
a corrupt download rather than a missing field. Skip the entry when it is
cached instead.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt 2b01e48d1b [voice_assistant] Do not enable internal-only wake words on request
The disable-all loop iterates get_wake_words(), which filters out internal-only
models, but the enable path uses get_model_by_id(), which does not. Enabling one
from a set_configuration request left it active with no way to turn it off short
of a reboot.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt 68aa3b87aa [voice_assistant] Read the enabled preference without allocating a backend
make_preference allocates a backend that ESPPreferenceObject never frees, and
restore_runtime_models_ runs for every advertised model on every configuration
request Home Assistant sends. Use load_from_key for the read instead.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt 2c3867dbdb [voice_assistant] Check for an already loaded model before building one
A WakeWordModel claims a preference backend that is never released, so a model
built only to be rejected by add_runtime_model() costs internal RAM that never
comes back. The duplicate case is expected here, since a config change can
re-queue a download that is already in flight.

Move the check above the construction. The id was free a moment earlier and
this runs on the main loop, so a failed add is now always a genuine failure.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt b26f6e79e1 [voice_assistant] Prepend the model URL prefix in place
clang-tidy's performance-inefficient-string-concatenation flags building
the absolute URL with operator+, which allocates a temporary for the
prefix and another for the result. Insert the prefix instead.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt aedc5f2f28 [voice_assistant] Handle downloads without a content length
A chunked response reports no usable content length, 0 on ESP-IDF and
SIZE_MAX on Arduino, so both the manifest and the model were rejected.

Bound the model read by the size Home Assistant advertised, falling back
to the content length when it advertised none, and read a manifest of
unknown length up to the existing cap. The read still has to deliver the
expected number of bytes, and the SHA256 check is unchanged.

Also move http_request_ out of the block documented as main loop only,
since the download task uses it.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt 6b180f7be9 [voice_assistant] Use starts_with for the model URL check
clang-tidy's modernize-use-starts-ends-with flags the compare calls.
2026-08-10 08:11:47 -04:00
Kevin Ahrendt 5a429696c0 Remove non-existant external wake words feature flags 2026-08-10 08:11:47 -04:00
Kevin Ahrendt be2b2920c8 Clean up comments
- Remove unnecessary ones that are self-explanaied by the code
- Reduce verbosity
2026-08-10 08:11:47 -04:00
Kevin Ahrendt 046d030d36 [voice_assistant] Download wake word models advertised by Home Assistant
Home Assistant sends the list of external wake words it knows about with
every configuration request. This picks up the ones micro_wake_word can
run, downloads them on demand, and hands them to micro_wake_word so they
can be activated like a compiled-in model.

Set the new http_request option to turn this on. It requires
micro_wake_word to be configured, and pulls in the sha256 and json
components used to verify a download and read its manifest.

How it works:

- The advertised wake words are cached on each configuration request, so
  entries Home Assistant stops sending drop out and their models are
  unloaded.
- When Home Assistant activates a wake word whose model is not loaded
  yet, the model is queued and fetched by a background task. The wake
  word is reported as active straight away so the UI reflects the request
  while the download runs.
- Downloads are checked against the size and hash from the manifest, and
  the model has to use the same feature step size as the frontend.
- A model that fails to load is stored as disabled so it is not retried
  on every boot.
- Loaded models are restored after a reboot.

The configuration response now comes entirely from voice_assistant, which
merges the compiled-in models with the cached external wake words, so the
API no longer needs to append them itself.
2026-08-10 08:11:47 -04:00
J. Nick KostonandGitHub 25cb440005 [core] Use Happy Eyeballs for remote file downloads (#18050) 2026-08-10 17:29:00 +12:00
J. Nick KostonandGitHub 0f59ef36a9 [core] Store the validated-config cache as JSON to drop YAML off the upload fast path (#18106) 2026-08-10 17:26:41 +12:00
esphome[bot]andGitHub 3de8c7f95c Bump bundled esphome-device-builder to 1.9.5 (#18223) 2026-08-10 01:49:54 +00:00
Jesse HillsandGitHub 989dbd7550 [ci] Name release runs after the version or dev tag they build (#18110) 2026-08-10 10:10:38 +12:00
ab12e5490f [modbus] Rename send_pdu() to queue_pdu() (#18196)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-08-09 17:00:44 -05:00
J. Nick KostonandGitHub e9f428983e [ble_device_base] Bind BLEHub to the build's tracker at compile time (#18181) 2026-08-09 08:57:31 -05:00
J. Nick KostonandGitHub 862b13c8dd [esp32_ble_tracker] Retire the scanner-state listener interface (#18179) 2026-08-08 20:58:48 -05:00
Edu_CoderandGitHub 2bb01853e0 [tuya] GMT time 0x0C command handler (#17158) 2026-08-08 17:53:10 -07:00
J. Nick KostonandGitHub c7d6b4aaa4 [esp32_ble_tracker] Retire the raw listener path and parser-type enum (#18177) 2026-08-08 19:13:07 -05:00
J. Nick KostonandGitHub 8c74e3d5ef [bluetooth_proxy] Deliver scanner state through the hub callback (#18175) 2026-08-08 15:59:49 -05:00
J. Nick KostonandGitHub 04384e0f5b [ble_device_base] Bind the GATT backend at compile time (#18185) 2026-08-08 15:59:32 -05:00
J. Nick KostonandGitHub 7218aa4803 [bluetooth_connection] Explicit pairing for rp2 (#18166) 2026-08-08 09:51:12 -05:00
J. Nick KostonandGitHub 9cb46aa584 [bluetooth_proxy] Deliver esp32 advertisements through the hub callback (#18173) 2026-08-08 09:50:32 -05:00
Josef ZweckandGitHub 747c5c3e40 [modbus] Make sure we log on no accepting device (#18187) 2026-08-08 09:34:59 -05:00
Edvard FilistovičandGitHub 68acc055bf [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 13: xiaomi_rtcgq02lm, xiaomi_wx08zm, xiaomi_xmwsdj04mmc) (#18183) 2026-08-08 02:06:40 -05:00
2730c10c2c [modbus] Route broadcast writes (address 0) to all server devices (#17387)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-08-08 01:35:49 -05:00
Edvard FilistovičandGitHub 252bb3333e [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 12: xiaomi_miscale, xiaomi_mjyd02yla, xiaomi_mue4094rt) (#18180) 2026-08-08 01:34:08 -05:00
Edvard FilistovičandGitHub 98f4854ecd [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 11: xiaomi_lywsdcgq, xiaomi_mhoc303, xiaomi_mhoc401) (#18178) 2026-08-08 01:01:24 -05:00
Edvard FilistovičandGitHub 413a4c5885 [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 10: xiaomi_lywsd02, xiaomi_lywsd02mmc, xiaomi_lywsd03mmc) (#18174) 2026-08-08 00:27:44 -05:00
Edvard FilistovičandGitHub 087b80eeb5 [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 9: xiaomi_hhccjcy10, xiaomi_hhccpot002, xiaomi_jqjcy01ym) (#18172) 2026-08-07 23:42:37 -05:00
745dee0734 [usb_cdc_acm] Don't discard queued TX data when USB flush times out (#17637)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-08-07 23:24:56 -05:00
Edvard FilistovičandGitHub b986530efc [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 8: xiaomi_cgpr1, xiaomi_gcls002, xiaomi_hhccjcy01) (#18171) 2026-08-07 22:51:33 -05:00
Edvard FilistovičandGitHub 3aaea907ba [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 7: xiaomi_cgd1, xiaomi_cgdk2, xiaomi_cgg1) (#18170) 2026-08-07 21:59:21 -05:00
Edvard FilistovičandGitHub 1d184b43eb [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 6: thermopro_ble, exposure_notifications, xiaomi_ble) (#18168) 2026-08-07 20:47:52 -05:00
J. Nick KostonandGitHub 8d494a84c5 [bluetooth_connection] Engine follow-ups from the rp2 GATT series (#18159) 2026-08-07 16:25:55 -05:00
b0aec6dc2f [modbus_client] Lambda sugar (#18146)
Co-authored-by: Claude <noreply@anthropic.com>
2026-08-07 16:09:15 -05:00
4a7d270494 [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 5: airthings_ble, inkbird_ibsth1_mini, radon_eye_ble) (#18165)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-08-07 20:46:43 +00:00
dependabot[bot]andGitHub ae26483be6 Bump github/codeql-action/init from 4.37.5 to 4.37.6 (#18164)
Signed-off-by: dependabot[bot] <support@github.com>
2026-08-07 19:27:57 +00:00
dependabot[bot]andGitHub 5d7bd179b1 Bump github/codeql-action/analyze from 4.37.5 to 4.37.6 (#18163)
Signed-off-by: dependabot[bot] <support@github.com>
2026-08-07 14:27:09 -05:00
Edvard FilistovičandGitHub 23a3454551 [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 4: ruuvi_ble, ruuvitag, b_parasite) (#18161) 2026-08-07 14:21:46 -05:00
f5ee72753d [modbus_client] Add typed read/write actions (#18078)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Claude <noreply@anthropic.com>
2026-08-07 14:18:20 -05:00
esphome[bot]andGitHub ee13996ee6 Bump bundled esphome-device-builder to 1.9.4 (#18162) 2026-08-07 19:17:26 +00:00
c24e61439b [modbus] Add server support for read/write multiple registers (0x17) (#17357)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-08-07 14:17:11 -05:00
J. Nick KostonandGitHub 2e1c517821 [bluetooth_proxy] Enable active connections on rp2 (#18132) 2026-08-07 13:51:41 -05:00
950cfc4da3 [ld6002b] Add select and button platforms (4/5) (#17822)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-08-07 14:33:37 -04:00
715b14aeba [ble_device_base] Migrate BLE sensor platforms to the neutral layer (batch 3: mopeka_ble, mopeka_pro_check, mopeka_std_check) (#17951)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-08-07 12:59:27 -05:00
J. Nick KostonandGitHub d7b5ad77da [bluetooth_connection] Add BTstack GATT client backend for rp2 (#18131) 2026-08-07 12:53:09 -05:00