Commit Graph
27309 Commits
Author SHA1 Message Date
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
Jesse Hills c04dfa922e [hbridge] Move light pin switching to loop (#15615) 2026-04-10 14:02:49 +12:00
J. Nick Koston 107ba28ac3 fix merge 2026-04-09 15:03:45 -10:00
J. Nick Koston efa334b79c Merge remote-tracking branch 'origin/entity-types-xmacro' into integration 2026-04-09 14:57:57 -10:00
J. Nick Koston 053cee4ec9 [core] Use ENTITY_TYPES_H_TARGET constant in helpers.py 2026-04-09 14:52:37 -10:00
J. Nick Koston 7d87b32033 [core] Exclude entity_types.h from clang-tidy all-include.cpp
The X-macro file requires macros to be defined before inclusion and
cannot be included bare in the clang-tidy all-include header.
2026-04-09 14:52:04 -10:00
J. Nick Koston f10f7c6b6a [core] Use ENTITY_TYPES_H_TARGET constant for consistency 2026-04-09 14:46:50 -10:00
J. Nick Koston dc596bfa75 [core] Exclude entity_types.h from generated esphome.h
The X-macro file requires ENTITY_TYPE_ and ENTITY_CONTROLLER_TYPE_
macros to be defined before inclusion. The generated esphome.h includes
all .h files bare, which causes compilation errors.
2026-04-09 14:46:23 -10:00
J. Nick Koston affb20a9cf [core] Rename entity_types.inc to entity_types.h
Neither PlatformIO nor ESP-IDF/CMake copy .inc files to the build
directory. Rename to .h so it's recognized by both build systems.
Exempt from pragma-once lint since this file is intentionally included
multiple times with different macro definitions.
2026-04-09 14:44:52 -10:00
J. Nick Koston 4190ebebc9 [core] Inline ControllerRegistry::register_controller into header
Tiny one-liner, no reason to keep it in the .cpp.
2026-04-09 14:26:59 -10:00
J. Nick Koston 8791d9f26b [core] Add missing NOLINT suppression for bugprone-macro-parentheses
clang-tidy flags macro arguments that aren't parenthesized, but
wrapping template type arguments in parentheses would break C++ syntax.
Add NOLINTBEGIN/END around the remaining macro blocks.
2026-04-09 14:25:34 -10:00
J. Nick Koston 49fd95d672 [core] Add .inc to SOURCE_FILE_EXTENSIONS
PlatformIO only copies files with extensions listed in
SOURCE_FILE_EXTENSIONS to the build directory. Add .inc so that
X-macro include files (entity_types.inc) are available during
compilation.
2026-04-09 14:18:58 -10:00
J. Nick Koston 7d0cb4afe6 [core] Deduplicate entity type boilerplate with X-macro pattern
Introduce entity_types.inc X-macro and entity_includes.h shared header
to eliminate ~1000 lines of repetitive #ifdef/entity-type blocks across
core files.

entity_types.inc defines each entity type once with two macros:
- ENTITY_TYPE_ for non-controller entities (button, infrared)
- ENTITY_CONTROLLER_TYPE_ for entities with controller callbacks

Each consumer includes the file with appropriate macro definitions.
Sites wanting all entities delegate ENTITY_CONTROLLER_TYPE_ to
ENTITY_TYPE_. Sites wanting only controller entities define
ENTITY_TYPE_ as empty.

entity_includes.h consolidates the conditional entity header includes
shared by application.h, controller.h, and controller_registry.h.

Also makes ComponentIterator::on_media_player pure virtual for
consistency (trivial override added to web_server::ListEntitiesIterator).
2026-04-09 14:13:39 -10:00
Jesse Hills 668007707d [CI] Add org fork detection warning to auto-label PR workflow (#15588) 2026-04-10 12:13:22 +12:00
J. Nick Koston b9d0f96053 Merge remote-tracking branch 'origin/inline-encode-ble-adv' into integration 2026-04-09 11:57:55 -10:00
J. Nick Koston fd69a8e380 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-09 11:56:18 -10:00
dependabot[bot]andJ. Nick Koston ab71f5276f Bump ruff from 0.15.9 to 0.15.10 (#15609)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-09 19:36:25 +00:00
J. Nick Koston 6fe6bf79d4 Address Copilot review: fix namespace and custom separator test 2026-04-09 09:30:06 -10:00
Jonathan Swoboda d062f62656 [sx127x][cc1101] Disable loop when packet mode is inactive (#15606) 2026-04-09 15:00:52 -04:00
J. Nick Koston a941422fa6 Add unit tests for format_hex helpers 2026-04-09 08:36:40 -10:00
J. Nick Koston c945cbc64c bot comments 2026-04-09 08:10:39 -10:00
J. Nick Koston a0b0238ff8 Merge branch 'dev' into optimize-format-hex 2026-04-09 07:54:02 -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 8f6d489a9a [ci] Use --base-only for memory impact builds (#15598) 2026-04-09 11:48:33 -04:00
J. Nick Koston dd07fba943 [socket] Document ready() contract: callers must drain or track (#15590) 2026-04-09 11:48:18 -04:00
J. Nick Koston 6f5d642a31 [gdk101] Increase reset retries for slow-booting sensor MCU (#15584) 2026-04-09 11:48:10 -04:00
J. Nick Koston 781ab59611 Remove duplicate unrolled inline size cases, always use loop 2026-04-09 00:16:07 -10:00
J. Nick Koston 382202334a Simplify field_ifdef handling in inline blocks 2026-04-09 00:15:24 -10:00
J. Nick Koston 277552cef0 Address review: reserve_byte, varint(0), field_ifdef, getattr guard 2026-04-09 00:13:36 -10:00
J. Nick Koston 1d9b097e1f Merge branch 'dev' into inline-encode-ble-adv 2026-04-09 00:05:06 -10:00
dependabot[bot] 2721f08bcc Bump aioesphomeapi from 44.12.0 to 44.13.1 (#15600)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-09 10:03:58 +00:00
J. Nick Koston 1279e6112a Support max_data_length in get_max_encoded_size for string types 2026-04-08 23:42:08 -10:00
J. Nick Koston 24edb9c98e Eliminate sub_size variable, accumulate directly into size 2026-04-08 23:29:51 -10:00
J. Nick Koston 1ac2a73267 Remove redundant body_start variable in inline encode 2026-04-08 23:25:12 -10:00
J. Nick Koston 14a4a2c618 Remove redundant block scoping inside loop bodies 2026-04-08 23:12:47 -10:00
J. Nick Koston 4d4b77f9fc [api] Add (inline_encode) proto option for sub-message inlining
Add a new message-level option (inline_encode) that causes the code
generator to inline sub-message encoding directly into the parent's
encode/calculate_size methods instead of going through the
encode_sub_message function pointer indirection.

When set on a sub-message type, the generator:
- Inlines field encoding directly (no function pointer, no backpatch overhead)
- Inlines size calculation (no separate method call)
- Skips generating standalone encode/calculate_size methods
- Validates at generation time that max encoded size < 128 bytes

Applied to BluetoothLERawAdvertisement which is encoded 12 times per
BLE advertisement batch in a hot loop.
2026-04-08 23:06:41 -10:00
J. Nick Koston bd66f26144 [core] Optimize format_hex_internal by eliminating per-byte length check
Remove the per-byte `i < length - 1` check in the separator path by
writing the separator unconditionally after each byte and overwriting
the last one with the null terminator.

Single-loop approach keeps code smaller than the original while
eliminating the hot-path branch. Flash: -16 bytes vs baseline.
2026-04-08 20:41:09 -10:00
J. Nick Koston 671e434400 [core] Force-inline format_hex_char to prevent outlining
The loop split in format_hex_internal doubled the call sites for
format_hex_char, causing the compiler to outline it (+30 bytes new
symbol). Mark it always_inline to keep it inlined.
2026-04-08 20:25:48 -10:00
J. Nick Koston b8e4343d86 [core] Optimize format_hex_internal by splitting separator loop
Split the single loop into two paths (with/without separator) to
eliminate the per-byte branch on separator. In the separator path,
write the separator unconditionally and overwrite the last one with
the null terminator. This also lets the compiler use constant stride
values (2 or 3) instead of a runtime variable.

Benchmarks show ~16-20% improvement on the separator path
(format_hex_pretty_to, format_mac_addr_upper).
2026-04-08 20:04:44 -10:00
J. Nick Koston 352121b7bf [core] Add CodSpeed benchmarks for hot helper functions
Add benchmarks for format_hex_to, format_hex_pretty_to,
format_mac_addr_upper, fnv1_hash, fnv1a_hash, fnv1_hash_object_id,
parse_hex, crc8, crc16, value_accuracy_to_buf, int8_to_str, and
base64_decode to establish baseline performance data before optimization.
2026-04-08 19:57:37 -10:00
J. Nick Koston eafc5df3f2 [safe_mode] Combine related OTA rollback log messages (#15592) 2026-04-09 05:30:39 +00:00
J. Nick Koston 46d0c29be5 [safe_mode] Use loop component start time instead of millis() (#15591) 2026-04-09 05:20:32 +00:00
J. Nick Koston 6ef0d993c9 Merge remote-tracking branch 'upstream/safe-mode-combine-log-messages' into integration 2026-04-08 18:57:37 -10:00
J. Nick Koston afbecce86f [safe_mode] Combine related OTA rollback log messages 2026-04-08 18:56:35 -10:00
J. Nick Koston 3a16cd6eb9 Merge remote-tracking branch 'upstream/safe-mode-use-loop-start-time' into integration 2026-04-08 18:50:44 -10:00
J. Nick Koston 05816d8786 [safe_mode] Use loop component start time instead of millis() 2026-04-08 18:49:40 -10:00
J. Nick Koston 4089e422dd Merge remote-tracking branch 'upstream/dev' into integration 2026-04-08 18:44:50 -10:00
J. Nick Koston abdbbf4dd2 [api] Fix ListEntitiesRequest not read due to LWIP rcvevent tracking (#15589) 2026-04-09 02:14:01 +00:00