Remove direct include of build_info_data.h from version_text_sensor.cpp
and use the existing App.get_build_time_string() API instead. This
eliminates duplicate ESPHOME_BUILD_TIME_STR and ESPHOME_COMMENT_STR
symbols that were emitted into every translation unit including the
header (static const in a header = one copy per TU).
Now only application.cpp includes build_info_data.h, which also
improves incremental rebuild times: when build info changes, only
application.cpp needs recompiling instead of both application.cpp
and version_text_sensor.cpp.
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.
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.
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.
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.
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.
- 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