Commit Graph
26197 Commits
Author SHA1 Message Date
J. Nick Koston fd06aa3f8b reverts 2026-03-29 15:37:21 -10:00
J. Nick Koston 3caf1436ff reverts 2026-03-29 15:37:01 -10:00
J. Nick Koston 9b3b251053 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-29 15:33:29 -10:00
J. Nick Koston f28084d464 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-03-29 15:33:19 -10:00
J. Nick Koston 18168ad7fd [sensor] Use std::array in CalibrateLinearFilter (#15263) 2026-03-29 15:07:15 -10:00
J. Nick Koston a308b8993e Merge branch 'dev' into api/peel-first-write-iteration 2026-03-29 15:06:57 -10:00
J. Nick Koston 3ad35a1b60 fix refactoring error 2026-03-29 15:06:23 -10:00
J. Nick Koston 17afbeb87b [binary_sensor] Use std::array in MultiClickTrigger (#15267) 2026-03-29 14:57:15 -10:00
J. Nick Koston d51b047f63 [sensor] Use std::array in CalibratePolynomialFilter (#15264) 2026-03-29 14:56:04 -10:00
J. Nick Koston 508ec295a4 [sensor] Use std::array in OrFilter (#15262) 2026-03-29 14:55:46 -10:00
J. Nick Koston 2e68b89fff [api] Use HEADER_PADDING directly instead of local alias 2026-03-29 14:34:29 -10:00
J. Nick Koston adf0ce7fbd [api] Remove redundant frame_header_padding arg from write_plaintext_header
It's always HEADER_PADDING (constexpr 6). Using it directly inside
the function eliminates an argument and lets the compiler constant-fold.
2026-03-29 14:33:51 -10:00
J. Nick Koston ccafd442a7 [api] Use static constexpr HEADER_PADDING instead of loading member field
The header padding is a compile-time constant per protocol (6 for
plaintext, 7 for noise). Using constexpr eliminates memory loads
on the hot path. The value is defined once per class with the
component breakdown in the comment.
2026-03-29 14:32:47 -10:00
J. Nick Koston a19a6f2a0e [api] Return header length from write_plaintext_header instead of pointer
Returning total_header_len lets callers compute msg_len directly
(header_len + payload_size) instead of reloading frame_header_padding_
from memory and doing pointer subtraction after encode_varint calls
clobber registers. Saves ~10 bytes in write_protobuf_packet.
2026-03-29 14:26:50 -10:00
J. Nick Koston 66754fa376 [text_sensor] Use std::array in SubstituteFilter (#15266) 2026-03-29 14:24:32 -10:00
J. Nick Koston a84d36cb37 preen 2026-03-29 14:18:01 -10:00
J. Nick Koston d91484c19f [api] Swap sentinel values: WRITE_FAILED=-1 matches write() return
WRITE_FAILED=-1 matches the socket write() return value directly,
so the fast path can pass sent through without remapping. Simplifies
both the inline fast path and the slow path errno check.
2026-03-29 14:12:31 -10:00
J. Nick Koston 5f2ad82a67 [api] Use named sentinels to avoid redundant syscall on write failure
WRITE_NOT_ATTEMPTED (-1): cold path, no write tried yet — try write
WRITE_FAILED (-2): fast path write() returned -1 — skip retry, check errno

This avoids a redundant write() syscall when the fast path already
got EWOULDBLOCK and fell through to the slow path.
2026-03-29 14:10:11 -10:00
J. Nick Koston 2e1d6e4d58 [api] Move HELPER_LOG_PACKETS logging to call sites before fast path
LOG_PACKET_SENDING was in write_raw_iov_ which is only called on
the slow path. Moved to write_protobuf_packet and write_protobuf_messages
so all packets are logged regardless of which write path is taken.
2026-03-29 13:52:29 -10:00
J. Nick Koston 4da7f5ecc2 [binary_sensor] Use std::array in AutorepeatFilter (#15268) 2026-03-29 23:50:46 +00:00
J. Nick Koston 1c1ddf463b [api] Fix write_raw_iov_ not attempting write when called directly with empty overflow
When called from cold paths (write_raw_buf_, write_frame_) with
sent=-1 and empty overflow, the function would skip the write and
read a stale errno. Now always attempts the write when overflow is
empty, matching the original write_raw_ behavior.
2026-03-29 13:49:47 -10:00
J. Nick Koston b4de015706 [api] Use buf_start directly in noise write_protobuf_packet, add flow comment 2026-03-29 13:42:57 -10:00
J. Nick Koston 6ff0d33ca4 [api] Add safety check for full write in write_raw_iov_ before enqueue
When called directly (not via write_raw_fast_iov_), sent could equal
total_write_len. Check before enqueueing to avoid a no-op enqueue.
2026-03-29 13:40:24 -10:00
J. Nick Koston 29419d9d97 [automation] Use std::array in And/Or/Xor conditions (#15282) 2026-03-29 13:36:08 -10:00
J. Nick Koston 99e9d274a4 Merge remote-tracking branch 'origin/api-sint32-short-varint' into integration 2026-03-29 13:30:16 -10:00
J. Nick Koston 3520ef7480 [text_sensor] Use std::array in MapFilter (#15269) 2026-03-29 22:38:04 +00: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 8d495a9931 Merge branch 'dev' into api-sint32-short-varint 2026-03-29 12:24:04 -10:00
J. Nick Koston 41f770a624 Merge branch 'dev' into api/peel-first-write-iteration 2026-03-29 12:23:43 -10:00
J. Nick Koston d6475eaeed [binary_sensor] Remove redundant optional<bool> state_, save 8 bytes per instance (#15095) 2026-03-29 12:15:18 -10:00
J. Nick Koston f57468109b [api] Split write_raw_fast_ into write_raw_fast_buf_ and write_raw_fast_iov_
No overloads — every method has a unique name matching its data type:
  write_raw_fast_buf_ / write_raw_buf_  — single contiguous buffer
  write_raw_fast_iov_ / write_raw_iov_  — iovec array
2026-03-29 12:14:54 -10:00
J. Nick Koston 048636d6c3 [api] Use explicit names: write_raw_fast_, write_raw_buf_, write_raw_iov_
Avoids ambiguous overload resolution between const void* and const iovec*
and makes each call site's intent clear.
2026-03-29 12:13:36 -10:00
J. Nick Koston a9aaf29d83 [core] Shrink Component from 12 to 8 bytes per instance (#15103) 2026-03-29 12:09:21 -10:00
J. Nick Koston 38fa8925da [ai] Add automation, callback manager, and test grouping docs (#15243) 2026-03-29 12:02:47 -10:00
J. Nick Koston c2b8ea3361 [web_server_base] Reduce sizeof(WebServerBase) by 4 bytes (#15251) 2026-03-29 18:02:29 -04:00
J. Nick Koston 52c297206a [api] Restore single-buffer write_raw_ overload to keep inline failure path small
Moving iovec construction into write_raw_fast_ caused an 8% regression
by enlarging the inlined failure path. The 33-byte out-of-line wrapper
keeps the hot inline path minimal.
2026-03-29 12:01:06 -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 5da3253f4b [esp8266] Add enable_scanf_float option (#15284) 2026-03-29 11:57:52 -10:00
J. Nick Koston 2a97eca00b [sensor] Use std::array in ValueList/FilterOut/ThrottleWithPriority filters (#15265) 2026-03-29 11:55:52 -10:00
J. Nick Koston 1f3fd60d29 [version] Remove duplicate build_info_data.h include (#15288) 2026-03-29 11:55:39 -10:00
J. Nick Koston c20537013f Merge branch 'dev' into api-sint32-short-varint 2026-03-29 11:54:37 -10:00
J. Nick Koston 8a802ca666 [benchmark] Add BLE raw advertisement proto encode benchmarks (#15289) 2026-03-29 11:54:07 -10:00
J. Nick Koston 1ede6d2e60 [api] Fix missing APIError aerr declaration after check_data_state_ removal 2026-03-29 11:53:06 -10:00
J. Nick Koston c970c38e8b [api] Replace check_data_state_ with debug assert in write methods
Callers already guarantee DATA state before calling write_protobuf_packet
(via try_to_clear_buffer) and write_protobuf_messages (via loop processing).
The runtime check is unreachable — replaced with ESPHOME_DEBUG_API assert.
2026-03-29 11:49:52 -10:00
J. Nick Koston 3bfc9b7f1f [api] Replace empty messages check with debug assert
Callers are responsible for not passing empty spans. Added
ESPHOME_DEBUG_API assert to catch bugs during development.
2026-03-29 11:47:42 -10:00
J. Nick Koston 371070ab78 [api] Default sent=-1 in write_raw_ for cleaner cold path call sites 2026-03-29 11:42:42 -10:00
J. Nick Koston 847c2ddbbf [api] Rename write_raw_slow_ to write_raw_ 2026-03-29 11:41:11 -10:00
J. Nick Koston d7464f94b8 [api] Remove single-buffer write_raw_slow_ overload to save 33 bytes
Callers construct iovec inline instead of going through a 33-byte
wrapper function. The iovec construction is trivial at each call site.
2026-03-29 11:40:22 -10:00
J. Nick Koston a91e6d92f6 [core] Remove dead get_loop_priority code (#15242) 2026-03-29 17:32:43 -04:00
J. Nick Koston 9df835600c [api] Rename write_raw_inline_ to write_raw_fast_ 2026-03-29 11:26:23 -10:00