Commit Graph
24167 Commits
Author SHA1 Message Date
J. Nick Koston 1312fe2658 Merge branch 'proto-backpatch-encode' into integration 2026-03-06 22:42:53 -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] 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
J. Nick Koston e7ac1c2ce1 Merge branch 'inline-is-connected' into integration 2026-03-06 12:57:25 -10:00
J. Nick Koston f723deca18 [api] Inline APIServer::is_connected() for common no-arg path
The is_connected() method is called on every BLE advertisement
in the bluetooth_proxy hot path, but was forced out-of-line by
the state_subscription_only parameter added in #11906.

The default path (no argument) is just `!clients_.empty()` — a
simple pointer comparison. Split into:
- is_connected(): inline in header (common fast path)
- is_connected_with_state_subscription(): out-of-line (rare path)

No callers pass true directly; only APIConnectedCondition uses
the state_subscription_only template value, updated accordingly.
2026-03-06 12:53:41 -10:00
J. Nick Koston 31fbff9f2a Merge remote-tracking branch 'upstream/dev' into integration 2026-03-06 12:32:42 -10:00
Jonathan SwobodaandClaude Opus 4.6 d8deb2255d [mipi_rgb] Fix byte order and dirty bounds in fill() (#14537)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 12:18:09 -10:00
dependabot[bot]andJ. Nick Koston 035f985693 Bump ruff from 0.15.4 to 0.15.5 (#14565)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-06 22:16:36 +00:00
dependabot[bot] 086c1bb505 Bump docker/build-push-action from 6.19.2 to 7.0.0 in /.github/actions/build-image (#14567)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-06 12:12:44 -10:00
dependabot[bot] c26c5935b6 Bump github/codeql-action from 4.32.5 to 4.32.6 (#14566)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-06 12:12:19 -10:00
J. Nick Koston 83e01035c9 Merge branch 'protect_entity_setters' into integration 2026-03-06 11:19:02 -10:00
J. Nick Koston dfa8c683dc Drop unnecessary default=0 from config.get(_KEY_*_IDX) calls 2026-03-06 11:18:44 -10:00
J. Nick Koston 2852d86a2f Address review: robust regex and comment accuracy
- Fix extract_packed_value regex to handle commas in entity names
  by matching C++ string literals instead of [^,]+
- Only describe dc/uom/icon in comments when their index is actually
  non-zero, so comment matches what was packed
2026-03-06 11:18:11 -10:00
J. Nick Koston 9906008171 Merge remote-tracking branch 'upstream/inline-status-clear' into integration 2026-03-06 11:17:07 -10:00
J. Nick Koston c1c73dd619 Merge remote-tracking branch 'upstream/protect_entity_setters' into integration
# Conflicts:
#	tests/component_tests/binary_sensor/test_binary_sensor.py
#	tests/component_tests/button/test_button.py
#	tests/component_tests/text/test_text.py
#	tests/component_tests/text_sensor/test_text_sensor.py
2026-03-06 11:16:34 -10:00
J. Nick Koston 2e79866ee3 Merge branch 'dev' into inline-status-clear 2026-03-06 11:15:32 -10:00
Jonathan SwobodaandClaude Opus 4.6 de7572bd3e [lightwaverf] Fix ISR safety issues (#14563)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 11:04:12 -10:00
Jonathan SwobodaandClaude Opus 4.6 5777908da7 [iaqcore][scd30][sen21231][beken_spi_led_strip] Fix uninitialized variables and missing error checks (#14568)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 11:03:53 -10:00
J. Nick Koston 9370b0451d [core] Inline status_clear_warning/error fast path
Move the flag-check early return for status_clear_warning() and
status_clear_error() into inline methods in the header. The slow
path (flag clear + log message) remains out-of-line.

This eliminates a call8 on every poll cycle for components that
call status_clear_warning() unconditionally on success, which is
the common pattern.
2026-03-06 11:03:36 -10:00
587bf68091 [ltr501][pvvx_mithermometer][smt100] Convert static locals to instance members (#14569)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-06 11:03:30 -10:00
J. Nick Koston c956b33e93 Add comment noting shift correctness is verified by integration test 2026-03-06 11:02:35 -10:00
J. Nick Koston 86dd579dea Remove internal shift constants from unit tests
Tests now verify packed values via comment strings and non-zero
checks rather than decoding individual bit positions. This removes
the coupling to internal bit layout constants.
2026-03-06 11:00:19 -10:00
J. Nick Koston 41c413d5f7 Move extract_packed_value to shared component test helper
Add tests/component_tests/helpers.py with typed extract_packed_value()
and INTERNAL_BIT constant, replacing 5 duplicate copies.
2026-03-06 10:56:51 -10:00
J. Nick Koston c704d97804 Strengthen internal flag assertions in component tests
All internal-flag tests now extract the packed value and verify
bit 24 is set/clear for the correct entities, instead of just
checking configure_entity_() call presence.
2026-03-06 10:54:19 -10:00
J. Nick Koston b6b1378019 Strengthen internal flag assertions in component tests
All internal-flag tests now extract the packed value and verify
bit 24 is set/clear for the correct entities, instead of just
checking configure_entity_() call presence.
2026-03-06 10:54:06 -10:00
Jonathan SwobodaandClaude Opus 4.6 2c83c6a79f [shelly_dimmer][lvgl][seeed_mr60fda2][packet_transport] Fix buffer bounds checks (#14534)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:47:56 -10:00
Jonathan SwobodaandClaude Opus 4.6 4f4b2bfdec [bmp581_base][bl0906] Fix 24-bit sign extension bugs (#14558)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:14:35 +00:00
Jonathan SwobodaandClaude Opus 4.6 0469612d07 [multiple] Fix assorted medium-severity bugs (#14555)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:02:17 -05:00
J. Nick Koston dffb964e0c Merge branch 'protect_entity_setters' into integration 2026-03-06 09:56:13 -10:00
J. Nick Koston 54a8f558d6 Convert finalize tests to end-to-end through public API
Tests now go through _setup_entity_impl + setup_device_class/
setup_unit_of_measurement + finalize_entity_strings using real
CONF_* keys instead of internal _KEY_* constants.
2026-03-06 09:51:26 -10:00
Jonathan SwobodaandClaude Opus 4.6 8f3db96291 [esp32_ble_server][weikai][ade7880] Fix copy-paste bugs (#14552)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:50:26 -10:00
Jonathan SwobodaandClaude Opus 4.6 a9cceebb33 [pid][nextion][pn532_i2c][pipsolar] Fix copy-paste and logic bugs (#14551)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:48:50 -10:00
J. Nick Koston c37f1481ce Derive entity category names from cv.ENTITY_CATEGORIES and cleanup
- Remove hardcoded _ENTITY_CATEGORY_NAMES dict, derive from cv.ENTITY_CATEGORIES keys
- Remove redundant local import re (already at top level)
- Remove last setup_test_environment noqa line
2026-03-06 09:46:28 -10:00