Commit Graph

23234 Commits

Author SHA1 Message Date
J. Nick Koston
ff1289671e Merge remote-tracking branch 'upstream/dev' into integration 2026-02-25 11:46:16 -07:00
J. Nick Koston
8bb577de64 [api] Split ProtoVarInt::parse into 32-bit and 64-bit phases (#14039) 2026-02-25 12:23:13 -06:00
Thomas Rupprecht
ede8235aae [core] more accurate check for leap year and valid day_of_month (#14197)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-25 16:46:28 +00:00
Szpadel
37a0cec53d [ac_dimmer] Use a shared ESP32 GPTimer for multiple dimmers (#13523)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-25 16:12:03 +00:00
J. Nick Koston
97ec64c8e0 Merge branch 'light-effect-index-codegen' into integration 2026-02-25 09:10:05 -07:00
esphomebot
78ab63581b Update webserver local assets to 20260225-155043 (#14275)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-02-25 16:09:45 +00:00
J. Nick Koston
9494d58e07 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-25 09:06:07 -07:00
J. Nick Koston
1beeb9ab5c [web_server] Fix uptime display overflow after ~24.8 days (#13739) 2026-02-25 08:54:32 -07:00
Jonathan Swoboda
228874a52b [config] Improve dimensions validation and fix online_image resize aspect ratio (#14274)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-25 10:45:50 -05:00
Big Mike
bb05cfb711 [sensirion_common] Move sen5x's sensirion_convert_to_string_in_place() function to sensirion_common (#14269) 2026-02-25 07:34:58 -05:00
J. Nick Koston
b134c4679c [light] Replace std::lerp with lightweight lerp_fast in LightColorValues::lerp (#14238) 2026-02-24 22:33:57 -06:00
J. Nick Koston
427940f626 Add comment explaining empty capture in effect lambda wrapper 2026-02-24 22:33:20 -06:00
Jonathan Swoboda
2e705a919f [pid] Fix deadband threshold conversion for Fahrenheit (#14268)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-24 23:26:00 -05:00
J. Nick Koston
08c98e8229 Merge branch 'dev' into light-effect-index-codegen 2026-02-24 21:40:00 -06:00
J. Nick Koston
1dac501b04 [light] Add additional light effect test cases (#14266) 2026-02-24 21:39:51 -06:00
Jesse Hills
905e81330e Don't get stuck forever on a failed component can_proceed (#14267) 2026-02-25 03:28:19 +00:00
J. Nick Koston
2e8cc548de Merge branch 'light_tests_add' into light-effect-index-codegen 2026-02-24 20:40:22 -06:00
J. Nick Koston
ee3152142a Add additional light effect test cases
for https://github.com/esphome/esphome/pull/14265
2026-02-24 20:39:38 -06:00
J. Nick Koston
ae296af582 light effect to uint32_t 2026-02-24 20:38:33 -06:00
J. Nick Koston
3460a8c922 [dlms_meter/kamstrup_kmp] Replace powf with pow10_int (#14125)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 13:44:50 +13:00
J. Nick Koston
2ff876c629 [core] Use custom deleter for SchedulerItem unique_ptr to prevent destructor inlining (#14258)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-02-25 13:18:44 +13:00
J. Nick Koston
08dc487b5b [core] Pass std::function by rvalue reference in scheduler (#14260) 2026-02-25 13:08:07 +13:00
J. Nick Koston
4dc6b12ec5 [api] Pass std::function by rvalue reference in state subscriptions (#14261) 2026-02-25 12:56:43 +13:00
J. Nick Koston
cca4777f64 [web_server_idf] Pass std::function by rvalue reference (#14262) 2026-02-25 12:51:01 +13:00
J. Nick Koston
cbb191ca2b Merge remote-tracking branch 'upstream/dev' into integration 2026-02-24 17:28:25 -06:00
Andrew Rankin
af00d601be [esp32_ble_server] add max_clients option for multi-client support (#14239) 2026-02-25 08:19:13 +11:00
J. Nick Koston
eae71c38e5 Merge branch 'web-server-rvalue-ref-func' into integration 2026-02-24 14:02:20 -06:00
J. Nick Koston
117a7fe628 Merge branch 'api-rvalue-ref-func' into integration 2026-02-24 14:02:15 -06:00
J. Nick Koston
32132c0216 [web_server_idf] Pass std::function by rvalue reference
All set_data_callback, set_part_complete_callback, onNotFound, and
onConnect methods were taking std::function/callback by value despite
every caller passing a lambda temporary. Change to rvalue reference
to eliminate unnecessary move+destroy overhead.
2026-02-24 13:56:15 -06:00
J. Nick Koston
9420fb8452 [api] Pass std::function by rvalue reference in state subscriptions
All subscribe_home_assistant_state, get_home_assistant_state, and
add_state_subscription_ methods were taking std::function by value
despite every caller passing a temporary or std::move()'d value.
Change to rvalue reference to eliminate unnecessary move+destroy
overhead at each forwarding layer.
2026-02-24 13:53:19 -06:00
J. Nick Koston
ec914fcb77 Merge remote-tracking branch 'upstream/scheduler-rvalue-ref-func' into integration 2026-02-24 13:45:32 -06:00
J. Nick Koston
eedb1be19c [core] Pass std::function by rvalue reference in set_timer_common_
Change set_timer_common_ to take std::function<void()>&& instead of
by value. This avoids materializing a std::function copy on the stack
at each call site — the caller just passes a pointer to the rvalue.

On BK7231N (Thumb-1), each forwarder (set_timeout, set_interval) was
118 bytes due to the inlined std::function move constructor + register
spilling. With rvalue reference, they shrink to 32 bytes each.

All 12 callers already pass rvalues (std::move or lambda temporaries),
so this is a purely mechanical change with no semantic difference.

BK7231N: forwarders 118 -> 32 bytes each, ~258 bytes saved total
ESP32: forwarders 46 -> 30 bytes each, ~20 bytes saved total
2026-02-24 13:35:06 -06:00
J. Nick Koston
a53fd4f586 Merge branch 'scheduler-rvalue-ref-func' into integration 2026-02-24 13:25:46 -06:00
J. Nick Koston
b3983bc088 [core] Pass std::function by rvalue reference in set_timer_common_
Change set_timer_common_ to take std::function<void()>&& instead of
by value. This avoids materializing a std::function copy on the stack
at each call site — the caller just passes a pointer to the rvalue.

On BK7231N (Thumb-1), each forwarder (set_timeout, set_interval) was
118 bytes due to the inlined std::function move constructor + register
spilling. With rvalue reference, they shrink to 32 bytes each.

All 12 callers already pass rvalues (std::move or lambda temporaries),
so this is a purely mechanical change with no semantic difference.

BK7231N: forwarders 118 -> 32 bytes each, ~258 bytes saved total
ESP32: forwarders 46 -> 30 bytes each, ~20 bytes saved total
2026-02-24 13:19:53 -06:00
Jonathan Swoboda
fe3c2ba555 [http_request.ota] Percent-encode credentials in URL (#14257)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-24 14:15:22 -05:00
J. Nick Koston
95623476c5 Merge remote-tracking branch 'upstream/scheduler-custom-deleter-bk7231n' into integration
# Conflicts:
#	esphome/core/scheduler.h
2026-02-24 12:23:35 -06:00
J. Nick Koston
e3bf2d78d1 [core] Use custom deleter for SchedulerItem unique_ptr to prevent destructor inlining
On BK7231N (Thumb-1/Cortex-M0), GCC inlines ~unique_ptr<SchedulerItem>
(~30 bytes: null check + ~std::function + operator delete) at every
destruction site, while ESP32/ESP8266/RTL8720CF outline it into a single
shared helper. This causes significant flash bloat in scheduler functions.

Use a custom deleter (SchedulerItemDeleter) with its operator() defined
in the .cpp file, ensuring the compiler emits exactly one copy of the
destruction code. All destruction sites now generate a simple function
call instead of inlining the full body.

BK7231N savings (bytes):
- call():           816 -> 670  (-146)
- process_to_add(): 390 -> 308  (-82)
- __adjust_heap:    430 -> 312  (-118)
- pop_raw_locked_(): 192 -> 140  (-52)
- cleanup_():       130 -> 112  (-18)
- SchedulerItemDeleter: +32 (new, single copy)
- Net: ~384 bytes saved

ESP32/ESP8266/RTL8720CF are unaffected (already outline the destructor).
2026-02-24 12:10:21 -06:00
J. Nick Koston
535fb86c9c Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	esphome/core/scheduler.h
2026-02-24 12:09:20 -06:00
J. Nick Koston
6554ad7c7e [core] Prevent inlining of mark_matching_items_removed_locked_ on Thumb-1 (#14256) 2026-02-24 12:08:51 -06:00
J. Nick Koston
6dac62d0df Merge branch 'scheduler-custom-deleter-bk7231n' into integration
# Conflicts:
#	esphome/core/scheduler.h
2026-02-24 11:54:20 -06:00
J. Nick Koston
60dc18b80c [core] Use custom deleter for SchedulerItem unique_ptr to prevent destructor inlining
On BK7231N (Thumb-1/Cortex-M0), GCC inlines ~unique_ptr<SchedulerItem>
(~30 bytes: null check + ~std::function + operator delete) at every
destruction site, while ESP32/ESP8266/RTL8720CF outline it into a single
shared helper. This causes significant flash bloat in scheduler functions.

Use a custom deleter (SchedulerItemDeleter) with its operator() defined
in the .cpp file, ensuring the compiler emits exactly one copy of the
destruction code. All destruction sites now generate a simple function
call instead of inlining the full body.

BK7231N savings (bytes):
- call():           816 -> 670  (-146)
- process_to_add(): 390 -> 308  (-82)
- __adjust_heap:    430 -> 312  (-118)
- pop_raw_locked_(): 192 -> 140  (-52)
- cleanup_():       130 -> 112  (-18)
- SchedulerItemDeleter: +32 (new, single copy)
- Net: ~384 bytes saved

ESP32/ESP8266/RTL8720CF are unaffected (already outline the destructor).
2026-02-24 11:48:48 -06:00
J. Nick Koston
3660363eaf Merge remote-tracking branch 'upstream/noinline-mark-matching-items-removed' into integration 2026-02-24 11:18:10 -06:00
J. Nick Koston
7ec61ae265 [core] Prevent inlining of mark_matching_items_removed_locked_
The BK7231N Thumb-1 compiler inlines this function 3 times into
cancel_item_locked_, bloating it from ~140 B to 666 B. ESP32 and
RTL8720CF compilers already outline it, so this attribute only
affects BK7231N. Saves ~486 B of flash.
2026-02-24 11:15:52 -06:00
J. Nick Koston
f1810550f3 Merge branch 'extend_ultra_low_latency_select_libretiny' into integration 2026-02-24 10:47:58 -06:00
J. Nick Koston
2e6d10474e Add socket build tests for LibreTiny platforms
Add bk72xx-ard, rtl87xx-ard, and ln882x-ard YAML build tests to
verify the fast select code path compiles on all LibreTiny platforms.
2026-02-24 10:29:49 -06:00
J. Nick Koston
d812683df1 Use platform build flags in lwip_fast_select.c guard
USE_ESP32 and USE_LIBRETINY are compiler flags (-D) always available
to .c files. USE_LWIP_FAST_SELECT is in the generated defines.h which
may not be force-included for .c files on all build systems. Use
platform flags directly in the .c file; .cpp/.h files continue using
USE_LWIP_FAST_SELECT from the generated defines.
2026-02-24 09:49:07 -06:00
J. Nick Koston
3f74726f00 [core] Extend fast select optimization to LibreTiny platforms
Extend the ESP32 lwip_select() replacement (direct rcvevent reads +
FreeRTOS task notifications) to all LibreTiny platforms (bk72xx,
rtl87xx, ln882h).

All LibreTiny platforms have LwIP >= 2.1.3 with
lwip_socket_dbg_get_socket() and FreeRTOS task notifications. The
thread safety argument is actually stronger on LibreTiny since all
platforms are single-core ARM Cortex-M, eliminating cross-core
memory ordering concerns entirely.

Introduces USE_LWIP_FAST_SELECT feature define (set from Python
codegen for ESP32 and LibreTiny) replacing per-platform USE_ESP32
guards. The only platform-specific difference is FreeRTOS header
paths (freertos/FreeRTOS.h on ESP-IDF vs FreeRTOS.h on LibreTiny).

Expected impact on LibreTiny (same as ESP32):
- ~17x faster socket polling (direct rcvevent vs lwip_select)
- ~3.5 KB flash savings (dead code elimination of lwip_select)
- ~56 bytes static RAM savings (fd_set members excluded)
- ~200-300 bytes heap savings (UDP wake socket eliminated)
2026-02-24 09:39:38 -06:00
J. Nick Koston
fc5b94df6c pressure test 2026-02-24 08:48:50 -06:00
J. Nick Koston
40da111322 Merge branch 'ultra_low_latancy_select_esp32' into integration 2026-02-24 08:44:43 -06:00
J. Nick Koston
73092d14a5 tweak comments 2026-02-24 08:44:31 -06:00