Commit Graph

14007 Commits

Author SHA1 Message Date
J. Nick Koston ef1f028eb5 Refactor automation building to iterate tuples 2026-03-26 10:34:13 -10:00
J. Nick Koston 1f9b02165a Remove stale trigger class declarations and schema overrides 2026-03-26 10:32:04 -10:00
J. Nick Koston 150e0775b9 Add static_asserts for forwarder size, widen type hint
- static_assert that forwarders are pointer-sized and trivially
  copyable so future field additions can't silently cause heap
  allocation in Callback::create().
- Widen forwarder parameter type hint to MockObj | MockObjClass.
2026-03-25 15:36:08 -10:00
J. Nick Koston bd69737878 Add comment explaining RawExpression usage 2026-03-25 15:21:55 -10:00
J. Nick Koston a90a2b1d62 Address review: simplify template branch, add constructor comment
- Remove unnecessary TriggerForwarder.template() branch —
  TemplateArguments() already handles the empty case.
- Add comment on Automation default constructor explaining
  its purpose for the forwarder pattern.
2026-03-25 15:20:36 -10:00
J. Nick Koston 73ae0dd739 Migrate event component (EventTrigger) 2026-03-25 15:17:05 -10:00
J. Nick Koston bdc4a54613 Address review: const ref args, revert lock migration
- TriggerForwarder::operator() now takes const Ts&... to avoid
  copies of non-trivial types (e.g., std::string).
- Revert lock to trigger-based pattern: LockStateForwarder holds
  two pointers (automation + lock), exceeding sizeof(void*) which
  would cause Callback::create to heap-allocate.
- Remove forwarder_extra_args from API since lock was the only user.
2026-03-25 15:10:10 -10:00
J. Nick Koston ee1da10614 Remove unused trigger_ back-pointer from Automation
The trigger_ field was only set in the constructor and never read
afterward. Removing it saves 4 bytes per Automation instance.
2026-03-25 14:32:51 -10:00
J. Nick Koston 9be87f66c3 Accept custom forwarder types, migrate number and lock
Replace bool_filter with generic forwarder parameter that accepts
any struct type. Components can define their own forwarders with
custom fields (e.g., LockStateForwarder needs both automation and
lock entity pointers).

Migrates number (NumberStateTrigger) and lock (LockStateTrigger)
to prove the API is flexible enough for diverse patterns.
2026-03-25 14:23:35 -10:00
J. Nick Koston c127cacb9a Use template forwarder structs for callback deduplication
Replace per-site lambda generation with TriggerForwarder<Ts...>,
TriggerOnTrueForwarder, and TriggerOnFalseForwarder structs. The
compiler generates one operator() per forwarder type shared across
all call sites, avoiding flash duplication from unique lambdas.

Also cleans up API: replaces condition/callback_args with
bool_filter using TRIGGER_ON_TRUE/TRIGGER_ON_FALSE constants.
2026-03-25 14:16:30 -10:00
J. Nick Koston 6c905bd036 Add unit tests for trigger callback lambda generation
Tests the lambda output format for all variations used by
build_callback_automation: no args, typed args, conditions,
multiple args, and empty capture.
2026-03-25 14:09:10 -10:00
J. Nick Koston 6354d4ad97 [core] Eliminate trigger trampolines for common entity automations
Add build_callback_automation() to register automation callbacks
directly on parent components, bypassing the Trigger wrapper object.

