Commit Graph
26552 Commits
Author SHA1 Message Date
J. Nick Koston 1f098313ae Merge remote-tracking branch 'upstream/total-daily-energy-no-loop' into integration 2026-04-03 17:44:58 -10:00
J. Nick Koston 089b38f77a [total_daily_energy] Replace loop() with timeout-based midnight reset 2026-04-03 17:30:12 -10:00
J. Nick Koston 1dc0b4d03d Merge remote-tracking branch 'upstream/dev' into integration 2026-04-03 16:58:26 -10:00
J. Nick Koston 2337767c38 [modbus_controller] Fix format specifier warnings (#15429) 2026-04-03 16:37:31 -10:00
J. Nick Koston 4f2290d548 [web_server] Disable loop when no SSE clients are connected (#15428) 2026-04-03 16:37:20 -10:00
Clyde Stubbs 7ab26a4fe0 [ili9xxx][st7735] Add deprecation warnings (#15416) 2026-04-04 13:21:58 +11:00
J. Nick Koston 0c00af88e2 Merge remote-tracking branch 'upstream/web_server_disable_loop' into integration 2026-04-03 14:49:29 -10:00
J. Nick Koston fec8fe932f [web_server] Skip ping interval when no SSE clients are connected 2026-04-03 14:49:02 -10:00
J. Nick Koston 84787e05b1 Merge remote-tracking branch 'upstream/web_server_disable_loop' into integration 2026-04-03 14:33:32 -10:00
J. Nick Koston 945a6b1063 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-03 14:33:20 -10:00
J. Nick Koston 308877cf6e [web_server] Disable loop when no SSE clients are connected 2026-04-03 14:32:42 -10:00
J. Nick Koston ef41caa347 Merge branch 'api-proto-max-length' into integration 2026-04-03 14:16:20 -10:00
J. Nick Koston 80502e8c39 [api] Rename encode_short_string to write_short_string 2026-04-03 14:15:19 -10:00
J. Nick Koston dd08d7631e [core] Add test for register_unit_of_measurement max length 2026-04-03 14:13:03 -10:00
J. Nick Koston 5740d74d97 [core] Enforce UNIT_OF_MEASUREMENT_MAX_LENGTH in register_unit_of_measurement 2026-04-03 14:11:51 -10:00
J. Nick Koston f0622b7624 [api] Add max_data_length = 63 for unit_of_measurement fields
Add UNIT_OF_MEASUREMENT_MAX_LENGTH = 63 constant in core/config.py
and enforce it in sensor and number component validators.

Annotate unit_of_measurement proto fields with (max_data_length) = 63
so the codegen emits constant-size length varint calculations.
2026-04-03 14:10:25 -10:00
J. Nick Koston 4ce24389b7 [api] Add max_data_length = 47 for device_class fields 2026-04-03 14:06:00 -10:00
J. Nick Koston fd68e9a827 [api] Rename encode_raw_short_string to encode_short_string 2026-04-03 14:01:14 -10:00
J. Nick Koston 2d13def0ee [api] Add encode_raw_short_string for forced string fields with max_data_length
Replace 3-call sequence (write_raw_byte + write_raw_byte + encode_raw)
with single inlined encode_raw_short_string call for forced string
fields with max_data_length < 128. The compiler can hoist the pos
pointer across all three writes in one function boundary.
2026-04-03 14:00:01 -10:00
J. Nick Koston 675400cc31 [api] Use .empty() for string zero check in single-byte varint size 2026-04-03 13:51:25 -10:00
J. Nick Koston 0124087e73 [api] Add max_data_length = 63 for icon fields 2026-04-03 13:40:27 -10:00
J. Nick Koston 5dbe2a7741 [api] Add comment tying max_data_length = 120 to NAME_MAX_LENGTH 2026-04-03 13:36:32 -10:00
J. Nick Koston e174e579ed [api] Add max_data_length proto option and optimize entity name/object_id
Add max_data_length field option for string/bytes fields. When
max_data_length < 128, the codegen emits constant-size length varint
calculations and direct byte writes.

Annotate all entity name and object_id fields with
(max_data_length) = 120 and (force) = true across all 25
ListEntities*Response messages (50 fields).

Generated code changes:
- calculate_size: `calc_length(1, size)` -> `2 + size` (constant)
- encode: `encode_string(N, ref)` -> `write_raw_byte(tag) + write_raw_byte(len) + encode_raw(data, len)`

Eliminates 2 function calls per field per entity list response,
removes zero-check branches, and removes varint size computation.
2026-04-03 13:33:51 -10:00
dependabot[bot] 533eeabf1d Bump aioesphomeapi from 44.8.1 to 44.9.0 (#15425)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-03 23:17:49 +00:00
J. Nick Koston 85d9f36028 Merge remote-tracking branch 'upstream/api-proto-max-value-codegen' into integration 2026-04-03 12:48:23 -10:00
J. Nick Koston 9ece286a26 [api] Simplify _get_single_byte_varint_size 2026-04-03 12:32:32 -10:00
J. Nick Koston fa80caf0ff [api] Fall back to RAW_ENCODE_MAP when SMALL_MAP has no entry 2026-04-03 12:31:44 -10:00
J. Nick Koston f3238a857e [api] Select encode map before lookup 2026-04-03 12:31:01 -10:00
J. Nick Koston 02b424388e [api] Use RAW_ENCODE_SMALL_MAP for max_value encode optimization
Replace inline encode_func check with a lookup table, matching the
existing RAW_ENCODE_MAP pattern.
2026-04-03 12:28:51 -10:00
J. Nick Koston 363d811cc1 [api] Use _get_simple_size_calculation for FixedArrayBytesType fallback
Replace inline calc_length/calc_length_force formatting with the
existing helper method.
2026-04-03 12:27:55 -10:00
J. Nick Koston 1e68a90ac9 [api] Extract _get_single_byte_varint_size helper in codegen
Refactor the constant-size varint pattern into a reusable helper
method on the TypeInfo base class, used by both UInt32Type (max_value)
and FixedArrayBytesType (fixed_array_size < 128).
2026-04-03 12:26:51 -10:00
J. Nick Koston e35aa729f3 [api] Add max_value proto option for constant-size varint codegen
Add a max_value field option to api_options.proto that tells the code
generator the maximum value a field can have. When max_value < 128,
the generated calculate_size() uses constant arithmetic instead of
calling varint size functions, and encode() uses direct byte writes
instead of varint encoding.

Also optimize FixedArrayBytesType: when fixed_array_size < 128, the
length varint is always 1 byte, so calculate_size() uses constant
arithmetic and encode() uses write_raw_byte for the length.

Applied to BluetoothLERawAdvertisement.address_type (max_value=4).

Measured on ESP32 (upstairsdesk89proxy):
- BluetoothLERawAdvertisement::calculate_size: 88 → 71 bytes (-19%)
- BluetoothLERawAdvertisement::encode: 199 → 179 bytes (-10%)
- Total BLE proxy hot path: 1807 → 1770 bytes (-37 bytes)
2026-04-03 12:21:37 -10:00
J. Nick Koston 2364a54ee9 Merge remote-tracking branch 'upstream/libretiny-wifi-queue-abstraction' into integration 2026-04-03 10:24:52 -10:00
J. Nick Koston 3ee213f6f4 Merge branch 'esp32_ble_loop_skip_memw' into integration 2026-04-03 10:24:47 -10:00
Bonne EgglestonandJ. Nick Koston c6bb1fe141 [modbus] Add integration tests for server and server via controller (#14845)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-03 20:24:02 +00:00
J. Nick Koston 669a308209 Use pop() instead of empty() for wifi_loop_ fast path
Replace empty() + pop() with pop() directly as the fast-path check:

- LockFreeQueue: pop() costs 1 memw (acquire on tail_) vs empty()'s
  2 memw (acquire on both head_ and tail_) on Xtensa
- FreeRTOSQueue: pop() is 1 critical section vs empty() + pop() = 2

Also move dropped count check after the drain loop since drops can
only occur when the queue was full, and only this loop drains it.
2026-04-03 10:23:49 -10:00
J. Nick Koston d341ee8c76 [esp32_ble] Skip dropped count check when queue is empty
On Xtensa (dual-core ESP32), even relaxed atomic loads emit a memw
barrier instruction. The dropped_count_ check in get_and_reset_dropped_count()
was executing every loop() iteration even when the queue was empty.

Since drops only occur when the queue is full, and only the main loop
drains the queue, an empty queue guarantees no new drops since the last
reset. Restructure the loop to early-return when pop() returns nullptr,
skipping the unnecessary memw.

Also moves advertising_->loop() before the queue drain so it runs
unconditionally without duplication, and converts while to do/while
since the first element is known non-null after the nullptr check.
2026-04-03 10:21:20 -10:00
J. Nick Koston 4d4ff0303d Merge remote-tracking branch 'upstream/dev' into integration 2026-04-03 10:03:23 -10:00
dependabot[bot] f8f65c1a7b Bump click from 8.3.1 to 8.3.2 (#15421)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-03 09:42:37 -10:00
J. Nick Koston d90e2a6a9a [core] Use __builtin_ctz for FiniteSetMask bit scanning (#15400) 2026-04-03 08:28:54 -10:00
J. Nick Koston 4969fd6e99 [light] Use reciprocal multiply in normalize_color (#15401) 2026-04-03 08:28:41 -10:00
J. Nick Koston 95683b7416 [light] Pass LightTraits to avoid redundant virtual get_traits() calls (#15403) 2026-04-03 08:28:29 -10:00
J. Nick Koston 38f4dc3217 [uptime] Pass known length to publish_state to avoid redundant strlen (#15410) 2026-04-03 08:28:07 -10:00
J. Nick Koston f2a0d9943d [benchmarks] Add host platform benchmarks for text_sensor and button (#15407) 2026-04-03 08:27:55 -10:00
J. Nick Koston ea0227a206 [benchmarks] Add host platform benchmarks for number, select, and switch (#15405) 2026-04-03 08:27:44 -10:00
J. Nick Koston 5a23669747 [scheduler] Fix unrealistic scheduler benchmarks missing periodic drain (#15396) 2026-04-03 08:27:29 -10:00
J. Nick Koston 2a5933e4f7 [host] Add graceful shutdown on SIGINT/SIGTERM (#15387) 2026-04-03 08:27:13 -10:00
Jonathan Swoboda 6fecd72049 [ezo_pmp] Fix change_i2c_address action using wrong template type (#15393) 2026-04-03 08:35:16 -04:00
Clyde Stubbs 8360502a94 [ci] Fix deprecated-component matcher (#15417) 2026-04-03 08:01:04 -04:00
Jonathan Swoboda 5548a32771 [ili9xxx] Fix SPI MOSI pin validation never executing (#15399) 2026-04-03 21:15:51 +11:00