Use real TCP sockets instead of AF_UNIX socketpair so TCP_NODELAY
succeeds during init() and the benchmark exercises the full write
path. Replace hardcoded message type 38 with SensorStateResponse::MESSAGE_TYPE.
Avoid benchmarking heap allocation by pre-reserving the buffer
to typical TCP MSS size and reusing it across iterations, matching
real-world usage where the buffer persists across writes.
Extract the gamma table generation into a public generate_gamma_table()
function and add unit tests covering table properties and the
zero_means_zero regression from #15055.
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)
Only advance last_heater_millis_ after the heater command succeeds
so a failed write retries on the next cycle instead of silently
skipping.
Add heater settings to the test YAML to ensure CI exercises the
heater code path.
FixedVector requires init() before push_back(). Update all test cases
to call set_sensor_count()/set_binary_sensor_count() before adding
sensors, matching what the Python codegen does.
Add find_first parameter to cancel_item_locked_ and
mark_matching_items_removed_locked_, defaulting to false (cancel all).
When find_first=true, stops after the first match and exits across
containers. set_timer_common_ passes find_first=true where the
cancel-before-add invariant guarantees at most one match.
The public cancel path uses the default find_first=false to cancel ALL
matches, needed for DelayAction parallel mode where skip_cancel=true
can create multiple items with the same key.
Also fixes the Scheduler_SetInterval benchmark to call
process_to_add() every kKeyCount registrations with a final drain
after the inner loop, reflecting production behavior.
The test was calling show_logs() which invokes _wait_for_serial_port("/dev/ttyUSB0").
Since that path doesn't exist in CI/dev environments, it spun in a 30-second polling
loop before returning. Add mock_wait_for_serial_port fixture to skip the wait.
The compiler constant-folds ProtoSize::varint(42) to 1 and optimizes
the entire inner loop to a single addition, causing ~62ns jitter-dominated
measurements. Use varying inputs (i & 0x7F for small, 0xFFFF0000 | i for
large) so each call computes a real result.