Commit Graph
14821 Commits
Author SHA1 Message Date
J. Nick Koston 1a75db7437 Merge branch 'followup/hal-esp8266' into followup/hal-libretiny 2026-04-29 15:52:19 -05:00
J. Nick Koston 387aba530d Merge branch 'dev' into followup/hal-esp8266 2026-04-29 15:52:17 -05:00
J. Nick Koston d7bbc9d2d9 Merge branch 'followup/hal-esp8266' into followup/hal-libretiny 2026-04-29 15:38:01 -05:00
J. Nick Koston 09542430f4 [esp8266] Address Copilot review on #16112
- hal.cpp: include esphome/core/helpers.h for the HOT macro (millis/delay
  use it; without the include the TU fails to compile).
- hal_esp8266.h: drop the redundant arch_get_cpu_cycle_count() bare
  declaration that came back via the merge from dev (the inline def
  above already declares the function).
2026-04-29 15:37:47 -05:00
J. Nick Koston cecccebc64 [core] DelayAction: drop Component inheritance, use self-keyed scheduler (#16129) 2026-04-29 20:35:04 +00:00
J. Nick Koston e374e8f65b Merge branch 'followup/hal-esp8266' into followup/hal-libretiny 2026-04-29 15:19:44 -05:00
Jonathan Swobodaanddependabot[bot] 53b682e48f [ci] Bump clang-tidy from 18.1.8 to 22.1.0.1 (#16078)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-29 20:19:33 +00:00
J. Nick Koston 6bbb5668b4 Merge branch 'dev' into followup/hal-esp8266
# Conflicts:
#	esphome/core/hal.h
#	esphome/core/hal/hal_esp32.h
#	esphome/core/hal/hal_host.h
#	esphome/core/hal/hal_libretiny.h
#	esphome/core/hal/hal_rp2040.h
#	esphome/core/hal/hal_zephyr.h
2026-04-29 15:19:32 -05:00
Mat931andJ. Nick Koston 14910e65d9 [ota] Use WatchdogManager for OTA on ESP32 (#16138)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-04-29 20:15:21 +00:00
J. Nick Koston 813964714c [esp32] Move HAL bodies into components/esp32/hal.cpp + inline trivial dispatches (#16111) 2026-04-29 20:09:08 +00:00
J. Nick Koston 5a146ab6b7 [valve] Fold ControlAction fields into a single stateless lambda (#16123) 2026-04-29 19:20:15 +00:00
J. Nick Koston 61a41402df [fan] Fold TurnOnAction fields into a single stateless lambda (#16122) 2026-04-29 19:16:05 +00:00
Mat931 59b4cfd07c [watchdog] Use default CHECK_IDLE_TASK and PANIC when configuring the watchdog (#16142) 2026-04-29 18:41:12 +00:00
J. Nick Koston c41f38e16d [scheduler] Add self-keyed timer API for callers without a Component (#16127) 2026-04-29 13:24:37 -05:00
Clyde Stubbs 0ad8a071a7 [espnow] Cleanup method visibility and naming (#16109) 2026-04-29 14:18:21 -04:00
J. Nick Koston 985dba9332 [core] Defer heavy module-scope imports in __main__, loader, and config (#15955) 2026-04-29 13:17:59 -05:00
GelidusResearchandCopilot ca3f7251d4 [ens160] Fix sensor initialization timing (#16024)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-29 14:07:28 -04:00
J. Nick Koston 44cabc191d [core] Catch body-read errors in download_content (#16023) 2026-04-29 14:06:41 -04:00
J. Nick Koston e5b1991cf7 [fan] Add tests for fan.turn_on action field combinations (#16125) 2026-04-29 12:46:06 -05:00
J. Nick Koston 7fba57ce51 [valve] Add tests for valve.control action field combinations (#16126) 2026-04-29 12:45:30 -05:00
J. Nick Koston ba0ec7be05 Merge branch 'followup/hal-esp8266' into followup/hal-libretiny 2026-04-29 12:37:47 -05:00
J. Nick Koston ff7164d7eb Merge branch 'followup/hal-esp32' into followup/hal-esp8266 2026-04-29 12:37:46 -05:00
J. Nick Koston ea93fd6983 Merge branch 'dev' into followup/hal-esp32
# Conflicts:
#	esphome/components/esp32/core.cpp
#	esphome/core/hal.h
#	esphome/core/hal/hal_esp32.h
#	esphome/core/hal/hal_esp8266.h
#	esphome/core/hal/hal_host.h
#	esphome/core/hal/hal_libretiny.h
#	esphome/core/hal/hal_rp2040.h
#	esphome/core/hal/hal_zephyr.h
2026-04-29 12:37:23 -05:00
J. Nick Koston 69a33d8ac0 [core] Inline HAL clock wrappers and split hal.h into per-platform headers (#15977) 2026-04-29 12:31:55 -05:00
Jonathan Swoboda ce61dcf387 [remote_base][core] Drop redundant typename in dependent type contexts (#16137) 2026-04-29 16:54:17 +00:00
Jonathan Swoboda bae6b51652 [kamstrup_kmp][toshiba] Fix signed/unsigned comparisons against sizeof (#16135) 2026-04-29 11:33:57 -04:00
Jonathan Swoboda 557c3d4436 [aqi] Use std::max initializer-list for non-negative AQI clamp (#16134) 2026-04-29 11:33:29 -04:00
Jonathan Swoboda bacee89bca [mixer_speaker] NOLINT bugprone-unchecked-optional-access in audio_mixer_task (#16130) 2026-04-29 10:56:13 -04:00
Jonathan Swoboda 2157d11913 [haier] Fix bugprone-unchecked-optional-access; switch HardwareInfo to char[9] (#16124) 2026-04-29 14:26:53 +00:00
Jonathan Swoboda 42b8597719 [api] Extend NOLINT to cover bugprone-random-generator-seed in MAC varint test (#16120) 2026-04-29 13:58:19 +00:00
Jonathan Swoboda 2bd28eee9d [tormatic] Use .value() for checked optional access in read_gate_status_ (#16121) 2026-04-29 09:51:31 -04:00
J. Nick Koston 0a497d3c22 [light] Fold LightControlAction fields into a single stateless lambda (#16118) 2026-04-29 08:35:17 -05:00
Jonathan Swoboda 79da2b9704 [time] Fix bugprone-unchecked-optional-access in CronTrigger::check_time_ (#16107) 2026-04-29 08:30:46 -04:00
Jonathan Swoboda ae5b211c89 [api] Avoid JsonDocument copy-and-swap operator= in ActionResponse ctor (#16106) 2026-04-29 08:30:35 -04:00
J. Nick Koston f1bcbfb32e Merge branch 'followup/hal-esp8266' into followup/hal-libretiny 2026-04-29 07:25:18 -05:00
J. Nick Koston c5661c72dc [esp8266] Drop redundant arch_get_cpu_cycle_count() decl
The inline def above was already in place; the bare decl was inherited
via the merge from followup/hal-esp32 and is now redundant on this PR.
2026-04-29 07:25:07 -05:00
J. Nick Koston 7812a437aa Merge branch 'followup/hal-esp8266' into followup/hal-libretiny 2026-04-29 07:24:37 -05:00
J. Nick Koston cd43002779 Merge branch 'followup/hal-esp32' into followup/hal-esp8266 2026-04-29 07:24:35 -05:00
J. Nick Koston 9dc28556d7 [esp8266] Add bare arch_get_cpu_cycle_count() decl in hal_esp8266.h
Followup #16111 dropped the cross-platform arch_get_cpu_cycle_count()
declaration from hal.h dispatcher and added bare decls to libretiny,
rp2040, host, and zephyr per-platform headers — but missed
hal_esp8266.h. ESP8266 callers (spi.h, uart_component_esp8266.cpp) now
fail clang-tidy with 'use of undeclared identifier'.

The body is still out-of-line in components/esp8266/core.cpp on this
PR; the inline def is added on the chained #16112 PR. Add a bare decl
here for now so #16111 builds in isolation.
2026-04-29 07:24:24 -05:00
J. Nick Koston 9c5d1a7fed [libretiny] Inline delayMicroseconds() in hal_libretiny.h
The wrapper is a one-liner forwarding to Arduino's ::delayMicroseconds.
Add the forward decl to the existing NOLINTBEGIN block (alongside yield,
delay, micros, millis) and inline the body — same pattern as the other
Arduino-flavored wrappers in this header. Drops the out-of-line copy
from components/libretiny/hal.cpp.
2026-04-29 07:17:37 -05:00
J. Nick Koston cbd54e47eb [libretiny] Address Copilot review on #16113
- hal.cpp: include components/libretiny/core.h so the lt_* C API
  (lt_wdt_enable, lt_reboot, lt_gpio_recover) and the LT_GPIO_RECOVER
  macro are properly declared rather than relying on transitive includes.
  core.h pulls <Arduino.h> which is libretiny's umbrella header.
- hal_libretiny.h: preserve the HOT attribute on arch_feed_wdt() — the
  out-of-line wrapper had it; the inline now uses __attribute__((hot,
  always_inline)) to keep the placement hint consistent with the other
  platforms. The arch_restart() noreturn concern is already covered by
  the dispatcher hal.h declaration ('void __attribute__((noreturn))
  arch_restart();' is visible when the body is parsed).
2026-04-29 07:03:56 -05:00
J. Nick Koston 3ea715b8e4 Merge branch 'followup/hal-esp8266' into followup/hal-libretiny 2026-04-29 06:51:21 -05:00
J. Nick Koston f95e7678ad Merge branch 'followup/hal-esp32' into followup/hal-esp8266 2026-04-29 06:51:19 -05:00
J. Nick Koston 4edac4d89e Merge branch 'inline-micros-esp32' into followup/hal-esp32
Brings in the system_soft_wdt_feed NOLINT fix (4e517b422d) for ESP8266
clang-tidy redundant-declaration.
2026-04-29 06:51:05 -05:00
J. Nick Koston 4009c498d9 [esp32] Fix hal.cpp include order: defines.h before crash_handler.h
crash_handler.h is itself guarded by #ifdef USE_ESP32_CRASH_HANDLER, so when
hal.cpp included it before defines.h, the namespace block was empty at parse
time and arch_init()'s USE_ESP32_CRASH_HANDLER branch failed with:

  error: 'crash_handler_read_and_clear' is not a member of 'esphome::esp32'

Pull defines.h first so USE_ESP32_CRASH_HANDLER is defined before
crash_handler.h is parsed.
2026-04-29 06:50:59 -05:00
J. Nick Koston 4e517b422d [esp8266] NOLINT redundant-declaration on system_soft_wdt_feed forward decl
clang-tidy flagged the forward decl in hal_esp8266.h because <user_interface.h>
also declares the function (when included via SDK headers). Both decls are
identical `extern "C"` so the redundancy is harmless; suppress the warning
on the hal_esp8266.h side.
2026-04-29 06:08:04 -05:00
J. Nick Koston 1ce6364892 [libretiny] Move HAL bodies into components/libretiny/hal.cpp + inline trivial dispatches
Per-platform follow-up to #15977.

Move out-of-line HAL bodies (delayMicroseconds, arch_init, arch_restart)
from components/libretiny/core.cpp into a new components/libretiny/hal.cpp.
core.cpp is now empty (no extra component bootstrap to keep) — left as a
stub for symmetry.

Inline the trivial one-liners directly in hal_libretiny.h with forward
decls for the LibreTiny C API:

  arch_feed_wdt()              -> lt_wdt_feed()
  arch_get_cpu_cycle_count()   -> lt_cpu_get_cycle_count()
  arch_get_cpu_freq_hz()       -> lt_cpu_get_freq()

arch_init stays out-of-line because of the libretiny::setup_preferences()
call (component-private header) plus the BK72xx priority-raise + GPIO
recovery logic.

delayMicroseconds() also stays out-of-line — Arduino's ::delayMicroseconds
signature is unsigned int and forward-declaring it across the C/C++
boundary in a hot header is fragile.
2026-04-29 06:01:11 -05:00
J. Nick Koston bb76ee76ec [esp8266] Inline arch_get_cpu_cycle_count() and arch_get_cpu_freq_hz()
Both bodies are one-liners:

  arch_get_cpu_cycle_count()  -> esp_get_cycle_count()
  arch_get_cpu_freq_hz()       -> F_CPU

Move them inline in core/hal/hal_esp8266.h:
- esp_get_cycle_count() comes from <core_esp8266_features.h> (now
  pulled into hal_esp8266.h, small ESP8266-only header).
- F_CPU is a -DF_CPU=80000000L compiler flag from the ESP8266 Arduino
  board defs, available without any include.

Drop the cross-platform arch_get_cpu_freq_hz() declaration from the
dispatcher hal.h and add bare decls to hal_esp32.h / hal_libretiny.h /
hal_rp2040.h / hal_host.h / hal_zephyr.h so subsequent per-platform
follow-ups only touch their own platform header.
2026-04-29 05:59:38 -05:00
J. Nick Koston c0e2d443f0 [esp8266] Move HAL bodies into components/esp8266/hal.cpp + inline arch_init()
Per-platform follow-up to #15977, chained on top of #16111.

Move out-of-line HAL bodies (millis() fast accumulator, delay() poll,
arch_restart, arch_get_cpu_cycle_count, arch_get_cpu_freq_hz, plus the
__wrap_millis linker trampoline) from components/esp8266/core.cpp into
a new components/esp8266/hal.cpp. core.cpp keeps only the ESP8266
firmware bootstrap (Tasmota OTA magic bytes, optional GPIO pre-init
via resetPins) — single-purpose files.

arch_init() is empty on ESP8266 so it is now inlined directly in
core/hal/hal_esp8266.h alongside the other already-inlined wrappers
(yield, micros, millis_64, delayMicroseconds, arch_feed_wdt,
progmem_read_*).

The dispatcher hal.h drops the cross-platform arch_init() declaration
since at least one platform (ESP8266) inlines it now; bare declarations
are added to the other per-platform headers (hal_esp32.h, hal_libretiny.h,
hal_rp2040.h, hal_host.h, hal_zephyr.h) so future per-platform PRs only
touch their own file.
2026-04-29 05:56:42 -05:00
J. Nick Koston 174a0b7631 [esp32] Use components/esp32/hal.cpp instead of core/hal/hal_esp32.cpp
The previous commit placed the out-of-line ESP32 HAL bodies under
core/hal/hal_esp32.cpp and gated compilation via FILTER_SOURCE_FILES,
mirroring the wake/wake_<platform>.cpp pattern. Switch to the simpler
components/esp32/hal.cpp location instead:

- A component-internal .cpp only compiles when USE_<PLATFORM> is set,
  so no FILTER_SOURCE_FILES entry is needed (revert that addition).
- The file can include the component's private crash_handler.h header
  directly without a layering inversion or forward decl, so arch_init()
  also moves into hal.cpp now (previously stuck in core.cpp because of
  that header dependency).
- A future consolidation PR will move the existing core/wake/wake_*.cpp
  files into components/<platform>/wake.cpp the same way and drop their
  FILTER_SOURCE_FILES entries.

ci-custom's lint_namespace check is satisfied with an empty
namespace esphome::esp32 {} block at the top of the file — the HAL
functions themselves live in namespace esphome (root) since they are
not part of the esp32 component's API.
2026-04-29 05:53:18 -05:00