Commit Graph
25770 Commits
Author SHA1 Message Date
J. Nick Koston ff02bf8099 Merge branch 'state-publish-logv' into integration 2026-03-24 22:26:09 -10:00
J. Nick Koston 5b8a1623b0 [core] Move entity state publish and setting logs to VERBOSE level
Benchmarking in #15034 showed that esp_log_printf and vsnprintf_chk
dominate sensor publish time (95%+ of internal_send_state_to_frontend).
At the default DEBUG log level, every state change generates log output
that overwhelms the log output making it hard to actually debug and
wastes significant CPU time on string formatting.

Move all entity state publish (>>) and setting logs from ESP_LOGD to
ESP_LOGV across all base entity types: sensor, binary_sensor, switch,
number, text_sensor, select, text, event, lock, cover, valve, climate,
fan, light, media_player, alarm_control_panel, datetime, update, and
water_heater.
2026-03-24 18:13:09 -10:00
J. Nick Koston af5b98c635 [time] Remove dummy placeholder values for recalc_timestamp_utc() (#15129) 2026-03-25 01:07:28 +00:00
J. Nick Koston 690dc324c9 [logger] Move task log buffer storage to BSS (#15153) 2026-03-25 00:52:37 +00:00
Jonathan Swoboda 26e78c840c [wifi] Filter fast_connect by band_mode and use background scan for roaming (#15152) 2026-03-24 20:21:04 -04:00
J. Nick Koston 9c9ae190ee [core] Use compile-time HasElse parameter in IfAction (#15134) 2026-03-24 14:13:59 -10:00
J. Nick Koston 238adbe008 [wifi] Fix roaming counter reset from delayed disconnect and successful retry (#15126) 2026-03-24 14:04:17 -10:00
J. Nick Koston f457b995f7 [datetime] Fix state_as_esptime() returning invalid timestamp (#15128) 2026-03-24 14:03:56 -10:00
J. Nick Koston b6aec4fa25 [ethernet] Add W5100 support for RP2040 (#15131) 2026-03-24 14:03:30 -10:00
J. Nick Koston 9fb5b6aa15 [light] Replace initial_state storage with flash-resident callback (#15133) 2026-03-24 14:03:18 -10:00
J. Nick Koston 752fe30332 [api] Add descriptive message to status warning when waiting for client (#15148) 2026-03-24 20:01:59 -04:00
Jonathan SwobodaandJ. Nick Koston 4ff85e2a1e [core] Fix clean-all to handle custom build paths (#15146)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2026-03-24 19:48:17 -04:00
J. Nick Koston cf961d7e11 Merge remote-tracking branch 'upstream/logger-task-log-buffer-bss' into integration 2026-03-24 13:26:07 -10:00
J. Nick Koston a4225eb4e9 Fix sizeof(non-static member) in static function 2026-03-24 13:24:47 -10:00
J. Nick Koston f7c9a70d89 Merge remote-tracking branch 'origin/logger-task-log-buffer-bss' into integration 2026-03-24 13:19:44 -10:00
J. Nick Koston 42a8a7946e Fix test Logger constructor calls 2026-03-24 13:12:40 -10:00
J. Nick Koston 32151bfc43 Address review feedback
- Remove dead DEFAULT_SLOT_COUNT constant from host header
- Fix misleading BSS comments (Logger is heap-allocated via new_Pvariable)
- Add comment explaining Zephyr BUF_WORD_COUNT formula
2026-03-24 13:11:38 -10:00
J. Nick Koston 99d0aa9734 Fix dummy_main.cpp Logger constructor call 2026-03-24 13:10:10 -10:00
J. Nick Koston 4d379d5e10 [logger] Move task log buffer storage to BSS
Follow-up to #15071 which moved the TaskLogBuffer allocation into the
Logger constructor to fix a race condition where another task could log
before the buffer was initialized.

This takes that fix further by eliminating the heap allocation entirely.
The buffer size is a codegen constant, so we emit it as a define
(ESPHOME_TASK_LOG_BUFFER_SIZE) and use it to size member arrays directly.
The TaskLogBuffer becomes a direct member of Logger rather than a
heap-allocated pointer, placing the entire buffer in BSS.

Changes per platform:
- ESP32: storage_ from RAMAllocator heap to member array
- Host: slots_ from unique_ptr<LogMessage[]> to member array
- LibreTiny: storage_ from RAMAllocator heap to member array
- Zephyr: mpsc buf from new uint32_t[] to member array
2026-03-24 13:07:40 -10:00
J. Nick Koston 434e548a22 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-24 10:40:48 -10:00
Diorcet YannJ. Nick KostonJ. Nick Kostonpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>J. Nick Koston
13baf26050 [core] get_log_str: fix false-positive error on null-terminated strings with stricter compilers (#15136)
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>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-24 20:26:21 +00:00
J. Nick Koston 968fa1cadd Merge remote-tracking branch 'origin/api-warning-message' into integration 2026-03-24 10:19:55 -10:00
J. Nick Koston 17981a14af [api] Add descriptive message to status warning when waiting for client
The API component calls status_set_warning() without a message when no
client is connected and reboot timeout is enabled. This results in a
confusing log line: "api set Warning flag: unspecified"

Replace with a descriptive message so users see:
"api set Warning flag: waiting for client connection"

Closes https://github.com/esphome/esphome/issues/15140
2026-03-24 10:18:17 -10:00
Jonathan Swoboda 8751f348c8 [sx127x] Fix FIFO read corruption (#15114) 2026-03-24 10:04:27 -10:00
Fabian Bläse 22bc47da23 [light] Fix incorrect mode change handling on transition to off (#15147) 2026-03-24 19:57:58 +00:00
Jonathan Swoboda 55df21db51 [esp32] Default CPU frequency to maximum supported (#15143) 2026-03-24 15:44:28 -04:00
J. Nick Koston 0cb9b682e6 Merge remote-tracking branch 'swoboda1337/cpu-freq-max' into integration 2026-03-24 09:31:46 -10:00
Jonathan Swoboda 3cd50f0495 [ci] Block new CONF_ constants from being added to esphome/const.py (#15145) 2026-03-24 09:31:08 -10:00
Diorcet Yann b3390d40fb [core] Fix cg.add_define propagation to dependencies in native ESP-IDF builds (#15137) 2026-03-24 14:31:42 -04:00
Jonathan Swoboda 1165043ca1 [esp32] Default CPU frequency to maximum supported 2026-03-24 13:03:14 -04:00
Javier PeletierandJ. Nick Koston 7eddf429ea [substitutions] speed up config loading: substitutions pass and !include redesign (package refactor part 4) (#12126)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-23 23:57:22 -10:00
J. Nick Koston 24a1571d2b Merge remote-tracking branch 'upstream/ifaction-constexpr-else' into integration 2026-03-23 21:43:01 -10:00
J. Nick Koston 4cab4c348a Use plain bool instead of RawExpression for IfAction template arg 2026-03-23 21:38:33 -10:00
J. Nick Koston 130a01fd0a [core] Use compile-time HasElse parameter in IfAction to save 8 bytes per instance
IfAction now takes a bool HasElse template parameter. When false (the
common case — most if actions have no else branch), the else_ ActionList
is replaced by an empty struct with [[no_unique_address]], saving 8
bytes per instance.

The codegen already knows at generation time whether an else branch
exists and passes the appropriate template argument.
2026-03-23 21:35:30 -10:00
J. Nick Koston 1024569318 Merge remote-tracking branch 'upstream/light-initial-state-callback' into integration 2026-03-23 21:28:34 -10:00
J. Nick Koston 0bbc022311 Drop unnecessary COLOR_MODES lookup — codegen handles EStr correctly 2026-03-23 21:27:53 -10:00
J. Nick Koston 91b0b0dd70 Clarify color_mode lookup intent 2026-03-23 20:47:44 -10:00
J. Nick Koston d632f1070b Merge branch 'light-initial-state-callback' into integration 2026-03-23 20:43:51 -10:00
J. Nick Koston a53b0f4646 Add integration test for light initial_state 2026-03-23 20:40:56 -10:00
J. Nick Koston 0073d37bf9 [light] Replace initial_state storage with flash-resident callback
Replace the inline optional<LightStateRTCState> (~44 bytes) with a
function pointer callback (4 bytes) that populates the initial state
during setup. The callback is a stateless lambda whose values live in
flash as code, not in the LightState object.

Saves ~40 bytes per LightState instance unconditionally — the optional
reserved space for the struct even when initial_state was not configured
(the common case).
2026-03-23 20:36:55 -10:00
J. Nick Koston 8dc45d02e7 Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-03-23 20:05:18 -10:00
J. Nick Koston 7927b9d885 Merge remote-tracking branch 'upstream/light-control-action-compact' into integration 2026-03-23 20:04:54 -10:00
J. Nick Koston 04c6e7e770 [light] Use compact per-field union storage in LightControlAction
Replace 14 TemplatableValue fields with a per-field union that stores
either a constant value or a callable pointer in the same 4 bytes
(on 32-bit targets). A 2-bit-per-field type tag in a uint32_t tracks
field state (unset/constant/stateless lambda/stateful lambda).

Reduces LightControlAction from 128 to 76 bytes per instance on ESP32.
For a config with 8 light actions, this saves 416 bytes of RAM and
476 bytes of flash (from eliminated TemplatableValue template
instantiations).
2026-03-23 20:03:34 -10:00
J. Nick Koston b36a049761 Merge branch 'add-w5100-ethernet-support' into integration 2026-03-23 19:57:21 -10:00
J. Nick Koston 0ea2a3e5cc Merge remote-tracking branch 'upstream/light-control-action-compact' into integration 2026-03-23 19:49:04 -10:00
J. Nick Koston 57c8ab861e [light] Use compact per-field union storage in LightControlAction
Replace 14 TemplatableValue fields with a per-field union that stores
either a constant value or a callable pointer in the same 4 bytes
(on 32-bit targets). A 2-bit-per-field type tag in a uint32_t tracks
field state (unset/constant/stateless lambda/stateful lambda).

Reduces LightControlAction from 128 to 76 bytes per instance on ESP32.
For a config with 8 light actions, this saves 416 bytes of RAM and
476 bytes of flash (from eliminated TemplatableValue template
instantiations).
2026-03-23 19:48:44 -10:00
J. Nick Koston 5dd47c8de9 Merge branch 'add-w5100-ethernet-support' into integration 2026-03-23 18:34:35 -10:00
J. Nick Koston 5116a86c6f [ethernet] Address review comments 2026-03-23 18:34:05 -10:00
J. Nick Koston b3d75850a1 Merge remote-tracking branch 'upstream/add-w5100-ethernet-support' into integration 2026-03-23 18:30:16 -10:00
J. Nick Koston f2857554b8 [ethernet] Use compile-time check for W5100 link detection 2026-03-23 18:28:16 -10:00