Commit Graph

22298 Commits

Author SHA1 Message Date
J. Nick Koston
8f7e64dd0b Merge remote-tracking branch 'upstream/dev' into integration 2026-02-11 11:37:35 -06:00
J. Nick Koston
069c90ec4a [api] Split process_batch_ to reduce stack on single-message hot path (#13907) 2026-02-11 11:34:43 -06:00
J. Nick Koston
930a186168 [web_server_idf] Use constant-time comparison for Basic Auth (#13868) 2026-02-11 11:03:27 -06:00
Djordje Mandic
b1f0db9da8 [bl0942] Update reference values (#12867) 2026-02-11 11:10:32 -05:00
J. Nick Koston
923445eb5d [light] Eliminate redundant clamp in LightCall::validate_() (#13923) 2026-02-11 10:06:44 -06:00
J. Nick Koston
86f0012abd Merge remote-tracking branch 'upstream/dev' into integration 2026-02-11 09:56:47 -06:00
J. Nick Koston
c82d630cf5 Merge branch 'preferences-clear-on-sync' into integration 2026-02-11 09:53:45 -06:00
J. Nick Koston
185786604b [preferences] Replace per-element erase with clear() in sync()
NVS/FDB write failures are permanent (flash worn out, partition full,
handle invalid). The NVS layer already performs internal garbage
collection during writes, so retrying the same call will always fail
again. Keeping failed entries in the vector leaked memory and forced
a reverse-iterate + per-element erase pattern that generated ~130
bytes of inlined vector move/destroy code for NVSData objects.

Replace with a forward range-for and a single clear() at the end.
2026-02-11 09:48:32 -06:00
tomaszduda23
9bdae5183c [nrf52,logger] add support for task_log_buffer_size (#13862)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-02-11 15:43:55 +00:00
J. Nick Koston
e0f3d87c17 Merge remote-tracking branch 'tomaszduda23/logger_threading' into integration 2026-02-11 09:18:41 -06:00
J. Nick Koston
8b53f9a649 revert to 0 disabled to test off path 2026-02-11 08:48:22 -06:00
J. Nick Koston
a451491b47 tweak semantics to match 2026-02-11 08:46:30 -06:00
J. Nick Koston
37f97c9043 [esp8266][rp2040] Eliminate heap fallback in preference save/load (#13928) 2026-02-11 08:41:15 -06:00
J. Nick Koston
8e785a2216 [web_server] Remove unnecessary packed attribute from DeferredEvent (#13932) 2026-02-11 08:40:41 -06:00
schrob
4fb1ddf212 [api] Fix compiler format warnings (#13931) 2026-02-11 08:40:21 -06:00
J. Nick Koston
4f7d4e1fd3 make sure its > 0 in test 2026-02-11 08:36:38 -06:00
J. Nick Koston
1050d083b4 cleanup ifdefs and typos 2026-02-11 08:34:17 -06:00
J. Nick Koston
ba5703254a Merge remote-tracking branch 'origin/web-server-remove-packed-deferred-event' into integration 2026-02-11 08:23:32 -06:00
J. Nick Koston
48cc739bab Add static_assert to guard DeferredEvent size and update comments
Add compile-time check that DeferredEvent has no padding, so future
field additions would trigger a build error rather than silently
reintroducing the unaligned access codegen issue.

Update comments to reference pointer sizes instead of hardcoded "8 bytes".
2026-02-11 08:17:51 -06:00
J. Nick Koston
11735bc2ed Merge branch 'web-server-remove-packed-deferred-event' into integration 2026-02-11 08:13:19 -06:00
J. Nick Koston
e139722e9d [web_server] Remove unnecessary packed attribute from DeferredEvent
DeferredEvent contains two pointers (void* + function pointer), which
are already naturally 4-byte aligned on all ESPHome targets. The struct
is 8 bytes with no padding regardless of packed.

The packed attribute forces the compiler to use byte-by-byte loads and
stores instead of word-aligned access, bloating deq_push_back_with_dedup_
from 163 to 317 bytes due to shift/mask/or sequences for every field
access.

The packed attribute was added in #7538 likely to guarantee the struct
stayed at 8 bytes, but this is already the case without it since both
fields are pointer-sized.
2026-02-11 08:11:31 -06:00
J. Nick Koston
48e0c9c76b Merge branch 'preferences-eliminate-heap-fallback' into integration 2026-02-11 07:31:30 -06:00
J. Nick Koston
fe5088c6e1 [esp8266][rp2040] Eliminate heap fallback in preference save/load
Replace SmallBufferWithHeapFallback with a fixed stack buffer sized
to the physical storage limit. No single preference can exceed the
storage it resides in, so heap allocation is never needed.

ESP8266: buffer sized to max(flash_storage, rtc_normal_region) —
128 words (512B) with restore_from_flash, 96 words (384B) without.
RP2040: buffer sized to flash storage (512B).

Eliminates new[]/delete[] codegen from save()/load() virtual methods.
2026-02-11 07:27:24 -06:00
Tomasz Duda
94471be18b fix 2026-02-11 13:18:39 +01:00
Tomasz Duda
d1033e25fe fix 2026-02-11 13:09:03 +01:00
Tomasz Duda
22cd2e8274 fix 2026-02-11 13:08:07 +01:00
Tomasz Duda
054716fa51 fix 2026-02-11 12:54:35 +01:00
Tomasz Duda
eee83b0edf fix 2026-02-11 12:27:03 +01:00
Tomasz Duda
2abf013eb4 fix 2026-02-11 12:15:54 +01:00
Tomasz Duda
89cc5e91b6 fix 2026-02-11 11:36:21 +01:00
Tomasz Duda
d348a3ded0 fix 2026-02-11 11:24:37 +01:00
Tomasz Duda
66a2860526 fix 2026-02-11 10:36:13 +01:00
Tomasz Duda
ccb1d7e5bc fix 2026-02-11 10:25:16 +01:00
Tomasz Duda
9f46bed686 fix 2026-02-11 10:10:47 +01:00
Tomasz Duda
b79780f885 Merge remote-tracking branch 'origin/dev' into logger_threading 2026-02-11 09:52:40 +01:00
Tomasz Duda
d15c466f7e fix 2026-02-11 09:52:32 +01:00
J. Nick Koston
38bba3f5a2 [scheduler] Reduce set_timer_common_ hot path size by 25% (#13899) 2026-02-11 16:42:13 +13:00
J. Nick Koston
225c13326a [core] Extract dump_config from Application::loop() hot path (#13900) 2026-02-11 16:41:07 +13:00
J. Nick Koston
5281fd3273 [api] Extract cold code from APIConnection::loop() hot path (#13901) 2026-02-11 16:30:34 +13:00
J. Nick Koston
e3bafc1b45 [esp32_ble] Extract state transitions from ESP32BLE::loop() hot path (#13903)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-11 16:29:29 +13:00
Thomas Rupprecht
42bc0994f1 [rtttl] Code Improvements (#13653)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2026-02-10 22:10:29 -05:00
J. Nick Koston
1af70e67b7 Merge branch 'light-validate-eliminate-redundant-clamp' into integration 2026-02-10 21:07:20 -06:00
J. Nick Koston
0b02476e8a [light] Eliminate redundant clamp in LightCall::validate_() and normalize_color()
After clamp_and_log_if_invalid() clamps the value in-place, the
LightColorValues setter's clamp() is guaranteed to be a no-op. For 5
of 9 fields the compiler was inlining the setter's clamp, generating
~18 bytes of redundant float compare + conditional move per field.

Use friend access to assign directly to LightColorValues fields,
bypassing the setter. Also apply the same optimization to
normalize_color() where division by max_value guarantees results
stay in [0,1].
2026-02-10 21:02:24 -06:00
J. Nick Koston
e3fbbb2e99 [light] Eliminate redundant clamp in LightCall::validate_()
After clamp_and_log_if_invalid() clamps the value in-place, the
LightColorValues setter's clamp() is guaranteed to be a no-op. For 5
of 9 fields the compiler was inlining the setter's clamp, generating
~18 bytes of redundant float compare + conditional move per field.

Use friend access to assign directly to LightColorValues fields,
bypassing the setter. Saves ~204 bytes of flash on ESP32.
2026-02-10 20:45:05 -06:00
J. Nick Koston
58659e4893 [mdns] Throttle MDNS.update() polling on ESP8266 and RP2040 (#13917) 2026-02-10 18:48:13 -06:00
Jonathan Swoboda
b4707344d3 [esp32] Upgrade uv to 0.10.1 and increase HTTP retries (#13918)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:44:12 +00:00
Jonathan Swoboda
548b7e5dab [esp32] Fix ESP32-P4 test: replace stale esp_hosted component ref (#13920)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:04:12 +00:00
J. Nick Koston
4b59ea322a Merge remote-tracking branch 'origin/socket_ready_devirtualize' into integration 2026-02-10 17:41:47 -06:00
J. Nick Koston
fd683a5609 [socket] Implement working ready() for LWIP raw TCP sockets (ESP8266/RP2040)
Previously ready() always returned true on ESP8266/RP2040, causing
every socket to be checked on every loop iteration even when no data
was available.

Override ready() in LWIPRawImpl to check rx_buf_/rx_closed_/pcb_ state,
and in LWIPRawListenImpl to check accepted_socket_count_. This uses
existing fields so no extra memory is needed per socket.

Keep ready() virtual only on the non-select path (ESP8266/RP2040) so
the select()-based path (ESP32) retains the non-virtual optimization
from the previous commit.
2026-02-10 17:37:42 -06:00
Tomasz Duda
26ed6aa314 fix 2026-02-10 23:34:40 +01:00