Commit Graph
27112 Commits
Author SHA1 Message Date
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
J. Nick Koston faa05031a7 [climate] Store custom mode vectors on Climate entity to eliminate heap allocation (#15206) 2026-04-09 10:25:29 +12:00
J. Nick Koston d4cce142c5 [api] Fix batch messages stuck in Nagle buffer (#15581) 2026-04-08 21:11:31 +00:00
J. Nick Koston 576d89a82a [api] Peel first write iteration, inline socket writes, zero-gap batch encoding (#15063) 2026-04-08 11:05:53 -10:00
J. Nick Koston 629c3bdb1d Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-04-08 10:38:43 -10:00
J. Nick Koston b66fce67dc Merge branch 'fix-api-batch-nodelay' into integration 2026-04-08 10:38:14 -10:00
J. Nick Koston 58100f2720 [api] Fix batch messages stuck in Nagle buffer and missing flush on list entities completion
The multi-message batch path in process_batch_multi_ bypassed
set_nodelay_for_message(), so batch data written to the socket would
sit in LWIP's Nagle buffer when log messages had previously enabled
Nagle. The remote wouldn't ACK until it sent its own data (e.g. a
ping), which could take 20+ seconds. This caused log-only API clients
(like esphome logs) to time out waiting for ListEntitiesDoneResponse.

Additionally, when LIST_ENTITIES completed without a state subscription,
the batched entity listing responses were never explicitly flushed —
they waited for the 100ms batch timer instead of being sent immediately
like the INITIAL_STATE completion path already did.

Fixes both issues:
- Call set_nodelay_for_message(false) before write_protobuf_messages
  in process_batch_multi_ to ensure TCP_NODELAY is on
- Extract finalize_iterator_sync_() helper and call it when
  LIST_ENTITIES completes without state_subscription
2026-04-08 10:37:05 -10:00
J. Nick Koston 4a18ef87d7 [codegen] Fix templatable float type to use cg.float_ (#15568) 2026-04-08 20:23:36 +00:00
2cd92a311b [esp32] Capture both cores' backtraces in crash handler (#15559)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-04-08 20:14:18 +00:00
J. Nick Koston 94f1e48d95 [esp32] Preserve crash data across OTA rollback reboots (#15578) 2026-04-08 16:09:43 -04:00
Jonathan Swoboda 19c8f0ac7a [zephyr] Fix user overlay only emitting first property (#15560) 2026-04-08 09:46:36 -10:00
J. Nick Koston 312dea7ddb [json] Fix heap buffer overflow in SerializationBuffer truncation path (#15566) 2026-04-08 19:46:16 +00:00
Jonathan Swoboda fb0033947c [qspi_dbi] Connect _validate to CONFIG_SCHEMA (#15563) 2026-04-08 09:45:43 -10:00
Jonathan Swoboda 4b8f99ed10 [modbus_controller] Fix output missing address validation and text_sensor division (#15561) 2026-04-08 09:44:19 -10:00
Jonathan Swoboda 4a764ae1e3 [spi] Fix IndexError on invalid RP2040 CLK pin (#15562) 2026-04-08 09:42:47 -10:00
J. Nick Koston 5b840c1662 [codegen] Fix templatable bool type to use cg.bool_ (#15569) 2026-04-08 19:39:12 +00:00
dependabot[bot] 62d84db5a4 Bump CodSpeedHQ/action from 4.13.0 to 4.13.1 (#15577)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-08 09:38:17 -10:00
J. Nick Koston 019d415bbd [codegen] Fix templatable int type to use cg.int_ (#15571) 2026-04-08 19:37:11 +00:00
J. Nick Koston 707a07108f Merge branch 'crash-handler-rollback-fix' into integration 2026-04-08 09:34:38 -10:00
J. Nick Koston d9ebe1e1e7 Merge branch 'crash-handler-dual-core' into integration 2026-04-08 09:34:33 -10:00
J. Nick Koston 3b11be2123 Merge branch 'crash-handler-dual-core' of https://github.com/swoboda1337/esphome into crash-handler-dual-core 2026-04-08 09:33:15 -10:00
J. Nick Koston ffd58ac8d5 dead store 2026-04-08 09:33:06 -10:00
J. Nick Koston 0f72491a78 Keep s_crash_data_valid after clearing magic
Don't reset s_crash_data_valid in crash_handler_clear() so that
additional API clients connecting during the same boot session
can still receive the crash log.
2026-04-08 09:31:59 -10:00
J. Nick Koston 2ab7f032a8 [esp32] Preserve crash data across OTA rollback reboots
Don't clear the crash data magic marker at boot time. Previously,
crash_handler_read_and_clear() would clear the magic immediately,
so if OTA rollback triggered a reboot before an API client connected,
the crash trace was lost.

Now the magic is only cleared after crash_handler_log() delivers the
data to an API client via crash_handler_clear().
2026-04-08 09:31:30 -10:00
J. Nick Koston 5e5e9879f4 Merge branch 'dev' into crash-handler-dual-core 2026-04-08 09:22:54 -10:00
Clyde Stubbs 7de060ed55 [lvgl] Fix args for lambda in set_rotation action (#15555) 2026-04-09 07:22:24 +12:00
J. Nick Koston 12d1dedb59 minimize iram code duplication 2026-04-08 09:20:41 -10:00
J. Nick Koston cfa41b3467 [codegen] Add cg.int8 type and fix templatable int8 types (#15573) 2026-04-09 07:20:16 +12:00
J. Nick Koston 0a42a11f1c [at581x] Fix non-templated frequency/power_consumption constants for TemplatableFn (#15576) 2026-04-08 09:10:46 -10:00
J. Nick Koston 063a8ce666 [codegen] Fix templatable uint32 type to use cg.uint32 (#15574) 2026-04-08 09:03:25 -10:00
J. Nick Koston a2bd83382b [codegen] Fix templatable uint8 type to use cg.uint8 (#15572) 2026-04-08 09:00:59 -10:00
J. Nick Koston 869cace2f3 [web_server] Truncate update entity summary to 256 characters (#15570) 2026-04-08 08:59:49 -10:00
J. Nick Koston b83edf6c17 [script] Resolve IncludeFile objects in component config merge (#15575) 2026-04-08 08:57:56 -10:00
J. Nick Koston e1aa92b983 [rotary_encoder] Fix templatable value type to use cg.int32 (#15567) 2026-04-08 14:13:37 -04:00