Commit Graph
26080 Commits
Author SHA1 Message Date
J. Nick Koston f97f8d1cef Optimize add_actions() to find tail once instead of re-walking per action 2026-03-28 10:34:18 -10:00
J. Nick Koston adf01fedc6 Merge remote-tracking branch 'upstream/actionlist-drop-end-pointer' into integration 2026-03-28 10:30:30 -10:00
J. Nick Koston 79d2d8e5c8 [automation] Remove actions_end_ pointer from ActionList
Save 4 bytes per ActionList instance by removing the tail pointer
used only during setup() for O(1) append. Instead, walk the short
chain (typically 1-5 actions) to find the tail.

This saves 4 bytes per Automation on 32-bit platforms, which adds
up on memory-constrained devices like ESP8266 with many automations.
2026-03-28 10:28:40 -10:00
J. Nick Koston f0d618a842 Merge branch 'automation_conditions_static_array' into integration 2026-03-28 09:17:02 -10:00
J. Nick Koston 669b90258c [automation] Use std::array in And/Or/Xor conditions
Template AndCondition, OrCondition, and XorCondition on N so the
condition pointer list is stored in std::array<Condition<Ts...>*, N>
instead of FixedVector. N is set by code generation to match the
exact number of conditions configured in YAML.

Add init_array_from() helper for optimal codegen when initializing
std::array from initializer_list.
2026-03-28 09:09:53 -10:00
J. Nick Koston 0c92082f1d Merge sensor_value_list_static_array into integration 2026-03-28 08:46:22 -10:00
J. Nick Koston e2cb0edb10 Preserve ThrottleFilter position in .cpp for cleaner diff 2026-03-28 08:43:35 -10:00
J. Nick Koston f2663928c7 Move ThrottleWithPriorityFilter::new_value to non-template helper preserving exact dev behavior 2026-03-28 08:41:13 -10:00
J. Nick Koston 8fc08ad52d Consolidate throttle helpers into single throttle_check_with_priority function 2026-03-28 08:40:07 -10:00
J. Nick Koston 369a5c5043 Fix: prioritized values must update last_input_ to match dev behavior 2026-03-28 08:39:23 -10:00
J. Nick Koston c722ef0369 [sensor] Use std::array in ValueList/FilterOut/ThrottleWithPriority filters
Template ValueListFilter, FilterOutValueFilter, and ThrottleWithPriorityFilter
on N (the number of configured values) so the value list is stored in
std::array<TemplatableValue<float>, N> instead of FixedVector.

Non-template helpers value_list_matches_any() and throttle_check_and_update()
keep the iteration loops in the .cpp to avoid template bloat.
2026-03-28 08:37:04 -10:00
J. Nick Koston 28af6d2ecb Merge remote-tracking branch 'upstream/sensor_value_list_static_array' into integration 2026-03-28 08:30:23 -10:00
J. Nick Koston db15bb2494 Merge remote-tracking branch 'upstream/callback-manager-no-vector' into integration 2026-03-28 08:27:47 -10:00
J. Nick Koston 901c297705 Add missing #include <cassert> for init_array_from debug assert 2026-03-27 22:15:19 -10:00
J. Nick Koston 3aa31ca65b Merge branch 'dev' into callback-manager-no-vector 2026-03-27 17:51:29 -10:00
J. Nick Koston b6301ac4a2 Merge branch 'dev' into sensor_value_list_static_array 2026-03-27 17:12:15 -10:00
J. Nick Koston b6dcbe9fd3 Merge remote-tracking branch 'upstream/sensor_value_list_static_array' into integration 2026-03-27 17:10:40 -10:00
J. Nick Koston a3ccb656b2 Replace forward-declared App with throttle_check_and_update helper
Forward declaration fails when filter.h is included before application.h
(incomplete type error). Instead, extract the throttle time check into a
non-template helper in filter.cpp that accesses App directly. This keeps
the same call overhead as the old ThrottleFilter (one function call) but
the helper does the time check AND updates last_input, so the template
new_value() body has no App dependency at all.
2026-03-27 17:09:44 -10:00
J. Nick Koston 2a80ba3e9e Merge remote-tracking branches 'upstream/sensor_or_filter_static_array', 'upstream/sensor_calibrate_linear_static_array', 'upstream/sensor_calibrate_polynomial_static_array', 'upstream/binary_sensor_autorepeat_static_array', 'upstream/binary_sensor_multiclick_static_array', 'upstream/text_sensor_substitute_static_array' and 'upstream/text_sensor_map_static_array' into sensor_value_list_static_array 2026-03-27 17:03:11 -10:00
J. Nick Koston 19e497cd61 Remove get_loop_component_start_time wrapper, use forward-declared App directly
The wrapper added a function call indirection on every filter invocation
that the compiler cannot inline without LTO. Forward-declaring Application
and App lets the template body call App.get_loop_component_start_time()
directly — the method is inline in application.h which is included by
main.cpp where the template is instantiated.
2026-03-27 16:58:49 -10:00
J. Nick Koston 5d67d16810 Merge remote-tracking branch 'origin/callback-manager-no-vector' into callback-manager-no-vector 2026-03-27 16:50:59 -10:00
J. Nick Koston d25a70b830 Merge remote-tracking branch 'upstream/dev' into callback-manager-no-vector 2026-03-27 16:50:46 -10:00
J. Nick Koston fa2b14ef41 Guard against nullptr+0 UB in call() and fix assert bound
- Add early return when size_==0 to avoid nullptr+0 pointer
  arithmetic (UB per C++ standard, even though all ESPHome
  targets treat it as no-op)
