Commit Graph
24223 Commits
Author SHA1 Message Date
J. Nick Koston ce3fcca292 Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-03-07 14:51:36 -10:00
J. Nick Koston da8de59bcb Merge remote-tracking branch 'upstream/proto-byte-buffer' into integration 2026-03-07 13:38:26 -10:00
J. Nick Koston 2a1af73d6f Merge branch 'dev' into proto-byte-buffer 2026-03-07 13:34:15 -10:00
J. Nick Koston e3c9f851a4 Merge remote-tracking branch 'upstream/proto-byte-buffer' into integration 2026-03-07 13:33:01 -10:00
J. Nick Koston 51cff74f03 [api] Outline ProtoByteBuffer reallocation into grow_()
The capacity check in reserve()/resize() is the hot path and stays
inline via ESPHOME_ALWAYS_INLINE. The actual reallocation (make_buffer
+ memcpy) is a cold path outlined into grow_() to avoid bloating
every call site. resize() delegates to reserve() for the capacity
check since both inline to the same code.
2026-03-07 13:32:23 -10:00
J. Nick Koston 06525e14d7 Merge remote-tracking branch 'upstream/proto-byte-buffer' into integration 2026-03-07 13:29:13 -10:00
J. Nick KostonandClaude Opus 4.6 9e082edecb [api] Outline ProtoByteBuffer reallocation into grow_()
The capacity check in reserve()/resize() is the hot path and stays
inline. The actual reallocation (make_buffer + memcpy) is a cold path
that should be outlined to avoid bloating every call site.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:28:04 -10:00
J. Nick Koston 888f3d804b [ld2420] Add integration tests with mock UART (#14471) 2026-03-07 13:22:50 -10:00
J. Nick Koston 545395a6f0 [ci] Add RP2350 to PR template test environment (#14599) 2026-03-07 13:16:19 -10:00
Oliver Kleinecke f2dfb5e1dc [uart][usb_uart] Add debug_prefix option to distinguish multiple defined uarts in log (#14525) 2026-03-08 10:16:12 +11:00
J. Nick Koston a79c616879 Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-03-07 12:46:07 -10:00
J. Nick Koston 76dd72e162 Merge branch 'proto-byte-buffer' into integration 2026-03-07 09:04:28 -10:00
J. Nick Koston d3c5d91469 [api] Expand ProtoByteBuffer comment to explain why skipping zero-fill is safe 2026-03-07 09:03:55 -10:00
Diorcet YannandJonathan Swoboda 3f700bac1c [component] Fix components for compatibility with stricter compilers (#14545)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-07 18:50:44 +00:00
J. Nick Koston 7d52948529 [api] Fix comment to include LN882x in fallback list 2026-03-07 08:50:06 -10:00
J. Nick Koston 46b730e412 [api] Fix comment to include LN882x in fallback list 2026-03-07 08:50:01 -10:00
J. Nick Koston 159c62fff5 Merge remote-tracking branch 'upstream/proto-byte-buffer' into integration 2026-03-07 08:43:30 -10:00
J. Nick Koston 4ce1c3ffd9 [api] Also fall back to make_unique on LN882x; add LN882x test config 2026-03-07 08:42:32 -10:00
J. Nick Koston 0867866317 [api] Also fall back to make_unique on LN882x; add LN882x test config 2026-03-07 08:42:22 -10:00
J. Nick Koston 67ad9bf4e2 Merge branch 'proto-byte-buffer' into integration 2026-03-07 08:39:36 -10:00
J. Nick Koston 961d55883c [api] Fall back to make_unique on BK72xx (older GCC lacks make_unique_for_overwrite) 2026-03-07 08:39:01 -10:00
J. Nick Koston b8fedf6e5b [api] Fall back to make_unique on BK72xx (older GCC lacks make_unique_for_overwrite) 2026-03-07 08:38:52 -10:00
J. Nick Koston a4a7bbb149 Merge branch 'proto-byte-buffer' into integration 2026-03-07 08:22:54 -10:00
J. Nick Koston 25a68e9339 [api] Inline capacity check in ProtoByteBuffer::resize()
Avoid calling reserve() when capacity is already sufficient.
After warmup, resize() becomes just a compare + store with no
function call overhead on the hot path.
2026-03-07 08:22:09 -10:00
J. Nick Koston 85e818dda7 [api] Replace std::vector<uint8_t> with ProtoByteBuffer for shared write buffer
The API protobuf write path uses a shared buffer that gets resize()'d on
every message send. std::vector::resize() zero-fills new bytes, but every
byte is overwritten by the encoder before being read. For a 16-advertisement
BLE proxy batch, this wastes ~1300 bytes of memset per flush (~10x/second).

ProtoByteBuffer is a minimal replacement that skips zero-initialization on
resize(). On ESP32/RP2040/LibreTiny it also skips zero-fill on allocation
via make_unique_for_overwrite. On ESP8266 it falls back to make_unique
(zero-fills on alloc, but resize still doesn't zero-fill — the main win
is preserved since reserve is typically a no-op after warmup).
2026-03-07 08:17:37 -10:00
J. Nick Koston 0fd58c6ce0 Merge remote-tracking branch 'upstream/staticvector-skip-zero-init' into integration 2026-03-07 08:02:38 -10:00
J. Nick Koston b8b219926d [core] Skip zero-initialization of StaticVector data array
Remove value-initialization ({}) from StaticVector's underlying
std::array. Only elements [0, count_) are ever accessed, so
initializing the full array is wasted work.

This eliminates a memset on every construction. Most impactful for
stack-allocated StaticVectors in hot paths like
APIPlaintextFrameHelper::write_protobuf_messages, which was
memsetting 276 bytes of iovec storage on every BLE proxy flush.
2026-03-07 08:01:08 -10:00
J. Nick Koston ed8e90bcb6 Merge remote-tracking branch 'upstream/inline-ble-addr-to-uint64' into integration 2026-03-07 07:57:35 -10:00
J. Nick Koston 9c56c95cf8 [esp32_ble] Inline ble_addr_to_uint64 to eliminate call overhead
Move ble_addr_to_uint64 from ble.cpp to ble.h as inline. This
eliminates the indirect call and Xtensa register window rotation
at all 3 call sites, most importantly in the BLE proxy hot path
(BluetoothProxy::parse_devices) which calls it per advertisement.

Saves 24 bytes of flash overall.
2026-03-07 07:56:34 -10:00
J. Nick Koston f05b1ab036 Merge branch 'protect_entity_setters' into integration
# Conflicts:
#	esphome/components/bluetooth_proxy/bluetooth_proxy.cpp
2026-03-07 07:44:47 -10:00
J. Nick Koston 70a01158d3 Merge remote-tracking branch 'upstream/dev' into protect_entity_setters
# Conflicts:
#	esphome/core/entity_base.cpp
#	esphome/core/entity_base.h
#	esphome/core/entity_helpers.py
#	tests/component_tests/sensor/test_sensor.py
#	tests/component_tests/text_sensor/test_text_sensor.py
2026-03-07 07:30:27 -10:00
J. Nick Koston a0cd35c5fc [core] Inline status_clear_warning/error fast path (#14571) 2026-03-07 07:27:08 -10:00
J. Nick Koston e7b8ec18f1 [api] Inline APIServer::is_connected() for common no-arg path (#14574) 2026-03-07 07:26:50 -10:00
J. Nick Koston 77f2c371b2 [api] Single-pass protobuf encode for BLE proxy advertisements (#14575) 2026-03-07 07:26:34 -10:00
J. Nick KostonandClaude Opus 4.6 45f20d9c06 [core] Merge set_name + set_entity_strings into configure_entity_ (#14444)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 07:26:01 -10:00
J. Nick Koston f57fa4cc8d [bluetooth_proxy] Add BLE connection parameters API (#14577) 2026-03-07 07:25:33 -10:00
J. Nick Koston abc870006c [captive_portal] Enable support for RP2040 (#14505) 2026-03-07 07:25:13 -10:00
puddly 15ffbb0b05 [uart] Fully enable raw mode with host serial (#14573) 2026-03-07 11:51:02 -05:00
Simon Redman 8b62c35ea7 [uart] Add error message when initializing UART with unsupported configuration (#13229) 2026-03-07 11:41:37 -05:00
tomaszduda23 0e106d843c [nrf52][zephyr] support for multi on rate callbacks (#14557) 2026-03-07 11:18:21 -05:00
rwrozelle cbebb81196 [openthread] move esp functions into correct file (#14588) 2026-03-07 11:12:27 -05:00
J. Nick Koston 1336198423 Merge branch 'warn-crystal-mismatch' into integration
# Conflicts:
#	tests/unit_tests/test_util.py
2026-03-06 22:45:07 -10:00
J. Nick Koston 1312fe2658 Merge branch 'proto-backpatch-encode' into integration 2026-03-06 22:42:53 -10:00
J. Nick KostonandClaude Opus 4.6 696c0f021c Patch at import point instead of subprocess.run
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:38:44 -10:00
J. Nick KostonandClaude Opus 4.6 9f72d5e428 Add test for run_external_process line_callbacks coverage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:35:33 -10:00
J. Nick Koston d1b2010ed2 Use walrus operator in crystal regex match 2026-03-06 22:31:38 -10:00
J. Nick Koston 84383755d7 Fix pylint disable comment placement for esptool.main 2026-03-06 22:30:40 -10:00
J. Nick Koston dc4506453e Add tests for crystal callback wiring in upload_using_esptool
Tests both the in-process (run_external_command) and subprocess
(run_external_process) paths to ensure line_callbacks are passed.
2026-03-06 22:29:23 -10:00
J. Nick Koston 511e47b0f5 Remove unnecessary CORE mock from tests
CORE.reset() is called after each test via the reset_core fixture,
and CORE.dashboard defaults to False, so patching is not needed.
2026-03-06 22:26:12 -10:00
J. Nick Koston ae8dabc41a Add test for run_external_command with line_callbacks 2026-03-06 22:25:18 -10:00