Commit Graph
13512 Commits
Author SHA1 Message Date
J. Nick KostonandClaude Opus 4.6 765bb3298e [api] Use PROTO_VARINT_PARSE_FAILED constant in parse failure returns
Replace magic {0, 0} with {0, PROTO_VARINT_PARSE_FAILED} in parse_slow()
and parse_wide() for consistency with the named sentinel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:06:22 -10:00
J. Nick KostonandClaude Opus 4.6 e7ce2703e8 [api] Add explicit static_cast<uint32_t> in decode_zigzag32 calls
On BLE builds where proto_varint_value_t is uint64_t, decode_zigzag32()
takes uint32_t — make the narrowing explicit to match the static_cast
pattern used for other type conversions in generated code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:05:07 -10:00
J. Nick KostonandClaude Opus 4.6 5dbf35051a [api] Add explicit static_cast<uint32_t> for tag/field_length narrowing
Consistency with frame helper code — makes the uint64→uint32 narrowing
explicit on BLE builds where proto_varint_value_t is uint64_t.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:58:13 -10:00
J. Nick KostonandClaude Opus 4.6 9f57c2a9b6 [api] Fix HELPER_LOG format mismatch and remove unused is_varint64 codegen field
- Cast msg_size/type_varint.value to uint32_t in HELPER_LOG to match PRIu32
  format (proto_varint_value_t is uint64_t on BLE builds)
- Remove unused is_varint64 field from api_protobuf.py TypeInfo classes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:52:26 -10:00
J. Nick KostonandClaude Opus 4.6 ce70c955c4 [api] Remove as_uint16/as_uint32 accessors from ProtoVarIntResult, use .value directly
Address code review feedback:
- Remove as_uint16() and as_uint32() accessors from ProtoVarIntResult
- Use .value directly with static_cast where narrowing is needed
- Fix ESP_LOGV truncation: use PRIu64 with static_cast<uint64_t> for BLE builds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:52:03 -10:00
J. Nick Koston fab59c86a7 Merge remote-tracking branch 'upstream/dev' into inline-varint-parse-fast-path 2026-03-08 19:07:58 -10:00
J. Nick KostonandClaude Opus 4.6 a9ad0cc3f3 [api] Remove unused ProtoVarInt instance members and ProtoVarIntResult accessors
After moving decode_varint to raw proto_varint_value_t, the type-
conversion accessors (as_bool, as_int32, as_sint32, as_uint64, etc.)
on ProtoVarIntResult are dead code. ProtoVarInt itself is now only
used as a static method container for parse(), so remove its
constructors, instance accessors, and value_ member.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:58:54 -10:00
J. Nick KostonandClaude Opus 4.6 b838085e41 [api] Use proto_varint_value_t type alias instead of #ifdef blocks
Replace per-override #ifdef USE_API_VARINT64 conditionals with a
single type alias proto_varint_value_t, eliminating preprocessor
blocks from every decode_varint signature in api_pb2.cpp/h.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:56:15 -10:00
J. Nick KostonandClaude Opus 4.6 fcd72336f0 [api] Change decode_varint parameter from ProtoVarIntResult to raw value type
Pass uint32_t (or uint64_t when USE_API_VARINT64 is defined) directly
to decode_varint() instead of the ProtoVarIntResult struct. This
eliminates accessor method overhead in each of the 51 overrides,
replacing value.as_uint32() with direct value usage, value.as_bool()
with value != 0, etc. No vtable growth - single virtual method with
conditionally-typed parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:39:59 -10:00
J. Nick KostonandClaude Opus 4.6 f4724d7797 Split parse() into parse() and parse_non_empty()
parse_non_empty() has no len==0 check (with debug assert) for callers
that guarantee len >= 1 (e.g. after while (ptr < end)).