- Fix debug assert: size < UINT16_MAX allows capacity up to 65535
2026-03-27 16:47:56 -10:00
J. Nick Koston 967ded5477 Add ESPHOME_ALWAYS_INLINE to call() to stabilize inlining across struct layout changes 2026-03-27 16:40:59 -10:00
J. Nick Koston 711ba55756 Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue 2026-03-27 16:27:52 -10:00
J. Nick Koston 4cba679469 Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue 2026-03-27 16:27:50 -10:00
J. Nick Koston 327d0597af Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue 2026-03-27 16:27:48 -10:00
J. Nick Koston 5d7ae5b3ce Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue 2026-03-27 16:27:46 -10:00
J. Nick Koston 4eec3f5076 Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue 2026-03-27 16:27:44 -10:00
J. Nick Koston 1a9c1d4844 Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue 2026-03-27 16:27:42 -10:00
J. Nick Koston 1d8be72a44 Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue 2026-03-27 16:27:40 -10:00
J. Nick Koston fa6df8ea2a Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue 2026-03-27 16:27:38 -10:00
J. Nick Koston 3b01e65a2a Remove accidentally committed .gitignore 2026-03-27 16:24:35 -10:00
J. Nick Koston 42fe39cfd9 Use pointer iteration in call() to avoid uint16_t movzx overhead on x86-64 2026-03-27 16:24:23 -10:00
Jonathan Swoboda b6abfec82e [core] Fix area/device hash collision validation not running (#15259) 2026-03-27 22:22:24 -04:00
J. Nick Koston 41f9ed7fda Add braces to satisfy clang-tidy readability-braces-around-statements 2026-03-27 16:21:07 -10:00
J. Nick Koston a360e43ee8 Fix MapFilter: use init_array_from (missed in merge) 2026-03-27 16:18:21 -10:00
J. Nick Koston 1b52a2f2b9 Merge remote-tracking branch 'upstream/text_sensor_substitute_static_array' into integration 2026-03-27 16:16:59 -10:00
J. Nick Koston 674cdd8be4 Merge remote-tracking branch 'upstream/binary_sensor_multiclick_static_array' into integration 2026-03-27 16:16:59 -10:00
J. Nick Koston 507500171f Merge remote-tracking branch 'upstream/binary_sensor_autorepeat_static_array' into integration 2026-03-27 16:16:59 -10:00
J. Nick Koston b4537fbd55 Merge remote-tracking branch 'upstream/sensor_calibrate_polynomial_static_array' into integration 2026-03-27 16:16:58 -10:00
J. Nick Koston 74471296d5 Merge remote-tracking branch 'upstream/sensor_calibrate_linear_static_array' into integration 2026-03-27 16:16:58 -10:00
J. Nick Koston 3e97425dce Merge remote-tracking branch 'upstream/sensor_or_filter_static_array' into integration 2026-03-27 16:16:58 -10:00
J. Nick Koston 23cbee808a Merge remote-tracking branch 'upstream/sensor_value_list_static_array' into integration 2026-03-27 16:16:58 -10:00
J. Nick Koston 7f5409214b Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:59 -10:00
J. Nick Koston c4aed6f7e5 Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:57 -10:00
J. Nick Koston a20b0a96b9 Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:55 -10:00
J. Nick Koston 8b42629e3e Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:53 -10:00
J. Nick Koston ae2a82edd6 Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:51 -10:00
J. Nick Koston f8e144b23b Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:49 -10:00