Commit Graph
24197 Commits
Author SHA1 Message Date
J. Nick Koston 0fd58c6ce0 Merge remote-tracking branch 'upstream/staticvector-skip-zero-init' into integration 2026-03-07 08:02:38 -10:00
J. Nick Koston b8b219926d [core] Skip zero-initialization of StaticVector data array
Remove value-initialization ({}) from StaticVector's underlying
std::array. Only elements [0, count_) are ever accessed, so
initializing the full array is wasted work.

This eliminates a memset on every construction. Most impactful for
stack-allocated StaticVectors in hot paths like
APIPlaintextFrameHelper::write_protobuf_messages, which was
memsetting 276 bytes of iovec storage on every BLE proxy flush.
2026-03-07 08:01:08 -10:00
J. Nick Koston ed8e90bcb6 Merge remote-tracking branch 'upstream/inline-ble-addr-to-uint64' into integration 2026-03-07 07:57:35 -10:00
J. Nick Koston 9c56c95cf8 [esp32_ble] Inline ble_addr_to_uint64 to eliminate call overhead
Move ble_addr_to_uint64 from ble.cpp to ble.h as inline. This
eliminates the indirect call and Xtensa register window rotation
at all 3 call sites, most importantly in the BLE proxy hot path
(BluetoothProxy::parse_devices) which calls it per advertisement.

