Commit Graph
23507 Commits
Author SHA1 Message Date
Jonathan Swoboda a379951e72 Clean 2026-02-18 10:07:07 -05:00
J. Nick Koston f267b1fe0f Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	esphome/core/component.cpp
2026-02-18 08:54:39 -06:00
J. Nick Koston 99a77e9549 Add single-byte fast path to ProtoVarInt::parse
Single-byte varints (0-127) are the most common case in protobuf
messages (booleans, small enums, field tags). Skip the loop entirely
for these values by checking the first byte before entering the
multi-byte parsing loop.
2026-02-18 08:44:13 -06:00
J. Nick Koston bc2dbd3cf5 Add integration test for 5-byte varint device_id parsing
Device IDs are FNV hashes (uint32) that frequently exceed 2^28,
requiring 5 varint bytes. This test verifies the firmware correctly
decodes these values in incoming SwitchCommandRequest messages and
encodes them in state responses.
2026-02-18 08:35:00 -06:00
J. Nick Koston bd78b546c8 fix 2026-02-18 08:26:04 -06:00
J. Nick Koston fb89900c64 [core] Make setup_priority and component state constants constexpr (#14041) 2026-02-18 08:22:36 -06:00
J. Nick Koston fb35ddebb9 [display] Make COLOR_OFF and COLOR_ON inline constexpr (#14044) 2026-02-18 08:22:07 -06:00
J. Nick Koston 4d2051ad8f no widen 2026-02-18 08:16:55 -06:00
J. Nick Koston 67034c966d no widen 2026-02-18 08:14:37 -06:00
J. Nick Koston 3e08cb595d no widen 2026-02-18 07:58:14 -06:00
Jonathan SwobodaandClaude Opus 4.6 3ee94a6af8 [esp32_touch] Remove channel 8/9 BITS_SWAP workaround
The fix is already in the ESP-IDF release/v5.5 branch (merged Dec 3,
2025) and will be in v5.5.3.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 23:05:40 -05:00
J. Nick Koston bf6aef4006 Merge branch 'constexpr-display-color' into integration 2026-02-17 21:56:20 -06:00
J. Nick Koston 8975ff8e1b Merge branch 'constexpr-tlc59208f' into integration 2026-02-17 21:56:15 -06:00
J. Nick Koston c7cf98d3e8 Merge branch 'constexpr-pca9685' into integration 2026-02-17 21:56:09 -06:00
J. Nick Koston 686ed76402 [display] Make COLOR_OFF and COLOR_ON inline constexpr
Convert COLOR_OFF and COLOR_ON from extern const to inline constexpr.
The Color class already has constexpr constructors so these can be
compile-time constants, allowing the compiler to optimize default
parameter values and eliminate the runtime storage.
2026-02-17 21:50:24 -06:00
J. Nick Koston 68647fcdbe [tlc59208f] Make mode constants inline constexpr
Convert TLC59208F_MODE2_* constants from extern const to inline
constexpr so the compiler can use immediate values instead of memory
loads.
2026-02-17 21:49:49 -06:00
Jonathan SwobodaandClaude Opus 4.6 e65438b27c [esp32_touch] Support voltage_attenuation with new unified driver
The new touch_volt_lim_h_t enum combines high_voltage_reference and
voltage_attenuation into a single value. Map the two user-facing config
options to the correct combined enum using a lookup table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 22:49:20 -05:00
J. Nick Koston 8080aa4a34 [pca9685] Make mode constants inline constexpr
Convert PCA9685_MODE_* constants from extern const to inline constexpr
so the compiler can use immediate values instead of memory loads.
2026-02-17 21:49:11 -06:00
J. Nick Koston ae5aebf80f Merge branch 'constexpr-constants' into integration 2026-02-17 21:34:40 -06:00
J. Nick Koston cae80add8e Merge remote-tracking branch 'origin/optimize-warn-blocking-guard' into integration 2026-02-17 21:34:33 -06:00
J. Nick Koston 2a5ae59c20 [core] Optimize WarnIfComponentBlockingGuard::finish() hot path
Split the rarely-taken warning path into a separate noinline cold
function so the hot path (called every component every loop iteration)
is minimal. Also make WARN_IF_BLOCKING_OVER_MS constexpr so the
compiler uses an immediate compare instead of a memory load, and
merge the two ESP_LOGW calls into one.

finish() shrinks from 108 to 30 bytes. Total flash savings: -116 bytes.
2026-02-17 21:29:20 -06:00
Ryan Wagoner 38fc007a6a Always include preset/custom_preset in climate state JSON
When a preset is cleared, the field was omitted entirely from the JSON.
Since the frontend uses Object.assign to merge state updates, the old
preset value was never removed. Now we always send the field (empty
string when no preset is active) so the UI updates correctly.
2026-02-17 22:28:48 -05:00
J. Nick Koston 2d61d442cf [core] Make setup_priority and component state constants constexpr
Convert setup_priority floats, component state uint8_t constants, and
status LED constants from extern const (defined in component.cpp) to
inline constexpr in the header. This lets the compiler use immediate
values instead of memory loads across all translation units.

Also removes the dead HARDWARE_LATE declaration (declared extern but
never defined).

Saves ~364 bytes flash on ESP32-S3.
2026-02-17 21:27:03 -06:00
J. Nick Koston 9457e54e5d Rename parse_wide_ to parse_wide per clang-tidy naming convention 2026-02-17 19:00:55 -06:00
J. Nick Koston bd6048faf8 Merge origin/dev into api_varint_split_32_64 2026-02-17 18:56:11 -06:00
J. Nick Koston 3989236154 [api] Split ProtoVarInt::parse into 32-bit and 64-bit phases
On 32-bit platforms (ESP32 Xtensa), 64-bit shifts in varint parsing
compile to __ashldi3 library calls. Since the vast majority of protobuf
varint fields (message types, sizes, enum values, sensor readings) fit
in 4 bytes, the 64-bit arithmetic is unnecessary overhead on the common
path.

Split parse() into two phases:
- Bytes 0-3: uint32_t loop with native 32-bit shifts (0, 7, 14, 21)
- Bytes 4-9: noinline parse_wide_() with uint64_t, only for BLE
  addresses and other 64-bit fields

The code generator auto-detects which proto messages use int64/uint64/
sint64 fields and emits USE_API_VARINT64 conditionally. On non-BLE
configs, parse_wide_() and the 64-bit accessors (as_uint64, as_int64,
as_sint64) are compiled out entirely.

Saves ~40 bytes flash on non-BLE configs. Benchmark shows 25-50%
faster parsing for 1-4 byte varints (the common case).
2026-02-17 18:54:25 -06:00
Jesse Hills a3d7e76992 Merge branch 'beta' into dev 2026-02-18 13:29:11 +13:00
Jesse Hills 973656191b Merge pull request #14038 from esphome/bump-2026.2.0b4
2026.2.0b4
2026.2.0b4
2026-02-18 13:28:37 +13:00
Jesse Hills d9f493ab7a Bump version to 2026.2.0b4 2026-02-18 10:13:41 +13:00
schrob a0c4fa6496 [openthread] Fix compiler format warning (#14030) 2026-02-18 10:13:41 +13:00
J. Nick Koston 18b4818fb1 Merge branch 'web_server_reduce_set_json_id' into integration 2026-02-17 14:52:00 -06:00
Jonathan SwobodaandClaude Opus 4.6 5818d03378 [esp32_touch] Fix zero readings on GPIO33/GPIO32 (channels 8/9)
Work around ESP-IDF bug where touch_ll_enable_channel_mask() and
touch_ll_set_charge_speed() don't apply the channel 8/9 bit swap
required by the ESP32 hardware. The legacy driver's equivalent
functions (touch_ll_set_channel_mask, etc.) correctly applied
TOUCH_LL_BITS_SWAP, but the new unified API omits it.

This caused channels 8 (GPIO33) and 9 (GPIO32) to not be properly
enabled for measurement, resulting in reads always returning zero.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:04:18 -05:00
Ryan Wagoner 5b5d3fa9b3 Add climate preset support to web server REST API
The web server's handle_climate_request() parsed mode, fan_mode, and
swing_mode but did not parse preset, making it impossible to set climate
presets via the REST API or web UI.

Also fix the JSON response to always include the presets and
custom_presets arrays when the climate entity supports them, rather than
only when a preset is currently active. This matches how swing_modes is
already handled and ensures the frontend can render preset controls
before one is selected.
2026-02-17 14:25:49 -05:00
dependabot[bot] 5bb863f7da Bump actions/stale from 10.1.1 to 10.2.0 (#14036)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-17 13:24:39 -06:00
J. Nick Koston 75e5ba93cd Merge remote-tracking branch 'upstream/dev' into integration 2026-02-17 13:21:13 -06:00
Rodrigo Martín 81ed70325c [esp32_ble_server] fix infinitely large characteristic value (#14011) 2026-02-17 07:45:21 -10:00
Jonathan SwobodaandClaude Opus 4.6 cf2489c54f [esp32_touch] Remove section banner comments
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:43:37 -05:00
Jonathan SwobodaandClaude Opus 4.6 cfe10cd46c [esp32_touch] Fix clang-tidy: remove trailing underscore from static methods
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:04:13 -05:00
Jonathan SwobodaandClaude Opus 4.6 3e9ef271ae [esp32_touch] Modernize to combined namespace syntax
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:47:23 -05:00
Jonathan SwobodaandClaude Opus 4.6 674ee02087 [esp32_touch] Migrate to new unified touch sensor driver (esp_driver_touch_sens)
Migrate from deprecated driver/touch_sensor.h to the new unified
driver/touch_sens.h API, eliminating deprecation warnings on ESP-IDF v5.5
and adding ESP32-P4 touch support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:44:25 -05:00
schrob e826d71bd8 [openthread] Fix compiler format warning (#14030) 2026-02-17 10:16:57 -05:00
J. Nick Koston 090b85742b [web_server] Reduce set_json_id code size by ~48 bytes
Reuse a single stack buffer for both name_id and legacy id
construction instead of two separate buffers. ArduinoJson
copies from char* before the buffer is overwritten.

Use .c_str() instead of passing StringRef directly to
ArduinoJson assignments, routing through the already-
instantiated set<const char*> template and eliminating
the 24-byte set<StringRef> wrapper from the binary.
2026-02-16 23:46:49 -06:00
J. Nick Koston 4cd3f6c36a [api] Remove unused reserve from APIServer constructor (#14017) 2026-02-17 16:30:57 +13:00
Jesse Hills 6b4b8cb2f9 Merge branch 'beta' into dev 2026-02-17 16:22:46 +13:00
Jesse Hills fd43bd2b7e Merge pull request #14025 from esphome/bump-2026.2.0b3
2026.2.0b3
2026.2.0b3
2026-02-17 16:22:12 +13:00
J. Nick Koston aeefb7fc43 Merge branch 'http_request_remove_list' into integration 2026-02-16 19:49:45 -06:00
J. Nick Koston 4d5010db5d [http_request] Replace std::list<Header> with std::vector<Header> in perform() chain
std::list uses per-node heap allocation (one allocation per element)
and has poor cache locality. std::vector is contiguous and uses a
single allocation.

Changes:
- Replace std::list<Header> with std::vector<Header> in perform()
  virtual method signature across all platforms (IDF, Arduino, Host)
- Update all start(), get(), post() overloads accordingly
- Add ESPDEPRECATED overloads for std::list<Header> callers
- Update online_image to use std::vector<Header>
- Clean up request_headers construction in play() using structured
  bindings and reserve()
2026-02-16 19:37:38 -06:00
J. Nick Koston 0797ece7ce Merge branch 'http_request_remove_action_maps' into integration 2026-02-16 19:19:11 -06:00
J. Nick Koston 3cc096188c [http_request] Use FixedVector for request_headers_ and json_ in action
The sizes are known at Python codegen time, so use FixedVector with
init() for a single allocation and no reallocation machinery. This
eliminates _M_realloc_append template instantiations for these types.
2026-02-16 19:18:25 -06:00
J. Nick Koston 999ebf9496 [http_request] Use FixedVector for request_headers_ and json_ in action
The sizes are known at Python codegen time, so use FixedVector with
init() for a single allocation and no reallocation machinery. This
eliminates _M_realloc_append template instantiations for these types.
2026-02-16 19:18:11 -06:00