Commit Graph
28051 Commits
Author SHA1 Message Date
J. Nick Koston 7983ebf54a Merge remote-tracking branch 'origin/external-files-etag' into integration 2026-04-26 09:42:36 -05:00
J. Nick Koston 5ae259ccba Sync ETag sidecar mtime with cache file; treat mismatched sidecars as stale
The ETag sidecar describes a specific snapshot of the cache file. If the
cache file is replaced or edited out-of-band (manual edit, restore from
backup, another tool overwriting it), the sidecar's recorded ETag no
longer matches the bytes on disk -- using it would cause the server to
return 304 and we'd serve the wrong content from cache.

- _write_etag now os.utime()'s the sidecar to share the cache file's
  st_mtime_ns immediately after writing it.
- _read_etag compares the two mtimes; if they don't match it returns
  None and removes the sidecar so subsequent calls don't re-check it.
2026-04-26 09:41:20 -05:00
J. Nick Koston 3f793e682a Merge remote-tracking branch 'origin/external-files-parallel' into integration
# Conflicts:
#	esphome/external_files.py
#	tests/unit_tests/test_external_files.py
2026-04-26 09:39:21 -05:00
J. Nick Koston 2d9d1eabfa [core] Download external_files in parallel
Each component that uses external_files (audio_file, speaker
media_player, ...) currently calls download_content once per file
inline inside a per-item config validator. With ~24 cached audio
files in a Home Assistant Voice PE config, that means ~24 sequential
HEAD round-trips, even when every response is a 304.

