ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1
2#pragma once
5
7
12 void operator()(AlarmControlPanelState /*state*/) const { this->automation->trigger(); }
13};
14
17template<AlarmControlPanelState State> struct StateEnterForwarder {
20 if (state == State)
21 this->automation->trigger();
22 }
23};
24
25static_assert(sizeof(StateAnyForwarder) <= sizeof(void *));
26static_assert(std::is_trivially_copyable_v<StateAnyForwarder>);
27static_assert(sizeof(StateEnterForwarder<ACP_STATE_TRIGGERED>) <= sizeof(void *));
28static_assert(std::is_trivially_copyable_v<StateEnterForwarder<ACP_STATE_TRIGGERED>>);
29
30} // namespace esphome::alarm_control_panel
void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE
Definition automation.h:745
bool state
Definition fan.h:2
Callback forwarder that triggers an Automation<> on any state change.
Definition automation.h:10
void operator()(AlarmControlPanelState) const
Definition automation.h:12
Callback forwarder that triggers an Automation<> only when the alarm enters a specific state.
Definition automation.h:17
void operator()(AlarmControlPanelState state) const
Definition automation.h:19