Commit Graph
26822 Commits
Author SHA1 Message Date
J. Nick Koston 7293683297 Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-04-06 14:09:54 -10:00
J. Nick Koston 6523ed05b8 Merge branch 'float-to-raw-optimization-v2' into integration
# Conflicts:
#	esphome/components/api/proto.h
2026-04-06 14:08:50 -10:00
J. Nick Koston 136eabebb4 Merge branch 'api-enum-auto-max-value' into integration
# Conflicts:
#	esphome/components/api/api_pb2.cpp
#	script/api_protobuf/api_protobuf.py
2026-04-06 14:07:38 -10:00
J. Nick Koston 13e35db055 Restore IRAM_ATTR on wake_loop functions 2026-04-06 14:03:19 -10:00
J. Nick Koston 7c671cd0e6 Merge branch 'api-proto-max-length' into integration
# Conflicts:
#	esphome/components/api/api_connection.cpp
#	esphome/components/api/api_pb2.cpp
#	esphome/components/api/proto.h
#	esphome/core/application.h
#	esphome/core/component.cpp
#	script/api_protobuf/api_protobuf.py
2026-04-06 14:02:14 -10:00
J. Nick Koston 2eb3e25278 Add debug assert to encode_short_string_force for size < 128 2026-04-06 13:58:10 -10:00
J. Nick Koston be476c3a79 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-04-06 13:49:16 -10:00
J. Nick Koston 17e5320836 do not force inline 2026-04-06 13:40:50 -10:00
J. Nick Koston 87622c9a74 [api] Add max_data_length proto option and optimize entity string encoding
Add a max_data_length field option to api_options.proto for string/bytes
fields. When max_data_length < 128 and force = true, the code generator
uses encode_short_string_force() — a single call that writes the tag
byte, 1-byte length varint, and raw string data with no branching. Size
calculation simplifies from calc_length(1, size) to 2 + size.

Annotate entity fields across all 25 ListEntities*Response messages:
- name and object_id: max_data_length = 120, force = true (50 fields)
- icon: max_data_length = 63 (25 fields)

The 120 and 63 values match NAME_MAX_LENGTH and ICON_MAX_LENGTH in
esphome/core/config.py, validated at config time.
2026-04-06 13:28:50 -10:00
J. Nick Koston 37258de6b1 [api] Auto-derive max_value for enum fields in protobuf codegen
Scan all enum definitions in api.proto at codegen time and automatically
populate max_value for enum-typed fields. This eliminates the need for
manual (max_value) annotations on every enum field.

When max_value < 128, the generated calculate_size uses constant-size
arithmetic instead of a function call:
- `calc_uint32(1, static_cast<uint32_t>(field))` → `field ? 2 : 0`

For repeated enum fields with constant element size, the per-element
loop is replaced with a multiply: `size += count * bytes_per_element`.
2026-04-06 13:19:37 -10:00
J. Nick Koston a1cc7ea861 [api] Use integer comparison for float zero checks in protobuf encoding
encode_float() already used union type-punning to convert a float to
its raw uint32_t bits for encoding. However, its zero check still used
a floating-point comparison (value == 0.0f), and calc_float() used
value != 0.0f with no type-punning at all.

Extract the existing union type-punning into a shared float_to_raw()
helper and use it in both places, so the zero check is a simple integer
comparison (raw == 0) in both encode_float() and calc_float(). This
ensures size calculation always matches encoding.