This adds download_content_many(items, ...) which fans the per-file
checks out across a ThreadPoolExecutor (capped at 16 workers so
configs with hundreds of files don't open hundreds of sockets), then
refactors audio_file and speaker.media_player to collect URLs at the
list level and call the batch helper once instead of downloading
inside each per-item validator.

Wall time for the validation phase drops from sum(latency) to roughly
max(latency) when the cache is warm.
2026-04-26 09:36:13 -05:00
J. Nick Koston 68b754d741 Merge remote-tracking branch 'origin/external-files-etag' into integration 2026-04-26 09:28:44 -05:00
J. Nick Koston 9f058ac1a6 [core] Use ETag in external_files cache to fix re-downloads from raw.githubusercontent.com
raw.githubusercontent.com ignores If-Modified-Since (always returns
200), but honors If-None-Match with ETag (returns 304). This caused
every esphome compile/config run to re-download every cached external
file (audio_file, micro_wake_word, image, font, bme68x_bsec2, etc.)
sourced from a /raw/ URL.

- Send If-None-Match with the cached ETag when present
- Persist the ETag from each download in a hidden sidecar file
  (.{name}.etag) and refresh it when a 304 carries a new ETag
- Replace path.write_bytes() with helpers.write_file() so downloads are
  written atomically and can no longer leave partially-written cache
  files behind on crash
2026-04-26 09:26:20 -05:00
J. Nick Koston 8fbcf90a6e Merge remote-tracking branch 'origin/improv-serial-loop-perf' into integration 2026-04-26 09:17:06 -05:00
J. Nick Koston ab233e6d83 [improv_serial] Reduce per-loop overhead
- Cache UART selection at setup time so each loop iteration no longer
  dereferences global_logger and pays for a non-inlined Logger::get_uart()
  call before the read switch.
- Use App.get_loop_component_start_time() once per loop instead of two
  millis() calls (especially relevant on ESP8266 where millis() involves
  interrupt-locked 64-bit timer access).
- Move read_byte_() to the header as ESPHOME_ALWAYS_INLINE so the call/ret
  pair and optional<uint8_t> staging are elided at the call sites in loop().
2026-04-26 09:16:16 -05:00
J. Nick Koston 7eb5ffd226 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-26 08:28:20 -05:00
e87e78c544 [api] Expose TemperatureUnit in water heater and climate api (#15815)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2026-04-26 12:58:14 +00:00
J. Nick Koston 0f25d91e68 [core] Unify skip_external_update and honor it in external_files for faster esphome logs (#16016) 2026-04-26 07:24:33 -05:00
J. Nick Koston 8dbdcfc128 [bk72xx] Prepare for BK7238 support (#16018) 2026-04-26 07:24:07 -05:00
J. Nick Koston 8950afc3c4 [bluetooth_proxy] Drop redundant remote_bda_ write in connect handler (#16000) 2026-04-26 07:23:53 -05:00
J. Nick Koston 04d067196d [rotary_encoder][at581x] Fix templatable int field types (#16015) 2026-04-26 07:23:41 -05:00
J. Nick Koston 502c010465 [bh1750] Downgrade per-reading Illuminance log to verbose (#16005) 2026-04-26 07:23:24 -05:00
J. Nick Koston 180105bb4b [bluetooth_proxy] Partial revert of loop() → set_interval migration (#15992) 2026-04-26 07:23:08 -05:00
J. Nick Koston 4c0dfb0e0d [core] Raise ESP32 WDT feed interval to 1/5 of configured timeout (#15984) 2026-04-26 07:22:50 -05:00
J. Nick Koston df987a7ffb [ci-custom] Suggest uint32_to_str/int8_to_str for integer formatting (#15970) 2026-04-26 07:22:34 -05:00
Boris Krivonog c8d4420408 [mitsubishi_cn105] add support for half-degree temperature setpoint (#15919) 2026-04-26 07:19:49 -05:00
J. Nick Koston 31e97e0161 Merge remote-tracking branch 'origin/libretiny-bk7238-boards' into integration 2026-04-26 07:12:14 -05:00
J. Nick Koston 1a0642546b [bk72xx] Add BK7238 boards in preparation for upstream support 2026-04-26 06:47:51 -05:00
J. Nick Koston 2e6f623163 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-26 06:32:47 -05:00
Darafei PraliaskouskiandJ. Nick Koston b084fa4490 [esp32] Make ESP-IDF builds reproducible (#16008)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-04-26 06:31:32 -05:00
J. Nick Koston e30c60c277 Merge branch 'codex/pr15983-idf-reproducible' into integration 2026-04-26 06:24:16 -05:00
J. Nick Koston 8096b95910 Merge remote-tracking branch 'upstream/skip_external_files_update_logs' into integration 2026-04-26 04:51:47 -05:00
J. Nick Koston 3438ff817a Address review: drop redundant comments and rely on existing CORE.reset() between tests 2026-04-26 04:49:04 -05:00
J. Nick Koston 4654f427ca Merge remote-tracking branch 'upstream/skip_external_files_update_logs' into integration 2026-04-26 04:44:42 -05:00
J. Nick Koston 5150a32224 [external_files] Unify skip_external_update via CORE flag for git as well 2026-04-26 04:43:53 -05:00
J. Nick Koston 26ba4850e4 [external_files] Skip remote freshness checks during esphome logs
Avoid per-file HTTP HEAD requests during config validation when running
esphome logs against a previously-cached project. The skip_external_update
flag was already plumbed for git operations, but external_files.download_content
ignored it. Thread it through CORE so audio_file, micro_wake_word,
speaker/media_player, image, font, and bme68x_bsec2 reuse cached files
without per-URL network round-trips when the file already exists locally.
2026-04-26 04:37:35 -05:00
J. Nick Koston 096721f1d5 Merge remote-tracking branch 'upstream/templatable-int-fix' into integration 2026-04-26 04:25:17 -05:00
J. Nick Koston bd1dd68d6b [rotary_encoder][at581x] Fix templatable int field types
The TEMPLATABLE_VALUE C++ fields are typed `int`, but Python codegen
was passing `cg.int32` (`int32_t`). On ESP-IDF/xtensa toolchains where
`int32_t` is `long`, the codegen-generated lambda's function-pointer
type `int32_t (*)(...)` does not match `int (*)(...)`, causing
`TemplatableFn` to select its deprecated casting-trampoline overload
and emit a `-Wdeprecated-declarations` warning at every call site.

Use `cg.int_` so the lambda's return type matches the field exactly.
2026-04-26 04:24:59 -05:00
J. Nick Koston a8d767cc5c Merge remote-tracking branch 'upstream/dev' into integration 2026-04-26 04:16:55 -05:00
J. Nick Koston 9028cc8c3e Merge remote-tracking branch 'origin/git_shallow_fetch' into integration 2026-04-26 04:13:13 -05:00
68625a1b76 [core] Isolate generated build metadata (#16007)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-26 09:11:09 +00:00
J. Nick Koston e907e71101 [git] Address PR review feedback
- Add `--` terminator before submodule paths (both clone and refresh
  paths) so a path beginning with `-` cannot be parsed as a git option.
- Reword the refresh-fetch comment: this fetch also runs when ref is
  None, in which case it pulls the remote default branch.
2026-04-26 04:08:43 -05:00
J. Nick Koston 301a855e36 Merge branch 'dev' into codex/pr15983-idf-reproducible 2026-04-26 04:01:08 -05:00
J. Nick Koston b3a57d1395 [git] Make ref fetches and submodule updates shallow
Fixes esphome/esphome#11550

When clone_or_update is called with a ref or submodules, the initial
clone uses --depth=1 but the subsequent git fetch and git submodule
update commands run deep, pulling the full history on every refresh.
This causes excess network traffic and disk usage for external_components,
packages, and dashboard imports.

Add --depth=1 to all four call sites (initial fetch, initial submodule
init, refresh fetch, refresh submodule update). Shallow fetches still
advance the local clone to the current remote tip when it moves, so the
refresh path keeps working as before.
2026-04-26 03:57:35 -05:00
Darafei Praliaskouski 8ae4b3a771 test: fix reproducible build docstring style 2026-04-26 12:47:59 +04:00
J. Nick Koston dc57969afd [host] Use integer math in millis()/micros() (#15994) 2026-04-26 08:39:24 +00:00
Darafei Praliaskouski 5be9766809 perf(build): enable reproducible PlatformIO ESP-IDF builds 2026-04-26 10:56:39 +04:00
J. Nick Koston f092e619d8 [rtttl] Gate on_finished_playback callback storage behind define (#16003) 2026-04-26 00:03:59 -05:00
J. Nick Koston 58f6ad2d0c [safe_mode] Use StaticCallbackManager for on_safe_mode (#16002) 2026-04-26 00:01:21 -05:00
Keith BurzinskiandJ. Nick Koston bc33260c61 [ir_rf_proxy] Extend for RF (#15744)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-04-25 22:33:02 -05:00
J. Nick Koston 4cab262ef8 [ci] Trigger CodSpeed benchmarks on host platform changes (#15995) 2026-04-25 17:18:21 -04:00
J. Nick Koston b1f7a39252 Merge remote-tracking branch 'origin/dev' into integration 2026-04-25 16:02:21 -05:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 9ad820c921 Bump esphome-dashboard from 20260408.1 to 20260425.0 (#16006)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-25 20:59:01 +00:00
J. Nick Koston 4f8feb86f0 [dashboard] Add --no-states support to logs WebSocket handler (#15993) 2026-04-25 15:43:05 -05:00
J. Nick Koston 7702f8a6e7 Merge branch 'bh1750-illuminance-logv' into integration 2026-04-25 15:26:28 -05:00
J. Nick Koston d2baa0437a m 2026-04-25 15:26:26 -05:00
J. Nick Koston 827163d502 [bh1750] Downgrade per-reading Illuminance log to verbose
The base sensor already logs the published state via the [S]
publish line, so the component-level [D] line was redundant
log spam on every update. Drop it to ESP_LOGV.
2026-04-25 15:25:41 -05:00