Commit Graph

23491 Commits

Author SHA1 Message Date
J. Nick Koston
8ebd9113a3 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 22:21:26 -10:00
J. Nick Koston
470d6d0537 Merge branch 'remove-register-component-public' into integration 2026-02-27 22:06:30 -10:00
J. Nick Koston
97eba625b9 Revert inline - ESP8266 compiler doesn't outline push_back ISRA 2026-02-27 22:06:05 -10:00
J. Nick Koston
55ffb62571 Inline register_component_ in header for better codegen 2026-02-27 21:59:58 -10:00
J. Nick Koston
2d20986a37 Merge remote-tracking branch 'upstream/remove-register-component-public' into integration 2026-02-27 21:43:30 -10:00
J. Nick Koston
9967fc54d5 Drop template wrapper, call register_component_ directly
The template wrapper caused the compiler to make different
optimization decisions on setup(), negating the savings.
Calling register_component_ directly was -4 bytes.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:40:03 -10:00
J. Nick Koston
d2af639e71 Keep original template name to preserve compiler optimizations
Using the original register_component name (just moved to protected)
produces identical compiled output to the baseline, avoiding the
symbol name length overhead from renaming.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:32:27 -10:00
J. Nick Koston
ebde654259 Restore template wrapper as protected register_component_
Rename the non-template to register_component_impl_ and add
a protected template register_component_ that wraps it. This
preserves the compiler optimization behavior (isra clones)
while keeping the method inaccessible to external components.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:31:06 -10:00
J. Nick Koston
6d1a40f210 Mark register_component_ as noinline to prevent setup() bloat
Without the template wrapper, the compiler inlines the 24-byte
function at each of ~92 call sites in setup(), growing setup()
by ~284 bytes. Force a function call instead.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:27:41 -10:00
Raymond Richmond
6c0998f220 [gt911] Support for interrupt signal via IO Expander (#14358) 2026-02-28 18:26:06 +11:00
J. Nick Koston
25ee5c9a28 Add NOLINT for redundant-declaration from Arduino.h
Arduino.h on ESP8266 already declares void setup(void), so our
forward declaration triggers readability-redundant-declaration.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:16:45 -10:00
J. Nick Koston
e468db0fce Add friend declaration for original_setup used by cpp unit tests
The cpp test framework renames setup() to original_setup() and
replaces setup() with the gtest runner, so we need to friend both.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:08:36 -10:00
J. Nick Koston
73fd1d68d5 Fix test_cpp_helpers to use register_component_
Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:07:47 -10:00
J. Nick Koston
f926978f61 [core] Make register_component protected, remove runtime checks
Instead of runtime null, duplicate, and capacity checks in
register_component_, make the method unreachable from outside
codegen by removing the public template wrapper and granting
friend access to the codegen-generated ::setup() function.

Since ESPHOME_COMPONENT_COUNT is set to exactly
len(CORE.component_ids) at codegen time, the StaticVector is
always correctly sized and the runtime capacity check cannot
trigger from codegen. External components that bypassed codegen
to call App.register_component() directly will now get a
compile error, forcing them to properly declare their components
in their config schema.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:05:34 -10:00
J. Nick Koston
3f8e158657 Merge remote-tracking branch 'origin/inline-set-component-state' into integration 2026-02-27 17:48:00 -10:00
J. Nick Koston
f772bbd1dd [core] Inline set_component_state_ and use it in Application
Move set_component_state_ from component.cpp to the header as
an inline method so it can be reused wherever Component state
needs to be updated. Replace the manual bit manipulation in
Application::enable_pending_loops_ with a call to the helper.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 17:45:47 -10:00
J. Nick Koston
d8199e724e Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 17:31:46 -10:00
J. Nick Koston
49cc389bf0 [esp32] Wrap printf/vprintf/fprintf to eliminate _vfprintf_r (~11 KB flash) (#14362)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:28:05 -10:00
J. Nick Koston
8480e8df9f [uart] Revert UART0 default pin workarounds (fixed in ESP-IDF 5.5.2) (#14363) 2026-02-27 17:27:51 -10:00
J. Nick Koston
9bbec40242 Merge remote-tracking branch 'origin/web_server' into integration 2026-02-27 16:02:33 -10:00
J. Nick Koston
41dac179ca Merge remote-tracking branch 'origin/pack-entity-strings' into integration 2026-02-27 16:02:21 -10:00
J. Nick Koston
e7d4f2608b [sen6x] Fix test sensor ID collisions with sen5x (#14367) 2026-02-27 16:01:17 -10:00
J. Nick Koston
42de1ca17f Merge branch 'fix-sen6x-test-id-collisions' into pack-entity-strings 2026-02-27 15:48:43 -10:00
J. Nick Koston
ff7dcae4a0 [sen6x] Fix test sensor ID collisions with sen5x
The sen6x test YAML used identical sensor IDs (pm_1_0, pm_2_5,
pm_4_0, pm_10_0) as sen5x, causing ID redefinition errors when
both components are tested together in grouped builds. Prefix
the sen6x IDs with sen6x_ to make them unique.
2026-02-27 15:47:29 -10:00
J. Nick Koston
3a31058f62 [water_heater] Use length-aware comparisons in set_mode(const char*, size_t)
Make set_mode(const char*, size_t) the real implementation using
ESPHOME_strncasecmp_P with length checks, instead of ignoring len
and delegating to the null-terminated overload.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:37:36 -10:00
J. Nick Koston
26b867477d [api] Use const char* overloads for text and alarm_control_panel commands
Avoid implicit StringRef->std::string conversion when the protobuf
message fields are already StringRef. Use the (const char*, size_t)
overloads directly.
2026-02-27 15:34:41 -10:00
J. Nick Koston
5330445a4d preen 2026-02-27 15:17:01 -10:00
J. Nick Koston
949143626a preen 2026-02-27 15:16:03 -10:00
J. Nick Koston
eb2a8aacde Merge remote-tracking branch 'origin/pack-entity-strings' into integration 2026-02-27 15:04:00 -10:00
J. Nick Koston
f0eafd553d Merge remote-tracking branch 'upstream/dev' into pack-entity-strings
# Conflicts:
#	esphome/components/rp2040/core.cpp
2026-02-27 14:54:37 -10:00
J. Nick Koston
5ad9c9869f Merge branch 'dev' of https://github.com/esphome/esphome into integration 2026-02-27 14:49:11 -10:00
Ryan Wagoner
d1b4813197 [web_server] Add climate preset, fan mode, and humidity support (#14061) 2026-02-27 14:20:13 -10:00
Jonathan Swoboda
298ee7b92e [gps] Fix codegen deadlock when automations reference sibling sensors (#14365)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 19:08:42 -05:00
J. Nick Koston
c37d02e2e5 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 14:00:10 -10:00
J. Nick Koston
f861bf9564 Merge branch 'fix-uart-default-pin-pullup-removal' into integration 2026-02-27 14:00:03 -10:00
J. Nick Koston
0efa547143 Revert "[uart] Fix UART on default UART0 pins for ESP-IDF (#12519)"
This reverts commit 1897551b28.
2026-02-27 13:34:12 -10:00
J. Nick Koston
5a00455b34 Revert "[uart] Always call pin setup for UART0 default pins on ESP-IDF (#14130)"
This reverts commit 7bdeb32a8a.
2026-02-27 13:34:12 -10:00
J. Nick Koston
5c56b99742 [ci] Fix C++ unit tests missing time component dependency (#14364) 2026-02-27 13:19:11 -10:00
J. Nick Koston
90cfe40f91 Merge remote-tracking branch 'upstream/wrap-printf-stubs' into integration 2026-02-27 13:04:00 -10:00
J. Nick Koston
6c3746cad0 Fix clang-tidy naming: remove trailing underscore from static function
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:01:17 -10:00
J. Nick Koston
b840dfb7e5 Merge branch 'wrap-printf-stubs' into integration 2026-02-27 12:53:21 -10:00
J. Nick Koston
0e14d0b0a0 Fix config path in comments: esp32 framework advanced 2026-02-27 12:47:08 -10:00
J. Nick Koston
35ac7a16f9 Use tuple instead of list for static iteration 2026-02-27 12:46:51 -10:00
J. Nick Koston
8dd24bfe78 Note that crash backtraces use esp_rom_printf, not libc 2026-02-27 12:46:04 -10:00
J. Nick Koston
2f903c91ff Clarify that stubs are dead code at runtime and overflow is defensive 2026-02-27 12:45:00 -10:00
J. Nick Koston
b2728cbd44 Address review: flush before abort, check fwrite errors, add test 2026-02-27 12:43:22 -10:00
J. Nick Koston
a3a6ed3582 Extract common buffer write + overflow check into helper 2026-02-27 12:40:58 -10:00
J. Nick Koston
9f11dc736f Add namespace esphome::esp32 to satisfy CI lint check 2026-02-27 12:39:30 -10:00
J. Nick Koston
af1a00ccf9 [esp32] Wrap printf/vprintf/fprintf to eliminate _vfprintf_r (~11 KB flash)
ESP-IDF SDK components reference fprintf(), printf(), and vprintf()
which pull in newlib's _vfprintf_r (~11 KB). This is a separate
implementation from _svfprintf_r (used by snprintf/vsnprintf) that
handles FILE* stream I/O with buffering and locking.

ESPHome replaces the ESP-IDF log handler via esp_log_set_vprintf_(),
so the SDK's vprintf() path is dead code at runtime. The fprintf()
and printf() calls in SDK components are only in debug/assert paths
that are either GC'd or never called.

These linker --wrap stubs redirect through vsnprintf() + fwrite(),
allowing the linker to dead-code eliminate _vfprintf_r.

An escape hatch is provided via enable_full_printf: true in the
esp32 advanced config section for external components that need
full FILE*-based fprintf.
2026-02-27 12:35:41 -10:00
J. Nick Koston
8c70472f60 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 11:50:44 -10:00