Commit Graph
3611 Commits
Author SHA1 Message Date
J. Nick Koston 651e37dcdc Merge branch 'light-addressable-gamma-transition-stall' into integration 2026-04-13 22:57:50 -10:00
J. Nick Koston 111e2cc9ed cleanups 2026-04-13 22:56:32 -10:00
J. Nick Koston 8255afaa60 Merge remote-tracking branch 'origin/globals-set-lambda-return-type' into integration 2026-04-13 22:21:25 -10:00
J. Nick Koston a325df98da [globals] Emit globals.set value lambda with declared global type
Pass the global's declared C++ type as the lambda return type so
TemplatableFn stores a direct function pointer instead of hitting the
deprecated converting trampoline when the value expression deduces to a
different type (e.g. an int literal or int-returning lambda assigned to
a float global).
2026-04-13 21:59:54 -10:00
J. Nick Koston fa1391ac54 Merge branch 'light-force-inline-set-flag' into integration 2026-04-13 17:27:22 -10:00
J. Nick KostonandCopilot Autofix powered by AI edb16a27d3 [esphome] Skip missing extra flash images in upload_using_esptool (#15723)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-04-13 16:58:48 -10:00
J. Nick Koston 4696d70b8a Merge remote-tracking branch 'origin/light-addressable-gamma-transition-stall' into integration 2026-04-13 15:04:07 -10:00
J. Nick Koston b324630f8e [light] Type-annotate to_code in mock_addressable_light 2026-04-13 14:56:02 -10:00
J. Nick Koston 8da24fd1d9 [light] Use existing integration test helpers in transition test 2026-04-13 14:54:39 -10:00
J. Nick Koston 32130e1cb1 [light] Address Copilot review feedback on PR #15726
- mock_addressable_light.h: add direct <memory>/<cstdint>/<cstddef> includes
- test: use asyncio.get_running_loop() instead of deprecated get_event_loop()
- test: rebase timing to command-issue time (not first-nonzero) and use
  absolute progress for assertion 2, so late-transition check can't skew
  when the first nonzero sample happens to land near the assertion-1 limit
2026-04-13 14:53:17 -10:00
J. Nick Koston 3f56e0255a [light] Avoid addressable transition stall at low gamma-corrected values
When a uniform-colored addressable strip transitions from one color to
another, interpolate math-only against a cached start color instead of
reading each LED's current value back through the 8-bit stored byte.

The old algorithm used led.get_red()/etc. every step as the source for
the delta, which round-tripped through gamma uncorrect/correct and the
8-bit stored byte. At gamma 2.8, any pre-gamma value below ~27 rounds
to stored byte 0, so small early-transition steps produced stored 0 and
the next step read back 0, stalling progress until ~90% of the transition
before a single step produced a large-enough pre-gamma value to clear
the gamma threshold. Result: dark for the first 9s of a 10s fade, then
jump on in the final 1s.

Detect uniform start state in start() and take a cheap math-only lerp
path when true, so the stored byte advances through each gamma threshold
as smoothed_progress crosses it. Falls back to the existing per-LED
read-back algorithm when the buffer is non-uniform (e.g. when
transitioning out of an addressable effect).
2026-04-13 14:17:21 -10:00
J. Nick Koston ddf5ab6d1c Merge remote-tracking branch 'upstream/esptool-skip-missing-flash-images' into integration 2026-04-13 13:51:03 -10:00
J. Nick Koston 5f76b78cfa [esphome] Skip missing extra flash images in upload_using_esptool
PlatformIO's idedata may list flash images that do not exist on disk
(e.g. a tasmota tinyuf2.bin referenced by the adafruit_qtpy_esp32s3_n4r2
board). Previously the CLI passed every entry straight to esptool, which
aborted the entire flash with "No such file or directory". The dashboard
path is unaffected because it flashes the pre-merged firmware.factory.bin
produced by the post-build step, which already tolerates missing inputs.

Filter non-existent extra_flash_images with a warning so a stale or
incorrect platform-declared image no longer breaks esphome run.

Fixes https://github.com/esphome/esphome/issues/15634
2026-04-13 13:37:29 -10:00
J. Nick Koston 48a611b625 Merge remote-tracking branch 'upstream/captive-portal-ota-resume-brick' into integration 2026-04-13 13:21:31 -10:00
Jonathan Swoboda 5d0cfc31fa [core] Move FILTER_PLATFORMIO_LINES into platformio_runner (#15707) 2026-04-13 14:18:44 -04:00
J. Nick Koston b4982b9bff Merge remote-tracking branch 'upstream/proto-speed-log-response' into integration 2026-04-12 21:50:41 -10:00
J. Nick Koston 4f69c3b850 [benchmark] Add SubscribeLogsResponse encode benchmarks (#15696) 2026-04-13 02:03:53 -05:00
J. Nick Koston 5d864c3491 Merge branch 'app-loop-optimize-speed' into integration 2026-04-12 20:31:23 -10:00
J. Nick Koston 3e9f464a2c Fix clang-tidy and test for optimize(O2) attribute 2026-04-12 20:21:11 -10:00
J. Nick Koston 40c2ac2f8f Merge remote-tracking branch 'upstream/dev' into integration 2026-04-12 13:08:40 -10:00
Javier Peletier daa68a2a60 [packages] fix support packages: !include mypackages.yaml (#15677) 2026-04-13 09:48:30 +12:00
Clyde StubbsandJesse Hills 8754bbfa89 [lvgl] Fix use of rotation on host SDL (#15611)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2026-04-12 20:29:11 +00:00
J. Nick Koston 6d92cc3d2b [packages] Fix false deprecation warning and wrong error paths in nested packages (#15605) 2026-04-13 08:24:23 +12:00
J. Nick Koston 09e544125a Merge remote-tracking branch 'upstream/dev' into integration 2026-04-12 10:07:28 -10:00
Jonathan Swoboda 2f684bf4f3 [esp32] Bump platform to 55.03.38, Arduino to 3.3.8, ESP-IDF to 5.5.4 (#15666) 2026-04-12 10:07:04 -10:00
Jonathan Swoboda 45af21bf38 [canbus] Fix canbus.send can_id compile error (#15668) 2026-04-12 09:58:51 -10:00
J. Nick Koston 8800c10181 [core] Address review: fix docstrings per Copilot feedback
- get_app_state(): say 'STATUS_LED_* only', not 'STATUS_LED_* and lifecycle'
  since lifecycle bits are no longer maintained in app_state_.
- STATUS_LED_SETTLE_S: remove incorrect mention of feed_wdt re-dispatch;
  status_led_light is driven by the main loop, not feed_wdt.
- snapshot_led service: say 'status_led_light output' not 'pin state'
  since the fixture uses a template output, not GPIO.
2026-04-11 17:37:59 -10:00
J. Nick Koston 79f27d7a19 Merge branch 'drop-redundant-app-state-or' into integration 2026-04-11 16:39:14 -10:00
J. Nick Koston 515ec544ce [tests] Extract STATUS_LED_SETTLE_S constant, fix idle count check
Extract the 0.3s magic sleep into a named constant explaining why that
duration is chosen (feed_wdt re-dispatches every ~3 ms; 300 ms gives
~100 opportunities). Fix the idle-write check to snapshot AFTER the
clear instead of before it, so writes still in-flight from the error
phase don't inflate the delta.
2026-04-11 16:32:15 -10:00
J. Nick Koston 542b1fc7f3 [tests] Add set→clear→re-set round-trip check for status_led
Verifies that after clearing all status flags, re-setting a flag makes
status_led_light resume writing to its output. Guards against a future
idle optimization (like #15642) where status_led disables its own
loop() when idle: if the re-enable path were broken, the second set
would not produce writes.

Also checks that writes STOP after all flags are cleared (counter
should not keep growing), proving status_led_light correctly stops
blinking in steady state.
2026-04-11 16:28:54 -10:00
J. Nick Koston 424f1c7b0a [core] Rename any_component_has_status_flag and add integration tests
Drop the trailing underscore from any_component_has_status_flag now
that the method is public. Trailing underscores in the codebase are
reserved for protected/private members per clang-tidy naming rules,
which caused a CI failure on the previously-named public helper.

Add integration tests covering:
- Single-component status_set/clear for warning and error
- Multi-component OR semantics (both clear orders)
- Warning and error independence
- End-to-end proof that status_led_light::loop() reads App.app_state_
  and writes its output when the bits are set (via a fake template
  output whose write_action bumps a counter exposed as a sensor)
2026-04-11 16:20:05 -10:00
J. Nick Koston 09741dc97f Merge remote-tracking branch 'upstream/ota-disable-loop-when-idle' into integration 2026-04-10 17:29:50 -10:00
J. Nick Koston af8fd1d060 [esphome.ota] Fix cleanup race, tighten error message and comments, add tests
Addresses copilot review on #15636.

1. Fix cleanup_connection_() race with queued listener events.
   While an OTA session was active, a second incoming connection would
   fire esphome_socket_event_callback → esphome_wake_ota_component_any_context,
   which sets pending_enable_loop_ on the (still-active) OTA component.
   enable_pending_loops_() only scans the inactive section, so that flag
   goes invisible. When cleanup_connection_() then called disable_loop(),
   the component dropped to LOOP_DONE with a stale pending flag and
   nothing to re-trigger the scan — the queued client sat forever until
   some unrelated socket activity woke the main loop.

   Fix: don't call disable_loop() from cleanup_connection_(). loop() has
   the idempotent idle check at its top; one more dispatch after cleanup
   is cheap and guarantees we re-read server_->ready() and either accept
   the queued client or disable cleanly.

2. Tighten the multi-port error message. Merging is fine — the constraint
   is single-port. Reworded: "Only a single port is supported for 'ota'
   'platform: esphome'. Got ports [...]. Consolidate onto a single port;
   configs sharing a port are merged automatically."

3. Comment drift: three call sites and the fast-select extern declaration
   still referred to enable_loop_soon_any_context() and implied the hook
   wakes the main loop. Updated to reflect the current mechanism (sets
   pending-enable flags only; callers have already woken the main loop).
   Also clarified that esphome_wake_ota_component_any_context fires on
   every RCVPLUS event across all monitored sockets, so false wakes are
   expected and OTA::loop() disables itself again when idle.

4. Added tests/component_tests/ota/test_esphome_ota.py covering
   ota_esphome_final_validate: single instance accepted, same-port
   configs merge, different-port configs rejected with cv.Invalid,
   non-esphome platforms unaffected.
2026-04-10 14:29:32 -10:00
J. Nick Koston 6f4a502dc2 Merge remote-tracking branch 'origin/optimize-format-hex' into integration 2026-04-09 21:51:04 -10:00
J. Nick Koston 1262b98fa1 Merge remote-tracking branch 'upstream/rp2040-ethernet-lwiplock-irq-defer' into integration 2026-04-09 21:48:20 -10:00
J. Nick Koston 17209df7b5 [mcp23016] Add interrupt pin support (#15616) 2026-04-10 15:29:52 +12:00
J. Nick Koston 9cf9b02ba2 [pca6416a] Add interrupt pin support (#15614) 2026-04-10 15:29:26 +12:00
J. Nick Koston c90fa2378a [tca9555] Add interrupt pin support (#15613) 2026-04-10 15:29:00 +12:00
J. Nick Koston fd69a8e380 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-09 11:56:18 -10:00
J. Nick Koston 6fe6bf79d4 Address Copilot review: fix namespace and custom separator test 2026-04-09 09:30:06 -10:00
J. Nick Koston a941422fa6 Add unit tests for format_hex helpers 2026-04-09 08:36:40 -10:00
J. Nick Koston 03db32d045 [core] Add CodSpeed benchmarks for hot helper functions (#15593) 2026-04-09 07:48:32 -10:00
J. Nick Koston 8e02d0a20e [fan] Store preset mode vector on Fan entity to eliminate heap allocation (#15209) 2026-04-09 10:25:37 +12:00
J. Nick Koston faa05031a7 [climate] Store custom mode vectors on Climate entity to eliminate heap allocation (#15206) 2026-04-09 10:25:29 +12:00
J. Nick Koston 576d89a82a [api] Peel first write iteration, inline socket writes, zero-gap batch encoding (#15063) 2026-04-08 11:05:53 -10:00
J. Nick Koston d9ebe1e1e7 Merge branch 'crash-handler-dual-core' into integration 2026-04-08 09:34:33 -10:00
Clyde Stubbs 7de060ed55 [lvgl] Fix args for lambda in set_rotation action (#15555) 2026-04-09 07:22:24 +12:00
J. Nick Koston a72609e640 [yaml] Resolve top-level IncludeFile in load_yaml (#15557) 2026-04-08 08:39:14 -04:00
J. Nick KostonandCopilot a8b7c7a4ac [core] Add TemplatableFn for 4-byte function-pointer templatable storage (#15545)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-08 08:38:00 -04:00
J. Nick Koston ca61dc5d69 Merge remote-tracking branch 'upstream/test_merge_to_beta_again' into integration 2026-04-07 22:48:15 -10:00