Migrates button, sensor, binary_sensor, switch, and text_sensor
to the new pattern, eliminating 12 thin wrapper trigger classes
from runtime instantiation.
2026-03-25 13:58:30 -10:00
Jonathan Swoboda a075f63b59 [uart] Fix debug callback missing peeked byte and reading past end (#15169) 2026-03-25 16:50:37 -04:00
J. Nick Koston ec60da893f [core] Move state logging to client-side formatting, console to VERBOSE (#15155) 2026-03-25 19:45:06 +00:00
dependabot[bot] d8fbce365a Bump requests from 2.32.5 to 2.33.0 (#15170)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-25 09:38:20 -10:00
Jonathan Swoboda f6c5767a83 [inkplate] Use atomic GPIO write to prevent ISR race (#15166) 2026-03-25 14:10:28 -04:00
Jonathan Swoboda 19615f2eae [bme68x_bsec2] Fix uninitialized bme68x_conf in measurement duration calculation (#15168) 2026-03-25 14:10:04 -04:00
Jonathan Swoboda c42c6745b9 [mcp9600] Fix setup success check using OR instead of AND (#15165) 2026-03-25 08:06:48 -10:00
Edward Firmo 65d0a91fcc [nextion] Add defined keys to defines.h (#14971)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-25 18:01:52 +00:00
J. Nick Koston a22d47c719 [api] Add --no-states flag to esphome logs command (#15160) 2026-03-25 07:36:53 -10:00
J. Nick Koston 010516aef2 [benchmark] Add sensor publish_state benchmarks (#15034) 2026-03-25 07:33:17 -10:00
Jonathan Swoboda a15389318f [audio] Bump esp-audio-libs to 2.0.4 (#15164) 2026-03-25 11:57:33 -04:00
Edward Firmo 5d67868ac6 [nextion] Fix inline doc parameter types for page and touch callbacks (#14972) 2026-03-25 10:39:46 -04:00
Clyde Stubbs e0d8000007 [ai] Add instructions regarding constructor parameters (#15091)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-25 10:34:34 -04:00
Frédéric Metrich b66ff374a2 [esp32] Fix GPIO strapping pins and add USB-JTAG warnings (#15105)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-25 14:26:33 +00:00
Brandon der Blätter 6c981e83db [hub75] Add SCAN_1_8_32PX_FULL wiring option (#15130) 2026-03-25 09:52:50 -04:00
Clyde Stubbs 2355fcb44e [lvgl] Update function and type names (#15109)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-25 09:51:51 -04:00
Piotr Szulc f5bbff0b05 [core] Add CONF_LIBRETINY constant to const.py (#15141)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-25 07:40:39 -04:00
Clyde Stubbs c45c9da771 [lvgl] Various 9.5 fixes (#15157) 2026-03-25 20:51:23 +11:00
dependabot[bot] 7a40759567 Bump aioesphomeapi from 44.7.0 to 44.8.0 (#15159)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-25 08:55:12 +00:00
J. Nick Koston af5b98c635 [time] Remove dummy placeholder values for recalc_timestamp_utc() (#15129) 2026-03-25 01:07:28 +00:00
J. Nick Koston 690dc324c9 [logger] Move task log buffer storage to BSS (#15153) 2026-03-25 00:52:37 +00:00
Jonathan Swoboda 26e78c840c [wifi] Filter fast_connect by band_mode and use background scan for roaming (#15152) 2026-03-24 20:21:04 -04:00
J. Nick Koston 9c9ae190ee [core] Use compile-time HasElse parameter in IfAction (#15134) 2026-03-24 14:13:59 -10:00
J. Nick Koston 238adbe008 [wifi] Fix roaming counter reset from delayed disconnect and successful retry (#15126) 2026-03-24 14:04:17 -10:00
J. Nick Koston f457b995f7 [datetime] Fix state_as_esptime() returning invalid timestamp (#15128) 2026-03-24 14:03:56 -10:00
J. Nick Koston b6aec4fa25 [ethernet] Add W5100 support for RP2040 (#15131) 2026-03-24 14:03:30 -10:00
J. Nick Koston 9fb5b6aa15 [light] Replace initial_state storage with flash-resident callback (#15133) 2026-03-24 14:03:18 -10:00
J. Nick Koston 752fe30332 [api] Add descriptive message to status warning when waiting for client (#15148) 2026-03-24 20:01:59 -04:00
Jonathan Swoboda 4ff85e2a1e [core] Fix clean-all to handle custom build paths (#15146)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2026-03-24 19:48:17 -04:00
Diorcet Yann 13baf26050 [core] get_log_str: fix false-positive error on null-terminated strings with stricter compilers (#15136)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-24 20:26:21 +00:00
Jonathan Swoboda 8751f348c8 [sx127x] Fix FIFO read corruption (#15114) 2026-03-24 10:04:27 -10:00
Fabian Bläse 22bc47da23 [light] Fix incorrect mode change handling on transition to off (#15147) 2026-03-24 19:57:58 +00:00
Jonathan Swoboda 55df21db51 [esp32] Default CPU frequency to maximum supported (#15143) 2026-03-24 15:44:28 -04:00
Jonathan Swoboda 3cd50f0495 [ci] Block new CONF_ constants from being added to esphome/const.py (#15145) 2026-03-24 09:31:08 -10:00
Diorcet Yann b3390d40fb [core] Fix cg.add_define propagation to dependencies in native ESP-IDF builds (#15137) 2026-03-24 14:31:42 -04:00
Javier Peletier 7eddf429ea [substitutions] speed up config loading: substitutions pass and !include redesign (package refactor part 4) (#12126)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-23 23:57:22 -10:00
J. Nick Koston 793813790a [api] Precompute tag bytes for forced varint and length-delimited fields (#15067) 2026-03-24 01:52:39 +00:00
J. Nick Koston fe2c4e47bf [sensor] Deprecate .raw_state, guard raw_callback_ behind USE_SENSOR_FILTER (#15094)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-24 00:40:02 +00:00
Javier Peletier df4318505f [substitutions] refactor substitute() as a pure function (package refactor part 3) (#15031)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-23 14:28:04 -10:00