On platforms without hardware FPU (ESP8266, some LibreTiny chips),
value != 0.0f compiles to a software float library call (__nesf2 or
similar). The new code does a single integer comparison instead.
2026-04-06 13:01:19 -10:00
Clyde Stubbs ce0d360790 [lvgl] Implement rotation directly (#14955) 2026-04-07 10:46:42 +12:00
J. Nick Kostonandpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> 2b5ee69eb2 [api] Speed up protobuf encode 17-20% with register-optimized write path (#15290)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-04-06 12:42:18 -10:00
Jonathan SwobodaandJ. Nick Koston 5a14d6a4ad [multiple] Add missing device_class to sensor schemas (batch 2) (#15487)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-04-06 22:38:47 +00:00
Jonathan Swoboda 6f62b2f18c [thermostat] Remove non-functional cv.templatable from preset fields (#15481) 2026-04-06 12:20:38 -10:00
Jonathan Swoboda c78fb964a2 [multiple] Add missing state_class to remaining sensor schemas (#15486) 2026-04-06 12:15:42 -10:00
Jonathan Swoboda 8650c5b013 [multiple] Add missing state_class to sensor schemas (#15478) 2026-04-06 17:19:20 -04:00
Jonathan Swoboda 5051891813 [esp32] Fix ESP32-C6 pin validator rejecting GPIO 24-30 with wrong error (#15477) 2026-04-06 17:02:28 -04:00
Jonathan Swoboda 95e2b0a8b0 [multiple] Add missing device_class to sensor schemas (#15479) 2026-04-06 17:02:20 -04:00
J. Nick KostonandJonathan Swoboda ab45591507 [core] Move wake_loop out of socket component into core (#15446)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-04-06 21:01:03 +00:00
Jonathan Swoboda 62b4b250c7 [opentherm] Fix step=0 default overriding entity step (#15484) 2026-04-07 08:35:50 +12:00
Jonathan Swoboda a7963bee98 [gcja5][cd74hc4067][openthread_info] Fix PollingComponent mismatches (#15476) 2026-04-06 16:31:40 -04:00
Jonathan Swoboda e86978f0da [rpi_dpi_rgb][st7701s][ags10] Fix Optional config keys accessed unconditionally (#15474) 2026-04-06 16:30:46 -04:00
Jonathan Swoboda 6044f41db5 [multiple] Add missing cv.COMPONENT_SCHEMA to CONFIG_SCHEMA (#15475) 2026-04-06 16:30:15 -04:00
Jonathan Swoboda a64f09a43f [sprinkler][dfplayer][max6956][rf_bridge] Fix cg.templatable type mismatches (#15480) 2026-04-06 16:29:59 -04:00
Jonathan Swoboda dbd4e77d61 [pylontech] Remove unnecessary Component inheritance from sensor/text_sensor (#15482) 2026-04-06 16:23:10 -04:00
Boris Krivonog 02185fb4f4 [mitsubishi_cn105] Add climate component for Mitsubishi A/C units with CN105 connector (Part 5) (#15483) 2026-04-06 09:59:18 -10:00
J. Nick Koston f0e3b992cf Use indexed writes in write_short_string
Single pointer advance instead of repeated post-increments.
2026-04-06 08:51:42 -10:00
J. Nick Koston b8981aae12 Revert write_short_string for non-forced strings
Inlining the empty check + write_short_string for every non-forced
string field doubles code size vs a single encode_string call.
2026-04-06 08:49:37 -10:00
J. Nick Koston 4099064207 Use write_short_string for non-forced strings with max_data_length < 128
Add empty check wrapper for non-forced short strings instead of falling
through to the general encode_string path.
2026-04-06 08:43:24 -10:00
J. Nick KostonandClaude Opus 4.6 33285dfe27 Fix merge issues: write_short_string to static ProtoEncode, add debug arg
- Convert ProtoEncode::write_short_string to static method with pos param
- Fix codegen to emit ProtoEncode::write_short_string(pos, ...)
- Add PROTO_ENCODE_DEBUG_INIT to encode_fn call in encode_to_buffer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 08:33:13 -10:00
J. Nick KostonandClaude Opus 4.6 7122fb6f88 Merge remote-tracking branch 'upstream/api-sint32-short-varint' into integration
Fix double static_cast in enum encode precomputed tag path by
passing raw field ref instead of pre-cast value_expr.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 08:31:05 -10:00
J. Nick Koston 443e42978b Merge branch 'dev' into api/peel-first-write-iteration 2026-04-06 02:08:14 -10:00
dependabot[bot] 2f2b7e42ba Bump aioesphomeapi from 44.9.1 to 44.11.1 (#15471) 2026-04-05 21:15:02 -10:00
J. Nick Koston 972c919ac0 Merge remote-tracking branch 'upstream/api-proto-max-length' into integration 2026-04-05 19:12:29 -10:00
J. Nick Koston 4e99510624 [api] Fix comment source references and add missing max_data_length
- Fix comment: NAME_MAX_LENGTH is in config_validation.py, not core/config.py
- Add missing max_data_length=63 to unit_of_measurement in ListEntitiesNumberResponse
2026-04-05 19:07:22 -10:00
J. Nick Koston 8fc7cdbe28 Merge remote-tracking branch 'upstream/api-enum-auto-max-value' into integration 2026-04-05 19:04:51 -10:00
J. Nick Koston fef4ff4a82 [api] Remove encode_small_varint — no real benefit over encode_uint32 2026-04-05 19:04:01 -10:00
J. Nick Koston 03d64317c7 Merge remote-tracking branch 'upstream/api-enum-auto-max-value' into integration 2026-04-05 18:58:09 -10:00
J. Nick Koston d5b5a6a4a7 [api] Don't use encode_small_varint for forced fields (must encode zero) 2026-04-05 18:57:04 -10:00
J. Nick Koston 307f436229 [api] Move zero-check into encode_small_varint to simplify call sites 2026-04-05 18:56:10 -10:00
J. Nick Koston 27a16ca97c [api] Use local pointer in encode_small_varint to avoid aliased pos_ stores 2026-04-05 18:54:39 -10:00
J. Nick Koston 883a300785 [api] Add encode_small_varint helper for single-byte tag+value encoding
Replace two separate write_raw_byte calls with a single
encode_small_varint(tag, value) call that writes both bytes
with one bounds check. Used for enum fields with max < 128.
2026-04-05 18:53:48 -10:00
J. Nick Koston 5a6330e366 [api] Remove redundant uint32_t cast in enum raw byte writes 2026-04-05 18:51:14 -10:00
J. Nick Koston 5c178eab63 [api] Optimize encode for non-forced enum fields with single-byte tags
When an enum field has max_value < 128 and a single-byte tag, emit
inline write_raw_byte calls instead of calling encode_uint32, which
avoids encode_field_raw and encode_varint_raw function call overhead.
2026-04-05 18:50:23 -10:00
J. Nick Koston 2b8311182a Merge remote-tracking branch 'upstream/api-proto-max-length' into integration 2026-04-05 18:42:52 -10:00
J. Nick Koston 2d43d07490 Merge branch 'dev' into api-proto-max-length 2026-04-05 18:42:30 -10:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1c97954b47 Bump aioesphomeapi from 44.9.0 to 44.9.1 (#15470)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-05 18:42:17 -10:00
J. Nick Koston 3f7e636f7a Merge remote-tracking branch 'upstream/api-enum-auto-max-value' into integration 2026-04-05 18:40:32 -10:00
J. Nick Koston bc47757af1 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-05 18:39:27 -10:00