parse() adds the len==0 guard and delegates to parse_non_empty() for
callers where the buffer may be empty (e.g. value parse after tag
advance in decode(), frame helper header parsing).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:18:19 -10:00
0db9137d91 [multiple] Add division by zero guards (#14634)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2026-03-09 00:10:48 -04:00
Clyde Stubbs f3ca86b670 [ci-custom] Directions on constant hoisting (#14637) 2026-03-08 23:48:03 -04:00
J. Nick KostonandClaude Opus 4.6 7185c66779 Remove len==0 guard from parse(), add debug assert
All callers guarantee len > 0 (decode loop checks ptr < end,
header parse checks minimum bytes). Replace runtime check with
ESPHOME_DEBUG_API assert. This removes the len check from the
inline entirely, saving one branch per call site.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:42:37 -10:00
J. Nick KostonandClaude Opus 4.6 8b9c4d050d Reduce parse() inline size by folding len==0 into slow path
Move the len==0 check from the inlined fast path into parse_slow(),
saving one branch + one return-value setup per inline site (~6-8
bytes per call site on Xtensa/xtensa-lx106).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:38:12 -10:00
J. Nick Koston 3653e0cf9f Merge branch 'dev' into inline-varint-parse-fast-path 2026-03-08 17:24:17 -10:00
J. Nick KostonandClaude Opus 4.6 088a8a4338 [ci] Match symbols with changed signatures in memory impact analysis (#14600)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:23:58 -10:00
J. Nick KostonandClaude Opus 4.6 c90eb90ff6 Fix clang-tidy naming and add PROTO_VARINT_PARSE_FAILED constant
- Rename parse_slow_ -> parse_slow and parse_wide_ -> parse_wide
  (static methods should not have trailing underscore per clang-tidy)
- Add PROTO_VARINT_PARSE_FAILED constant for consumed field sentinel

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:23:36 -10:00
Jonathan SwobodaandClaude Opus 4.6 5d3893368d [multiple] Add array bounds checks (#14635)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:16:32 -04:00
J. Nick Koston e285fd6815 [api] Inline ProtoVarInt::parse fast path and return consumed in struct
Replace optional<ProtoVarInt> + consumed pointer with ProtoVarIntResult
struct that returns value + consumed count directly. This eliminates
memory stores through a pointer on the fast path (single-byte varints
< 128), keeping everything in registers.

The parse() method is now ESPHOME_ALWAYS_INLINE with the multi-byte
slow path outlined to parse_slow_(). The common case for protobuf
field tags, small enums, booleans, and typical message sizes/types
is a simple high-bit check + register return with no function call.

Measured on ESP32 (Xtensa): try_read_frame_ grows only +12 bytes
(320 → 332) for two inlined parse sites, while eliminating two
function calls per message on the hot path.
2026-03-08 17:13:03 -10:00
Jonathan SwobodaandClaude Opus 4.6 5b9cab02be [multiple] Add default initializers to uninitialized member variables (#14636)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:37:54 -04:00
Edward Firmopre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>CopilotJ. Nick Koston
cac751e9e8 [nextion] Add configurable HTTP parameters for TFT upload (#14234)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-09 01:29:41 +00:00
6ba5c9a705 [api] Skip state_action_() call in noise data path (#14629)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 01:22:39 +00:00
J. Nick Koston c681dc8872 [socket] Add socket wake support for RP2040 (#14498) 2026-03-08 15:11:24 -10:00
J. Nick KostonandClaude Opus 4.6 d0285cdc41 [core] Pack entity flags into configure_entity_() and protect setters (#14564)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 15:11:15 -10:00
J. Nick Koston 9547a54fac [const] Move CONF_ENABLE_FULL_PRINTF to const.py (#14633) 2026-03-08 14:52:40 -10:00
J. Nick Koston b05dbfccd3 [api] Bump noise-c to 0.1.11 (#14632) 2026-03-08 14:52:21 -10:00
J. Nick Koston aef2d74e41 [ld2450] Add integration tests with mock UART (#14611) 2026-03-08 14:32:59 -10:00
J. Nick Koston e1c849d5d2 [esp8266] Wrap printf/vprintf/fprintf to eliminate _vfiprintf_r (~1.6 KB flash) (#14621) 2026-03-08 14:32:47 -10:00
J. Nick Koston c11ad7f0e6 [rp2040] Wrap printf/vprintf/fprintf to eliminate _vfprintf_r (~9.2 KB flash) (#14622) 2026-03-08 14:32:35 -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 93d7ec4d72 [esp32_ble] Inline ble_addr_to_uint64 to eliminate call overhead (#14591) 2026-03-08 14:07:59 -10:00
J. Nick Koston 66a5ad0d75 [core] Skip zero-initialization of StaticVector data array (#14592) 2026-03-08 14:06:55 -10:00
J. Nick Koston 771404668d [api] Inline fast path of try_to_clear_buffer (#14630) 2026-03-08 14:01:01 -10:00
J. Nick Koston 76c567a71c [scheduler] Use std::atomic<uint8_t> instead of std::atomic<bool> for remove flag (#14626) 2026-03-08 14:00:04 -10:00
J. Nick Koston e7730cff00 [esp32_ble] Optimize BLE event hot path performance (#14627) 2026-03-08 13:59:40 -10:00
d5dc4a39cb [i2s_audio] Fix mono sample swap and block 8-bit mono on ESP32 (#14516)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-08 12:10:43 -10:00
Keith Burzinski 50b3f9d25c [mixer_speaker] Add task debounce (#14581) 2026-03-08 18:09:06 -04:00
J. Nick Koston ad5811280a [ci] Add medium-pr label for PRs with ≤100 lines changed (#14628) 2026-03-08 10:59:43 -10:00
tomaszduda23andJ. Nick Koston 9be1876fae [ble_nus] make ble_nus timeout shorter than watchdog (#14619)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2026-03-08 10:52:16 -10:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1b3a7f0b6a Bump aioesphomeapi from 44.5.0 to 44.5.1 (#14624)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-08 18:18:14 +00:00
Diorcet Yann 3f143d9f19 [ethernet] Fix commit 3f700bac1c (#14618) 2026-03-08 09:50:32 -04:00
Oliver Kleinecke a9b5f95c76 [usb_uart] ch34x chip-type & port-count enumeration (#14544) 2026-03-08 21:24:39 +11:00
Keith BurzinskiJ. Nick Kostonpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>J. Nick Koston
0c4a44566f [serial_proxy] New component (#13944)
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>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-08 03:55:49 -05:00
2c705810cd [nrf52] allow to update OTA via cmd (#12344)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-08 08:40:52 +00:00
J. Nick KostonandClaude Opus 4.6 a530aeec22 [api] Inline varint and encode_varint_raw fast paths for hot loop performance (#14607)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:09:12 -10:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> d9e76da806 Bump aioesphomeapi from 44.4.0 to 44.5.0 (#14617)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-08 07:59:25 +00:00
tomaszduda23CopilotJ. Nick KostonJ. Nick Kostonpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
e4b89a69d4 [nrf52, ota] ble and serial OTA based on mcumgr (#11932)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-07 20:32:20 -10:00
Keith Burzinski 04cff1c916 [usb_uart] Return flush result, expose timeout via config (#14616) 2026-03-08 00:04:14 -06: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 KostonandClaude Opus 4.6 be6c3c52ac [api] Add force proto field option to skip zero checks on hot path (#14610)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:59:13 -10:00