Commit Graph
337 Commits
Author SHA1 Message Date
J. Nick Koston 85529ee518 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-03-29 12:36:30 -10:00
J. Nick Koston 584807b039 [ld2410] Fix flaky integration test race condition (#15299) 2026-03-29 11:58:03 -10:00
J. Nick Koston fc1d590186 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-27 11:24:23 -10:00
J. Nick Koston f5cd1e5e76 [ld2450] Fix flaky integration test race condition (#15226) 2026-03-27 08:23:26 -10:00
J. Nick Koston 9fb5b6aa15 [light] Replace initial_state storage with flash-resident callback (#15133) 2026-03-24 14:03:18 -10:00
J. Nick Koston d632f1070b Merge branch 'light-initial-state-callback' into integration 2026-03-23 20:43:51 -10:00
J. Nick Koston a53b0f4646 Add integration test for light initial_state 2026-03-23 20:40:56 -10:00
J. Nick Koston 7927b9d885 Merge remote-tracking branch 'upstream/light-control-action-compact' into integration 2026-03-23 20:04:54 -10:00
J. Nick Koston 04c6e7e770 [light] Use compact per-field union storage in LightControlAction
Replace 14 TemplatableValue fields with a per-field union that stores
either a constant value or a callable pointer in the same 4 bytes
(on 32-bit targets). A 2-bit-per-field type tag in a uint32_t tracks
field state (unset/constant/stateless lambda/stateful lambda).

Reduces LightControlAction from 128 to 76 bytes per instance on ESP32.
For a config with 8 light actions, this saves 416 bytes of RAM and
476 bytes of flash (from eliminated TemplatableValue template
instantiations).
2026-03-23 20:03:34 -10:00
J. Nick Koston b36a049761 Merge branch 'add-w5100-ethernet-support' into integration 2026-03-23 19:57:21 -10:00
J. Nick Koston bd7bdc0e2d Merge remote-tracking branch 'upstream/devirtualize-decode' into integration 2026-03-22 21:39:51 -10:00
J. Nick Koston 5560c9eef7 [test] Fix flakey ld2412 integration test race condition (#15100) 2026-03-22 21:10:51 -10:00
Keith BurzinskiandClaude Sonnet 4.6 225330413a [uart] Rename FlushResult to UARTFlushResult with UART_FLUSH_RESULT_ prefix (#15101)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 01:55:14 -05:00
J. Nick Koston 4a2ff62d68 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-22 12:58:13 -10:00
J. Nick Koston 4d09eb2cec [tests] Fix flaky ld24xx integration tests by disabling API batching (#15050) 2026-03-22 12:29:28 -10:00
J. Nick KostonandCopilot 5e68282519 [light] Fix constant_brightness broken by gamma LUT refactor (#15048)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-23 09:14:52 +13:00
J. Nick Koston b08de20e6d Merge remote-tracking branch 'upstream/fix-constant-brightness-gamma' into integration 2026-03-20 22:14:36 -10:00
J. Nick KostonandCopilot 4d805e2d30 Update tests/integration/test_light_constant_brightness.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-20 22:06:03 -10:00
J. Nick Koston f50720a3c5 [light] Add integration tests for constant_brightness with gamma
Regression tests for #15040 using a single compiled binary with two
cwww lights to verify:
- constant_brightness: true maintains constant total CW+WW power
  output across all color temperatures with gamma correction
- constant_brightness: false correctly varies total power (higher
  at mid-range where both channels contribute)
2026-03-20 22:00:44 -10:00
J. Nick Koston 870f93d797 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-15 14:30:46 -10:00
Bonne EgglestonandJ. Nick Koston 92d5e7b18c [tests] Fix integration helper to match entities exactly (#14837)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-15 13:02:23 -10:00
J. Nick Koston 6bdaa4c972 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-13 09:07:55 -10:00
J. Nick Koston bd844fcd0a [template] Fix misleading 'Text value too long to save' warning (#14753) 2026-03-13 07:37:44 -10:00
Kjell Braden 326769e43c [runtime_image] fix BMP parsing (#14762) 2026-03-13 09:18:42 -04:00
J. Nick Koston b074aebd6d Merge branch 'fix-template-text-save-warning' into integration 2026-03-12 19:21:04 -10:00
J. Nick Koston b81ef4697f [template] Fix misleading 'Text value too long to save' warning
TextSaver::save() returned false for both unchanged values and
values that are too long, causing a misleading warning on every
duplicate save. Return true early when the value hasn't changed.

Add integration test for template text save/restore persistence.
2026-03-12 18:05:44 -10:00
J. Nick Koston 89719cf4b2 [water_heater] Set OPERATION_MODE feature flag when modes are configured (#14748) 2026-03-12 14:48:41 -10:00
J. Nick Koston 47a3f29962 Merge branch 'fix-water-heater-operation-mode-flag' into integration 2026-03-12 14:44:30 -10:00
J. Nick Koston 77068ea410 [water_heater] Add integration test assertion for OPERATION_MODE feature flag 2026-03-12 14:12:47 -10:00
J. Nick Koston 4d2ef09a29 [log] Detect early log calls before logger init and optimize hot path (#14538) 2026-03-10 09:12:10 -10:00
J. Nick Koston 9dd3ec258c [scheduler] Replace unique_ptr with raw pointers, add leak detection (#14620) 2026-03-10 09:11:28 -10:00
J. Nick Koston bc6691da9a Merge remote-tracking branch 'origin/rp2040-upload-improvements' into integration 2026-03-09 17:49:47 -10:00
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 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 KostonandClyde Stubbs 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 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
J. Nick Koston 84e5825fd1 Merge remote-tracking branch 'upstream/proto-byte-buffer' into integration 2026-03-07 19:46:15 -10:00
Keith BurzinskiJ. Nick Kostonpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
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 888f3d804b [ld2420] Add integration tests with mock UART (#14471) 2026-03-07 13:22:50 -10:00