Commit Graph
26929 Commits
Author SHA1 Message Date
J. Nick Koston 9d43ed77c6 Merge remote-tracking branch 'origin/scheduler-interval-direct-heap' into integration 2026-04-06 20:58:44 -10:00
J. Nick Koston cf704b6b91 Address review: remove unused global, fix assertion messages 2026-04-06 20:54:01 -10:00
J. Nick Koston c79e7f4018 [core] Reschedule fired intervals directly into heap instead of to_add_
When an interval fires in Scheduler::call(), push it directly back into
items_ via push_back() + push_heap() instead of routing through the
to_add_ staging vector and process_to_add_slow_path_().

This eliminates per-cycle overhead of process_to_add_slow_path_() which
acquires a lock, iterates to_add_, pushes each item into the heap, clears
the vector, and resets the atomic counter.
2026-04-06 20:37:04 -10:00
J. Nick Koston cfb6af6c69 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-06 19:19:44 -10:00
J. Nick Koston d0b3cdebdb Merge remote-tracking branch 'upstream/fan-store-preset-modes-on-entity' into integration 2026-04-06 19:19:34 -10:00
J. Nick Koston e3d95817a1 Merge remote-tracking branch 'upstream/climate-store-custom-modes-on-entity' into integration 2026-04-06 19:18:58 -10:00
J. Nick Koston 26e2d8c50d Merge remote-tracking branch 'upstream/api-max-data-length-force' into integration 2026-04-06 19:18:53 -10:00
dependabot[bot] 488a6a1c40 Bump aioesphomeapi from 44.11.1 to 44.12.0 (#15515)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-07 05:15:03 +00:00
J. Nick Koston 60b5893ec7 Merge branch 'dev' into climate-store-custom-modes-on-entity 2026-04-06 18:46:43 -10:00
J. Nick Koston 6db21ec054 Merge branch 'dev' into fan-store-preset-modes-on-entity 2026-04-06 18:46:32 -10:00
J. Nick Koston 7e0216e1bf [core] Add type annotations to cv.ByteLength 2026-04-06 18:45:08 -10:00
J. Nick Koston d3df97f534 Merge remote-tracking branch 'origin/api-max-data-length-force' into integration 2026-04-06 18:42:13 -10:00
J. Nick Koston 9ed1a35544 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-06 18:42:00 -10:00
J. Nick Koston b86ab07632 [core] Fix test for byte-length error message, add ByteLength and multibyte tests 2026-04-06 18:38:58 -10:00
J. Nick Koston cf9e79beda Merge branch 'dev' into api-max-data-length-force 2026-04-06 18:34:36 -10:00
J. Nick Koston cfcf9216f3 [core] Add cv.ByteLength validator, switch all proto-backed length checks to byte length
Add cv.ByteLength() validator that checks UTF-8 byte length instead
of character count. This ensures multibyte characters don't cause
the encoded string to exceed the proto max_data_length limit.

Switch all length validators that feed into proto fields with
max_data_length annotations to use byte length:
- Entity names, friendly names, area names, device names
- Icons, device classes, units of measurement
- Board names, project name/version
2026-04-06 18:33:04 -10:00
J. Nick Koston 52d76f8db0 [api] Fix name max_data_length to match hostname limit, add suggested_area
- Fix HelloResponse.name and DeviceInfoResponse.name max_data_length
  from 120 to 31 to match ESPHOME_DEVICE_NAME_MAX_LEN (hostname limit)
- Add max_data_length=120 + force to suggested_area field
- Add static_asserts for ESPHOME_DEVICE_NAME_MAX_LEN and
  ESPHOME_FRIENDLY_NAME_MAX_LEN
- Fix comments to accurately describe guarantees
2026-04-06 18:17:04 -10:00
J. Nick Koston 5a92a3b16e [api] Add max_data_length/force to model and project fields, validate board/project lengths
Add BOARD_MAX_LENGTH and PROJECT_MAX_LENGTH constants (127) and
enforce them in YAML validation for all platform board schemas
and project name/version.

Add max_data_length + force proto options to model, project_name,
and project_version fields in DeviceInfoResponse.
2026-04-06 18:14:18 -10:00
J. Nick Koston f94e1dfab6 [core] Move ControllerRegistry notify methods inline into header (#15505) 2026-04-07 16:12:01 +12:00
J. Nick Koston 95974358ab [api] Add max_data_length and force to DeviceInfoResponse/HelloResponse proto fields
Add max_data_length + force proto options to string fields in
HelloResponse, AreaInfo, DeviceInfo, and DeviceInfoResponse where
we have strong compile-time or codegen guarantees on max length.

This enables encode_short_string_force() (direct byte writes,
no varint branching) for fields with single-byte tags, and
fixed-formula size calculations for all annotated fields.

Add static_asserts to cross-validate C++ constexpr constants
(MAC_ADDRESS_PRETTY_BUFFER_SIZE, BUILD_TIME_STR_SIZE,
ESPHOME_VERSION, ESPHOME_MANUFACTURER) against the proto
max_data_length annotations.
2026-04-06 18:03:26 -10:00
Jonathan Swoboda e49384cd57 [dfrobot_sen0395] Fix list.index() on mutated list in range validator (#15511) 2026-04-06 23:42:39 -04:00
J. Nick Koston 14a48ec6ac Merge remote-tracking branch 'upstream/dev' into integration 2026-04-06 17:33:57 -10:00
J. Nick Koston 10b38e1588 [api] Add max_data_length proto option and optimize entity name/object_id (#15426) 2026-04-07 03:31:01 +00:00
J. Nick Koston e485011740 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-06 17:29:12 -10:00
Jonathan Swoboda b6ef1a58fb [multiple] Fix validation ranges and error messages (#15508) 2026-04-06 23:17:35 -04:00
Jonathan Swoboda 9894bdc0f1 [multiple] Fix misc low-priority bugs (batch 3) (#15506) 2026-04-06 23:03:57 -04:00
J. Nick Koston 3f0b13deb3 Merge remote-tracking branch 'upstream/api-proto-max-length' into integration 2026-04-06 16:34:27 -10:00
J. Nick Koston 4461184afc Merge branch 'dev' into api-proto-max-length 2026-04-06 16:26:01 -10:00
J. Nick Koston 3c55828d81 Merge remote-tracking branch 'origin/controller-registry-inline-notify' into integration 2026-04-06 16:23:19 -10:00
J. Nick Koston e3e191b783 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-06 16:23:07 -10:00
J. Nick Koston 5906421ab1 Merge branch 'dev' into controller-registry-inline-notify 2026-04-06 16:18:46 -10:00
Jonathan Swoboda 99ee405f4e [esp32_ble][esp32_ble_server][esp32_ble_beacon] Fix UUID regex, IndexError, and unused inheritance (#15504) 2026-04-06 22:17:34 -04:00
Jonathan Swoboda 517d0390d0 [ota] Fix check_error skipping validation for RESPONSE_OK (#15501) 2026-04-06 22:17:25 -04:00
J. Nick Koston ef29b18e18 [core] Move ControllerRegistry notify methods inline into header
Move the notify_*_update() method definitions from controller_registry.cpp
into controller_registry.h as inline functions. These are tiny loops over
1-2 controllers that each have a single call site in the entity's
notify_frontend_() method.

When defined in a separate TU, the compiler cannot inline them at the call
site without LTO, resulting in an unnecessary function-call frame on every
state publish. CodSpeed profiling of the CallbackManager container change
(#15272) showed this extra frame accounting for ~12% regression in text
sensor publish benchmarks.

controller_registry.h is only ever included from .cpp files (never from
other headers), so including controller.h after the class definition is
safe and introduces no circular dependencies.
2026-04-06 16:09:32 -10:00
J. Nick Koston 96c3986481 [core] Replace std::vector in CallbackManager with trivial-copy container (#15272) 2026-04-07 01:58:17 +00:00
Jonathan Swoboda e62c78ad46 [multiple] Fix misc cosmetic bugs (error messages, types, defaults) (#15499) 2026-04-07 01:41:57 +00:00
Jonathan Swoboda e428cb5092 [multiple] Fix misc cosmetic bugs (batch 2) (#15502) 2026-04-06 21:33:22 -04:00
Jonathan Swoboda b8b8d1bb15 [core] Replace deprecated datetime.utcfromtimestamp() (#15503) 2026-04-06 21:31:57 -04:00
J. Nick Koston 82dc80a413 [scheduler] Skip cancel for anonymous items, add empty-container fast path (#15397) 2026-04-07 01:26:40 +00:00
J. Nick Koston c1f8bdedc2 Merge remote-tracking branch 'upstream/dev' into api-proto-max-length
# Conflicts:
#	esphome/components/api/api_pb2.cpp
2026-04-06 14:48:45 -10:00
J. Nick Koston d15fa84f4f [api] Auto-derive max_value for enum fields in protobuf codegen (#15469) 2026-04-06 14:39:55 -10:00
Jonathan Swoboda 4fa3e48d33 [remote_base] Fix misc protocol schema and codegen bugs (#15497) 2026-04-07 00:34:07 +00:00
Jonathan Swoboda 094e0440c6 [config] Fix unfilled placeholder in dimensions() error message (#15498) 2026-04-06 14:30:36 -10:00
J. Nick Koston b155c13117 [api] Use integer comparison for float zero checks in protobuf encoding (#15490) 2026-04-07 12:25:53 +12:00
Jonathan Swoboda 0816579fa9 [prometheus] Fix relabel validation not checking for required keys (#15496) 2026-04-06 14:20:46 -10:00
Jonathan Swoboda c6e683cc33 [pmsx003] Connect model-specific sensor validation to schema (#15495) 2026-04-06 14:19:53 -10:00
Jonathan Swoboda 14bcd9db59 [neopixelbus] Fix SPI pin validation accepting one wrong pin on ESP8266 (#15494) 2026-04-06 14:18:59 -10:00
Jonathan Swoboda d9da91efbe [bl0940] Fix restore_value reading from wrong config dict (#15492) 2026-04-06 14:14:17 -10:00
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