Commit Graph
25602 Commits
Author SHA1 Message Date
J. Nick Koston 5be49b947a Merge remote-tracking branch 'origin/text-sensor-guard-raw-callback' into integration 2026-03-22 18:47:25 -10:00
J. Nick Koston 39782ff3f7 Merge branch 'dev' into text-sensor-guard-raw-callback 2026-03-22 18:47:09 -10:00
J. Nick Koston 801b16f3fd Merge remote-tracking branch 'upstream/dev' into integration 2026-03-22 18:46:46 -10:00
J. Nick Koston 936764b89a [text_sensor] Clarify compile-time vs runtime in raw_callback comment 2026-03-22 18:33:58 -10:00
J. Nick Koston baf365404c [network] Inline get_use_address() to eliminate function call overhead (#14942) 2026-03-23 04:18:43 +00:00
J. Nick Koston 1458b03d7f Merge branch 'dev' into text-sensor-guard-raw-callback 2026-03-22 18:03:12 -10:00
J. Nick Koston efcb660691 [text_sensor] Guard raw_callback_ behind USE_TEXT_SENSOR_FILTER
Same pattern as sensor: raw_callback_ is only needed when filters are
configured. add_on_raw_state_callback remains always available —
without filters it delegates to callback_ since raw == filtered.

Saves 4 bytes per TextSensor instance on builds without filters.
2026-03-22 17:48:12 -10:00
J. Nick Koston 0de2c758aa [scheduler] Use placement-new for std::function move in set_timer_common_ (#14757) 2026-03-23 16:31:27 +13:00
J. Nick Koston 597bb18543 [benchmark] Add binary sensor publish and sensor filter benchmarks (#15035) 2026-03-23 16:30:57 +13:00
Jesse Hills ebdf20adc0 Merge branch 'release' into dev 2026-03-23 16:10:17 +13:00
Jesse Hills 7ecdf6db2e Merge pull request #15084 from esphome/bump-2026.3.1
2026.3.1
2026.3.1
2026-03-23 16:09:32 +13:00
J. Nick Koston 8a3b5a8def [core] Fix placement new storage name for templated types (#15096) 2026-03-23 16:09:23 +13:00
J. Nick Koston 98d9fd76b3 [mqtt] Fix const-correctness for trigger constructors (#15093) 2026-03-22 16:27:20 -10:00
J. Nick Koston 6992219e34 [core] Attribute placement new storage symbols to components (#15092) 2026-03-22 16:27:07 -10:00
J. Nick Koston 5a44d4f14d Merge branch 'binary-sensor-remove-optional-state' into integration 2026-03-22 16:18:17 -10:00
J. Nick Koston 5854fa1d82 [binary_sensor] Access flags_ directly in set_new_state to reduce flash 2026-03-22 16:17:35 -10:00
J. Nick Koston e28c9d191c [binary_sensor] Move send_state_internal to header for devirtualization 2026-03-22 16:16:59 -10:00
J. Nick Koston 2833401cc1 [binary_sensor] Simplify else-if in set_new_state 2026-03-22 16:15:24 -10:00
J. Nick Koston 1e2c5fbc4e [binary_sensor] Update state before firing callbacks in set_new_state
Move set_has_state and set_state_value_ before callback invocations
so callback code can inspect the entity's current state via
get_state()/has_state(). The old state is passed as a parameter.

Addresses Copilot review feedback.
2026-03-22 16:13:35 -10:00
J. Nick Koston db3cfaa3fc [binary_sensor] Reduce flash: un-inline send_state_internal, optimize set_new_state
Move send_state_internal back to .cpp to avoid duplicating it at each
call site (publish_state and Filter::output).

Optimize set_new_state to compare has_state + value directly instead
of constructing optional<T> on stack for the comparison. Optionals
are only constructed in the changed path for callbacks that need them.
2026-03-22 16:11:06 -10:00
J. Nick Koston fc1186895c [binary_sensor] Fix stale comment in StatefulEntityBase docs 2026-03-22 16:03:44 -10:00
J. Nick Koston 047a744ed3 [binary_sensor] Inline send_state_internal into header 2026-03-22 16:02:51 -10:00
J. Nick Koston e406fb25cb [binary_sensor] Move trigger_on_initial_state out of EntityBase flags into BinarySensor
Use pure virtual get/set methods on StatefulEntityBase instead of
storing the flag in EntityBase::flags_. This keeps EntityBase clean
and avoids mixing binary_sensor-specific state into the base entity.
2026-03-22 16:01:39 -10:00
J. Nick Koston 98b0aea6bf [binary_sensor] Restore comment on state member 2026-03-22 16:00:07 -10:00
J. Nick Koston 7754e517f2 [binary_sensor] Add documentation comments to StatefulEntityBase 2026-03-22 15:59:33 -10:00
J. Nick Koston 91944988ef [binary_sensor] Remove redundant optional<bool> state_ from StatefulEntityBase
Replace optional<T> state_ in StatefulEntityBase with pure virtual
get_state()/set_state_value_() that subclasses implement. BinarySensor
stores its value in the existing public bool state member and uses
EntityBase::flags_.has_state instead of the optional's discriminant.

Move trigger_on_initial_state_ into EntityBase::flags_ (1 bit from
reserved), eliminating the standalone bool and its padding.

Saves 8 bytes per BinarySensor instance:
- optional<bool> (2B) + padding (2B) = 4B removed
- bool trigger_on_initial_state_ (1B) + padding (3B) = 4B removed
2026-03-22 15:58:31 -10:00
J. Nick Koston fbe3e7d99c [api] Emit raw tag+value writes for forced fixed32 key fields (#15051) 2026-03-22 15:28:46 -10:00
J. Nick Koston 73c8ac0acc Merge branch 'analyze-memory-pstorage-attribution' into integration 2026-03-22 15:20:09 -10:00
J. Nick Koston 6393190957 Handle esphome:: prefix in type namespace and format top symbols 2026-03-22 15:19:47 -10:00
J. Nick Koston 9cdc17566a [combination] Use FixedVector and parent pointer to enable inline Callback storage (#14947) 2026-03-22 15:06:45 -10:00
J. Nick Koston 20420d0016 Merge remote-tracking branch 'upstream/analyze-memory-pstorage-attribution' into integration 2026-03-22 15:05:20 -10:00
J. Nick Koston 8aeb3c5212 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-22 15:05:18 -10:00
J. Nick Koston 2d10f8abd3 [analyze-memory] Attribute placement new storage symbols to components
Embed component namespace in storage variable names so analyze-memory
can reliably attribute them. Display as "storage for {id}" in reports
and always show regardless of size threshold.
2026-03-22 15:03:36 -10:00
cd05462e9f [core] Use placement new allocation for Pvariables (#15079)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-22 14:42:04 -10:00
J. Nick KostonandClaude Opus 4.6 83d02c602a [logger] Fix dummy_main.cpp Logger constructor for clang-tidy (#15088)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:25:04 +13:00
J. Nick Koston d60ab8e20f Merge branch 'kamilcuk/use-placement-new' into integration 2026-03-22 14:19:43 -10:00
J. Nick Koston 5b1b285220 Merge branch 'kamilcuk/use-placement-new' of https://github.com/Kamilcuk/esphome into kamilcuk/use-placement-new 2026-03-22 14:19:29 -10:00
J. Nick Koston 2d47c31fbf nits 2026-03-22 14:19:22 -10:00
J. Nick Koston e564114787 Merge branch 'dev' into kamilcuk/use-placement-new 2026-03-22 14:06:12 -10:00
J. Nick KostonandClaude Opus 4.6 e85065b1c4 [logger] Fix dummy_main.cpp Logger constructor for clang-tidy (#15088)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:06:00 -10:00
J. Nick Koston 76cd51beb9 Merge remote-tracking branch 'upstream/fix-dummy-main-logger-constructor' into integration 2026-03-22 14:02:18 -10:00
J. Nick Koston ad439ea3f9 Merge branch 'kamilcuk/use-placement-new' into integration 2026-03-22 14:02:07 -10:00
J. Nick Koston 58b6d7a0df revert fix -- moved to another pr 2026-03-22 14:01:48 -10:00
J. Nick Koston 1dde810db8 revert fix -- moved to another pr 2026-03-22 14:01:32 -10:00
J. Nick Koston 280ea52002 Merge branch 'kamilcuk/use-placement-new' into integration 2026-03-22 13:58:24 -10:00
J. Nick Koston 42e1d93398 cleanup 2026-03-22 13:57:08 -10:00
J. Nick Koston 3eb0f1affd Merge branch 'kamilcuk/use-placement-new' of https://github.com/Kamilcuk/esphome into kamilcuk/use-placement-new 2026-03-22 13:54:09 -10:00
J. Nick Koston 8b89f5e036 avoid template overhead 2026-03-22 13:54:00 -10:00
J. Nick Koston 7bd4cde012 Merge branch 'dev' into kamilcuk/use-placement-new 2026-03-22 13:47:53 -10:00
J. Nick KostonandClaude Opus 4.6 67add9b9b6 [logger] Fix dummy_main.cpp Logger constructor for clang-tidy
The Logger constructor requires a task_log_buffer_size argument when
USE_ESPHOME_TASK_LOG_BUFFER is defined, which is the case in defines.h
used by clang-tidy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:44:39 -10:00