Saves 24 bytes of flash overall.
2026-03-07 07:56:34 -10:00
J. Nick Koston f05b1ab036 Merge branch 'protect_entity_setters' into integration
# Conflicts:
#	esphome/components/bluetooth_proxy/bluetooth_proxy.cpp
2026-03-07 07:44:47 -10:00
J. Nick Koston 70a01158d3 Merge remote-tracking branch 'upstream/dev' into protect_entity_setters
# Conflicts:
#	esphome/core/entity_base.cpp
#	esphome/core/entity_base.h
#	esphome/core/entity_helpers.py
#	tests/component_tests/sensor/test_sensor.py
#	tests/component_tests/text_sensor/test_text_sensor.py
2026-03-07 07:30:27 -10:00
J. Nick Koston a0cd35c5fc [core] Inline status_clear_warning/error fast path (#14571) 2026-03-07 07:27:08 -10:00
J. Nick Koston e7b8ec18f1 [api] Inline APIServer::is_connected() for common no-arg path (#14574) 2026-03-07 07:26:50 -10:00
J. Nick Koston 77f2c371b2 [api] Single-pass protobuf encode for BLE proxy advertisements (#14575) 2026-03-07 07:26:34 -10:00
J. Nick KostonandClaude Opus 4.6 45f20d9c06 [core] Merge set_name + set_entity_strings into configure_entity_ (#14444)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 07:26:01 -10:00
J. Nick Koston f57fa4cc8d [bluetooth_proxy] Add BLE connection parameters API (#14577) 2026-03-07 07:25:33 -10:00
J. Nick Koston abc870006c [captive_portal] Enable support for RP2040 (#14505) 2026-03-07 07:25:13 -10:00
puddly 15ffbb0b05 [uart] Fully enable raw mode with host serial (#14573) 2026-03-07 11:51:02 -05:00
Simon Redman 8b62c35ea7 [uart] Add error message when initializing UART with unsupported configuration (#13229) 2026-03-07 11:41:37 -05:00
tomaszduda23 0e106d843c [nrf52][zephyr] support for multi on rate callbacks (#14557) 2026-03-07 11:18:21 -05:00
rwrozelle cbebb81196 [openthread] move esp functions into correct file (#14588) 2026-03-07 11:12:27 -05:00
J. Nick Koston 1336198423 Merge branch 'warn-crystal-mismatch' into integration
# Conflicts:
#	tests/unit_tests/test_util.py
2026-03-06 22:45:07 -10:00
J. Nick Koston 1312fe2658 Merge branch 'proto-backpatch-encode' into integration 2026-03-06 22:42:53 -10:00
J. Nick KostonandClaude Opus 4.6 696c0f021c Patch at import point instead of subprocess.run
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:38:44 -10:00
J. Nick KostonandClaude Opus 4.6 9f72d5e428 Add test for run_external_process line_callbacks coverage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:35:33 -10:00
J. Nick Koston d1b2010ed2 Use walrus operator in crystal regex match 2026-03-06 22:31:38 -10:00
J. Nick Koston 84383755d7 Fix pylint disable comment placement for esptool.main 2026-03-06 22:30:40 -10:00
J. Nick Koston dc4506453e Add tests for crystal callback wiring in upload_using_esptool
Tests both the in-process (run_external_command) and subprocess
(run_external_process) paths to ensure line_callbacks are passed.
2026-03-06 22:29:23 -10:00
J. Nick Koston 511e47b0f5 Remove unnecessary CORE mock from tests
CORE.reset() is called after each test via the reset_core fixture,
and CORE.dashboard defaults to False, so patching is not needed.
2026-03-06 22:26:12 -10:00
J. Nick Koston ae8dabc41a Add test for run_external_command with line_callbacks 2026-03-06 22:25:18 -10:00
J. Nick Koston 880962aa83 Address review: pass line_callbacks to run_external_process, fix filter_lines type
- Pass line_callbacks through to run_external_process so the crystal
  frequency warning works when ESPHOME_USE_SUBPROCESS is set
- Fix filter_lines type annotation from str to list[str] to match
  actual usage
2026-03-06 22:24:12 -10:00
J. Nick Koston 8a50c38844 Use contextlib.suppress instead of try/except/pass 2026-03-06 22:11:07 -10:00
J. Nick Koston c2747a6d35 Add tests and use walrus operator for crystal freq check 2026-03-06 22:09:52 -10:00
J. Nick Koston 0e7d4d8301 Fix line callbacks not firing when no filter_lines set
The line buffering and callback processing only ran when a filter
pattern was configured. Enter the line processing branch whenever
line_callbacks are registered too.
2026-03-06 22:04:43 -10:00
J. Nick Koston 06ac17e443 Use early return pattern in crystal frequency check 2026-03-06 22:00:44 -10:00
J. Nick KostonandClaude Opus 4.6 c622ee6a6e [core] Warn on crystal frequency mismatch during serial upload
When flashing an ESP32 via serial, esptool prints the detected crystal
frequency. This change parses that output in real-time and warns the
user if it doesn't match the configured CONFIG_XTAL_FREQ in sdkconfig.

This is particularly important for ESP32-C2 (ESP8684) boards where
some modules use 26MHz crystals but the default sdkconfig assumes 40MHz,
causing UART logging and other clock-dependent features to silently fail.

Also adds a generic line_callbacks mechanism to RedirectText so future
output-based checks can be added without modifying the class directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 21:58:29 -10:00
J. Nick Koston d22a1fe2d4 Merge remote-tracking branch 'upstream/dev' into proto-backpatch-encode 2026-03-06 21:36:53 -10:00
J. Nick Koston c0954033a5 Merge branch 'bluetooth-connection-params-api' into integration 2026-03-06 21:27:41 -10:00
J. Nick Koston a9f576fc90 [bluetooth_proxy] Harden bluetooth_set_connection_params
- Add null check for api_connection_ before sending response
- Clamp uint32_t protobuf fields to uint16_t range for BLE spec
- Include connection index and address in warning log message
2026-03-06 21:26:14 -10:00
J. Nick Koston 0558815498 Merge remote-tracking branch 'origin/bluetooth-connection-params-api' into integration 2026-03-06 21:09:03 -10:00
J. Nick Koston 1117e18580 Merge upstream/dev into bluetooth-connection-params-api 2026-03-06 19:03:22 -10:00
J. Nick Koston 05ae69b766 [api] Sync api.proto from aioesphomeapi (#14579) 2026-03-06 19:00:37 -10:00
J. Nick Koston 029911f3f1 [bluetooth_proxy] Return error from update_connection_params
Change update_conn_params_ to return esp_err_t so the actual error
from esp_ble_gap_update_conn_params() is propagated back to the
API caller instead of always returning ESP_OK.
2026-03-06 18:15:07 -10:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 9b489c9eba Bump aioesphomeapi from 44.2.0 to 44.3.1 (#14580)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-07 03:52:51 +00:00
J. Nick Koston b7e3e75a40 [bluetooth_proxy] Add BLE connection parameters API
Add support for setting BLE connection parameters (min/max interval,
latency, supervision timeout) on connected devices via the native API.
This allows integrations like yalexs-ble to reduce battery drain on
"Always Connected" BLE devices by switching from fast connection intervals
to slower ones after connection is established.

Adds new BluetoothSetConnectionParamsRequest/Response protobuf messages
(IDs 145/146) and routes them through the bluetooth proxy to call
esp_ble_gap_update_conn_params() on the ESP32.

Related: home-assistant/core#153977
2026-03-06 16:30:51 -10:00
Ricardo Sanz df11e2765e [climate][haier][template][core] Relocate CONF_CURRENT_TEMPERATURE to general const file (#14503) 2026-03-07 01:00:52 +00:00
J. Nick Koston 1200c378e3 Merge remote-tracking branch 'upstream/proto-backpatch-encode' into integration 2026-03-06 14:32:18 -10:00
J. Nick Koston 61d5022bf2 Merge branch 'dev' into proto-backpatch-encode 2026-03-06 14:31:56 -10:00
J. Nick Koston a7100beb6f [api] Add single-pass encode_sub_message to eliminate redundant calculate_size() calls
Replace encode_message with encode_sub_message for protobuf submessage encoding.

For repeated submessage fields, encode_sub_message uses a backpatch approach:
writes field tag, reserves 1 byte for length varint, encodes the body, then
backpatches the actual length. For bodies >= 128 bytes, shifts the body forward
to make room for a multi-byte varint. This eliminates 2 of 3 calculate_size()
calls per repeated submessage element.

For singular submessage fields, encode_sub_message uses calculate_size() upfront
to skip empty submessages without writing to the buffer, preserving the debug
size check.

For the BLE advertisement proxy hot path (16 advertisements per batch), this
reduces calculate_size() calls from 48 to 16 per flush.
2026-03-06 14:30:56 -10:00
AndreKRandJonathan Swoboda f53ee70caa [http_request] Make TLS buffer configurable on ESP8266 (#14009)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-06 14:29:20 -10:00
J. Nick Koston 80d3c9a1d6 Merge remote-tracking branch 'origin/integration' into integration
# Conflicts:
#	esphome/components/api/proto.cpp
#	esphome/components/api/proto.h
2026-03-06 14:28:13 -10:00
J. Nick Koston 8f7c34c502 Merge branch 'proto-backpatch-encode' into integration 2026-03-06 14:27:11 -10:00
J. Nick Koston 3d5b1e327e [api] Add single-pass encode_sub_message to eliminate redundant calculate_size() calls
Replace encode_message with encode_sub_message for protobuf submessage encoding.

For repeated submessage fields, encode_sub_message uses a backpatch approach:
writes field tag, reserves 1 byte for length varint, encodes the body, then
backpatches the actual length. For bodies >= 128 bytes, shifts the body forward
to make room for a multi-byte varint. This eliminates 2 of 3 calculate_size()
calls per repeated submessage element.

For singular submessage fields, encode_sub_message uses calculate_size() upfront
to skip empty submessages without writing to the buffer, preserving the debug
size check.

For the BLE advertisement proxy hot path (16 advertisements per batch), this
reduces calculate_size() calls from 48 to 16 per flush.
2026-03-06 14:26:58 -10:00
J. Nick Koston a1c3129f9b Merge branch 'proto-backpatch-encode' into integration 2026-03-06 14:23:16 -10:00
J. Nick Koston b38af3d6ec [api] Add single-pass encode_sub_message to eliminate redundant calculate_size() calls
Replace encode_message with encode_sub_message for protobuf submessage encoding.

For repeated submessage fields, encode_sub_message uses a backpatch approach:
writes field tag, reserves 1 byte for length varint, encodes the body, then
backpatches the actual length. For bodies >= 128 bytes, shifts the body forward
to make room for a multi-byte varint. This eliminates 2 of 3 calculate_size()
calls per repeated submessage element.

For singular submessage fields, encode_sub_message uses calculate_size() upfront
to skip empty submessages without writing to the buffer, preserving the debug
size check.

For the BLE advertisement proxy hot path (16 advertisements per batch), this
reduces calculate_size() calls from 48 to 16 per flush.
2026-03-06 14:20:54 -10:00