From 536093acfa481b26fb4db245e7232cd9a5cdd12b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 20 Mar 2026 18:46:46 -1000 Subject: [PATCH] [core] Drop always_inline attributes to avoid flash bloat The always_inline on Trigger::trigger(), ActionList::play(), and Automation::trigger() duplicates code at every trigger call site, adding ~384 bytes of flash. Revert to compiler-managed inlining and keep only the play_complex overrides (phase 2). --- esphome/core/automation.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/core/automation.h b/esphome/core/automation.h index 4bc4bdf71e..7934fdbec9 100644 --- a/esphome/core/automation.h +++ b/esphome/core/automation.h @@ -322,7 +322,7 @@ template class Automation; template class Trigger { public: /// Inform the parent automation that the event has triggered. - __attribute__((always_inline)) void trigger(const Ts &...x) { + void trigger(const Ts &...x) { if (this->automation_parent_ == nullptr) return; this->automation_parent_->trigger(x...); @@ -429,7 +429,7 @@ template class ActionList { this->add_action(action); } } - __attribute__((always_inline)) void play(const Ts &...x) { + void play(const Ts &...x) { if (this->actions_begin_ != nullptr) this->actions_begin_->play_complex(x...); } @@ -473,7 +473,7 @@ template class Automation { void stop() { this->actions_.stop(); } - __attribute__((always_inline)) void trigger(const Ts &...x) { this->actions_.play(x...); } + void trigger(const Ts &...x) { this->actions_.play(x...); } bool is_running() { return this->actions_.is_running(); }