Commit Graph
379 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 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 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 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 5d31f4aeba [light] Use function-pointer fields in LightControlAction (#15132) 2026-04-07 12:00:17 -10:00
J. Nick Koston cf78b035be Merge remote-tracking branch 'upstream/dev' into integration 2026-04-07 08:53:34 -10:00
J. Nick Koston 674d030cbb [core] Reschedule fired intervals directly into heap (#15516) 2026-04-07 07:36:55 -10:00
J. Nick Koston 9d43ed77c6 Merge remote-tracking branch 'origin/scheduler-interval-direct-heap' into integration 2026-04-06 20:58:44 -10:00
J. Nick Koston cf704b6b91 Address review: remove unused global, fix assertion messages 2026-04-06 20:54:01 -10:00
J. Nick Koston c79e7f4018 [core] Reschedule fired intervals directly into heap instead of to_add_
When an interval fires in Scheduler::call(), push it directly back into
items_ via push_back() + push_heap() instead of routing through the
to_add_ staging vector and process_to_add_slow_path_().

This eliminates per-cycle overhead of process_to_add_slow_path_() which
acquires a lock, iterates to_add_, pushes each item into the heap, clears
the vector, and resets the atomic counter.
2026-04-06 20:37:04 -10:00
J. Nick Koston d0b3cdebdb Merge remote-tracking branch 'upstream/fan-store-preset-modes-on-entity' into integration 2026-04-06 19:19:34 -10:00
J. Nick Koston e3d95817a1 Merge remote-tracking branch 'upstream/climate-store-custom-modes-on-entity' into integration 2026-04-06 19:18:58 -10:00
J. Nick Koston 60b5893ec7 Merge branch 'dev' into climate-store-custom-modes-on-entity 2026-04-06 18:46:43 -10:00
J. Nick Koston 6db21ec054 Merge branch 'dev' into fan-store-preset-modes-on-entity 2026-04-06 18:46:32 -10:00
J. Nick Koston 945a6b1063 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-03 14:33:20 -10:00
Bonne EgglestonandJ. Nick Koston c6bb1fe141 [modbus] Add integration tests for server and server via controller (#14845)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-03 20:24:02 +00:00
J. Nick Koston 6f4f852d8e Merge remote-tracking branch 'upstream/dev' into integration 2026-03-31 20:15:36 -10:00
J. Nick Koston 9b97e95cf3 [binary_sensor] Add on_multi_click integration test (#15329) 2026-03-31 07:42:12 -10:00
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 05a5c27b90 Add 2026.11.0 removal comments to integration test and fixture 2026-03-26 16:21:30 -10:00
J. Nick Koston 592371f9f6 Add 2026.11.0 removal comments to integration test and fixture 2026-03-26 16:20:32 -10:00
J. Nick Koston b5df9de79b Remove unnecessary get_setup_priority from test fixture 2026-03-26 16:08:08 -10:00
J. Nick Koston 541ab9abf9 Fix fan test: use fan_schema(), remove unnecessary get_setup_priority 2026-03-26 16:07:20 -10:00
J. Nick Koston a3f5458ae3 Fix unused services variable in test 2026-03-26 15:54:54 -10:00
J. Nick Koston 3388d420ec Fix unused services variable in test 2026-03-26 15:42:36 -10:00
J. Nick Koston 317db8438c Move set_supported_custom_* out of traits() hot path
- Midea: frost protection preset now set once in on_status_change()
  when autoconf completes, guarded by a flag
- BedJet: custom fan modes and presets moved from traits() to setup()
- Test fixture: use has_custom_fan_mode() instead of nullptr check
2026-03-26 15:36:56 -10:00
J. Nick Koston 95cdc90835 Fix to_code signature: add ConfigType annotation 2026-03-26 15:27:20 -10:00
J. Nick Koston 1c054db1f1 Fix to_code signature: add ConfigType annotation 2026-03-26 15:26:51 -10:00
J. Nick Koston 576b1c3ff0 Fix fan fixture: use C++17 namespace style 2026-03-26 15:25:13 -10:00
J. Nick Koston 991c34a4f3 Fix fixtures: remove unnecessary build flags, use C++17 namespace style 2026-03-26 15:24:38 -10:00
J. Nick Koston c8d842586a Fix fan fixture: remove unnecessary build flags 2026-03-26 15:23:44 -10:00
J. Nick Koston 2f93ba0d71 Add integration test for deprecated FanTraits compat layer 2026-03-26 15:21:11 -10:00
J. Nick Koston 602bcd2c97 Add integration test for deprecated ClimateTraits compat layer 2026-03-26 15:19:45 -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