Commit Graph
27145 Commits
Author SHA1 Message Date
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
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
Jonathan Swoboda d062f62656 [sx127x][cc1101] Disable loop when packet mode is inactive (#15606) 2026-04-09 15:00:52 -04: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 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
Jesse Hills 4dc0599a7d Merge branch 'beta' into dev 2026-04-09 13:41:27 +12:00
Jesse Hills ded0936b2a Merge pull request #15587 from esphome/bump-2026.4.0b1
2026.4.0b1
2026.4.0b1
2026-04-09 13:40:37 +12:00
J. Nick Koston 8c0ca29c04 [api] Update MAX_MESSAGES_PER_LOOP comment to not hardcode old value 2026-04-08 15:38:01 -10:00
J. Nick Koston 0eb2e8710e Merge branch 'fix-api-list-entities-read-stall' into integration 2026-04-08 15:33:18 -10:00
J. Nick Koston 5c7e858c79 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-08 15:33:08 -10:00
J. Nick Koston d0e5035f0e [api] Fix ListEntitiesRequest not being read due to LWIP rcvevent tracking
When the client sends 6+ messages during handshake (HelloReq, AuthReq,
GetTimeResp, SubscribeLogsReq, DeviceInfoReq, ListEntitiesReq),
MAX_MESSAGES_PER_LOOP=5 caused ListEntitiesReq to remain unread in
the socket buffer.

LWIP's rcvevent counter (used by is_socket_ready) tracks pbuf dequeues,
not remaining bytes. When multiple ESPHome messages share a single TCP
segment/pbuf, reading all but the last message exhausts rcvevent to 0
while the last message's data remains in LWIP's internal lastdata cache.
is_socket_ready() then returns false, and the data is never read — the
entity listing silently stalls until something else (like a keepalive
ping) triggers new socket activity.

Fix:
- Track when the read loop hits MAX_MESSAGES_PER_LOOP and retry on the
  next iteration without the is_socket_ready() gate
- Increase MAX_MESSAGES_PER_LOOP from 5 to 10 (decode cost is now 3x
  cheaper, and we batch 24-34 messages per write)
- Move set_nodelay_for_message(false) before try_to_clear_buffer in
  process_batch_() so NODELAY is set before draining overflow
2026-04-08 15:27:02 -10:00
Jesse Hills 52c35ec09c Bump version to 2026.5.0-dev 2026-04-09 11:28:48 +12:00
J. Nick Koston f562ecf8e2 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-08 13:11:23 -10:00
J. Nick Koston 76490e45bc [ci] Fix status-check-labels workflow flooding CI queue (#15585) 2026-04-08 13:08:29 -10:00
0a8130858c [ade7953_spi] Fix SPI mode on esp-idf (#14824)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-08 22:57:53 +00:00
Jesse Hills ff5ba99d16 Bump version to 2026.4.0b1 2026-04-09 10:39:13 +12:00
Clyde Stubbs 14ec82084b [rpi_dpi_rgb][qspi_dbi] Add deprecation warnings (#15583) 2026-04-09 10:35:09 +12: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