Commit Graph

3119 Commits

Author SHA1 Message Date
J. Nick Koston bc6691da9a Merge remote-tracking branch 'origin/rp2040-upload-improvements' into integration 2026-03-09 17:49:47 -10:00
J. Nick Koston 4b83de10e5 make linux error reporting more helpful 2026-03-09 17:45:03 -10:00
J. Nick Koston 399d695a39 Merge remote-tracking branch 'upstream/dev' into rp2040-upload-improvements 2026-03-09 17:45:00 -10:00
Javier Peletier e82f0f4432 [cpptests] support testing platform components (#13075)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-10 02:41:02 +00:00
Jonathan Swoboda c31ac662bd [multiple] Fix crashes from malformed external input (#14643)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-09 20:39:58 -04:00
J. Nick Koston d6ce5dda81 [ci] Skip YAML anchor keys in integration fixture component extraction (#14670) 2026-03-09 22:54:56 +00:00
J. Nick Koston 6a0539b3d6 Merge branch 'inline-varint-parse-fast-path' into integration 2026-03-08 21:00:55 -10:00
J. Nick Koston 088a8a4338 [ci] Match symbols with changed signatures in memory impact analysis (#14600)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:23:58 -10:00
J. Nick Koston 4081f490d6 Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	esphome/components/api/api_frame_helper.h
#	esphome/core/application.h
2026-03-08 16:44:41 -10:00
Edward Firmo cac751e9e8 [nextion] Add configurable HTTP parameters for TFT upload (#14234)
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>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-09 01:29:41 +00:00
J. Nick Koston d0285cdc41 [core] Pack entity flags into configure_entity_() and protect setters (#14564)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 15:11:15 -10:00
J. Nick Koston 9cc56b82a9 Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	tests/integration/fixtures/uart_mock_ld2450.yaml
#	tests/integration/test_uart_mock_ld2450.py
2026-03-08 14:57:36 -10:00
J. Nick Koston aef2d74e41 [ld2450] Add integration tests with mock UART (#14611) 2026-03-08 14:32:59 -10:00
J. Nick Koston e1c849d5d2 [esp8266] Wrap printf/vprintf/fprintf to eliminate _vfiprintf_r (~1.6 KB flash) (#14621) 2026-03-08 14:32:47 -10:00
J. Nick Koston c11ad7f0e6 [rp2040] Wrap printf/vprintf/fprintf to eliminate _vfprintf_r (~9.2 KB flash) (#14622) 2026-03-08 14:32:35 -10:00
J. Nick Koston 88536ff72b [modbus] Fix timeout for non-hardware UARTs (e.g., USB UART) (#14614)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2026-03-08 14:31:42 -10:00
J. Nick Koston d59c2c3435 Merge branch 'esp8266-wrap-printf' into integration 2026-03-08 01:33:36 -10:00
J. Nick Koston 940cf8f206 Merge branch 'rp2040-wrap-printf' into integration 2026-03-08 01:33:31 -10:00
J. Nick Koston f13a2e08da Add enable_full_printf test coverage 2026-03-08 01:32:25 -10:00
J. Nick Koston 1e3eac2568 Add enable_full_printf test coverage 2026-03-08 01:32:05 -10:00
J. Nick Koston a6c76f9b97 Merge branch 'scheduler-raw-pointers' into integration 2026-03-08 00:21:51 -10:00
J. Nick Koston 982998c8fb [scheduler] Replace unique_ptr with raw pointers, add leak detection
The scheduler was already managing SchedulerItem lifecycle explicitly
through its object pool (recycle_item_main_loop_ / get_item_from_pool_locked_).
The unique_ptr wrapper added overhead (11 destructor call sites on the hot path)
without providing safety — if a lifecycle path was missed, the unique_ptr would
silently delete the item and cause needless heap allocations instead of pool reuse.

Replace unique_ptr<SchedulerItem, SchedulerItemDeleter> with raw SchedulerItem*
throughout. Every item is now explicitly recycled to the pool or deleted via
delete_item_(). This eliminates all 11 unique_ptr destructor calls from the hot
path and saves ~256 bytes of firmware.

Add debug leak detection under ESPHOME_DEBUG_SCHEDULER: a live-item counter
verified at the end of every call() cycle asserts that all allocated items are
accounted for in items_, to_add_, defer_queue_, or the pool. This turns silent
heap churn from missed lifecycle management into an immediate assert failure
caught by integration tests.

Also moves the retry-cancelled check before item allocation in set_timer_common_
to avoid needless alloc+delete on the cold retry path, and fixes a thread-safety
issue where recycle_item_main_loop_ (main-loop-only) was called from
set_timer_common_ which can run on non-main-loop threads.

Enable debug_scheduler: true in all 18 scheduler integration test fixtures.
2026-03-08 00:08:22 -10:00
Keith Burzinski 0c4a44566f [serial_proxy] New component (#13944)
Co-authored-by: J. Nick Koston <nick@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-08 03:55:49 -05:00
J. Nick Koston 36755d6a08 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-07 21:17:44 -10:00
tomaszduda23 e4b89a69d4 [nrf52, ota] ble and serial OTA based on mcumgr (#11932)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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>
2026-03-07 20:32:20 -10:00
J. Nick Koston 84e5825fd1 Merge remote-tracking branch 'upstream/proto-byte-buffer' into integration 2026-03-07 19:46:15 -10:00
J. Nick Koston f7aeaad929 [api] Replace std::vector<uint8_t> with APIBuffer to skip zero-fill
Replace std::vector<uint8_t> with a minimal APIBuffer class for the
shared protobuf write buffer, frame helper receive buffer (rx_buf_),
and noise handshake prologue buffer.

std::vector::resize() zero-fills new bytes via memset. Every byte is
immediately overwritten by the protobuf encoder or socket reads,
making the zero-fill pure waste. APIBuffer skips zero-initialization
on resize() and uses make_unique_for_overwrite where available.

Also removes a dead write_raw_ template overload from api_frame_helper.h.
2026-03-07 19:45:50 -10:00
Keith Burzinski 5e842a8b20 [uart] Return flush result, expose timeout via config (#14608)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-08 05:23:13 +00:00
J. Nick Koston 543e9b9b54 Merge remote-tracking branch 'upstream/fix-modbus-usb-uart-timeout' into integration 2026-03-07 18:28:07 -10:00
J. Nick Koston e6d222959b Merge remote-tracking branch 'upstream/ld2450-integration-tests' into integration 2026-03-07 18:27:54 -10:00
J. Nick Koston 3b4897381f Address review feedback
- Avoid unnecessary vector construction in static mode path
- Use wraparound-safe millis comparison for staged RX
- Fix stale comments (20ms -> 40ms, ESP-IDF -> ESP32)
- Clarify MODBUS_BITS_PER_CHAR is approximate
2026-03-07 18:25:33 -10:00
J. Nick Koston 5319b8593b Add latency simulation to uart_mock for USB UART test
Add inject_to_rx_buffer_delayed() to uart_mock which stages bytes
that aren't visible to available() until the delay elapses. This
simulates USB packet delivery latency.

The test uses a 40ms delay which is:
- Greater than the old ~2ms timeout (fails without fix)
- Less than the new 50ms fallback timeout (passes with fix)
2026-03-07 18:07:18 -10:00
J. Nick Koston ab08aa7553 fix hostname len 2026-03-07 17:51:56 -10:00
J. Nick Koston c4b26fd3f5 Add integration test for non-hardware UART and extract constants
- Add test fixture simulating USB UART (no rx_full_threshold set)
  with a 20ms gap between response chunks
- Make rx_full_threshold optional in uart_mock
- Extract MODBUS_BITS_PER_CHAR and MS_PER_SEC constexprs
2026-03-07 17:41:56 -10:00
J. Nick Koston 72232c95d8 Use YAML anchors for filter dedup, add missing assertion, fix dummy baud rate 2026-03-07 17:13:06 -10:00
J. Nick Koston d8915da9cc [ld2450] Add integration tests with mock UART 2026-03-07 17:03:16 -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 888f3d804b [ld2420] Add integration tests with mock UART (#14471) 2026-03-07 13:22:50 -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 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 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 abc870006c [captive_portal] Enable support for RP2040 (#14505) 2026-03-07 07:25:13 -10: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 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 Koston 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 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