diff --git a/esphome/core/automation.h b/esphome/core/automation.h index 954565aca0..ca4a2c8b6b 100644 --- a/esphome/core/automation.h +++ b/esphome/core/automation.h @@ -324,7 +324,7 @@ template class Trigger { /// Inform the parent automation that the event has triggered. // Force-inline: collapses the Trigger→Automation→ActionList forwarding // chain into a single frame, reducing automation call stack depth. - __attribute__((always_inline)) void trigger(const Ts &...x) { + inline void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE { if (this->automation_parent_ == nullptr) return; this->automation_parent_->trigger(x...); @@ -433,7 +433,7 @@ template class ActionList { } // Force-inline: part of the Trigger→Automation→ActionList forwarding // chain collapsed to reduce automation call stack depth. - __attribute__((always_inline)) void play(const Ts &...x) { + inline void play(const Ts &...x) ESPHOME_ALWAYS_INLINE { if (this->actions_begin_ != nullptr) this->actions_begin_->play_complex(x...); } @@ -479,7 +479,7 @@ template class Automation { // Force-inline: part of the Trigger→Automation→ActionList forwarding // chain collapsed to reduce automation call stack depth. - __attribute__((always_inline)) void trigger(const Ts &...x) { this->actions_.play(x...); } + inline void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE { this->actions_.play(x...); } bool is_running() { return this->actions_.is_running(); }