ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
3#include <type_traits>
4
6#include "pd.h"
7
9
13 void operator()(PdState state, PdState previous) const {
15 this->automation->trigger();
16 }
17};
18
22 void operator()(PdState state, PdState previous) const {
24 this->automation->trigger();
25 }
26};
27
36
40 void operator()(PdState state, PdState previous) const {
42 this->automation->trigger();
43 }
44};
45
46static_assert(sizeof(ConnectForwarder) <= sizeof(void *));
47static_assert(std::is_trivially_copyable_v<ConnectForwarder>);
48static_assert(sizeof(DisconnectForwarder) <= sizeof(void *));
49static_assert(std::is_trivially_copyable_v<DisconnectForwarder>);
50static_assert(sizeof(PowerReadyForwarder) <= sizeof(void *));
51static_assert(std::is_trivially_copyable_v<PowerReadyForwarder>);
52static_assert(sizeof(ErrorForwarder) <= sizeof(void *));
53static_assert(std::is_trivially_copyable_v<ErrorForwarder>);
54
55} // namespace esphome::fusb302b
void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE
Definition automation.h:722
bool state
Definition fan.h:2
@ PD_STATE_PD_TIMEOUT
Negotiation is over without a PD contract (no capabilities, or the request was not accepted); the sou...
bool is_connected_state(PdState state)
Returns true for the states in which a source is attached and supplying power.
Definition pd.h:59
Triggers when a source is attached, including after recovering from a communication error.
Definition automation.h:11
void operator()(PdState state, PdState previous) const
Definition automation.h:13
Triggers when the source is removed, or is no longer known to be attached because communication faile...
Definition automation.h:20
void operator()(PdState state, PdState previous) const
Definition automation.h:22
Triggers when communication with the chip fails.
Definition automation.h:38
void operator()(PdState state, PdState previous) const
Definition automation.h:40
Triggers when negotiation is finished: a new PD contract is in place, or the source does not speak PD...
Definition automation.h:29
void operator()(PdState state, PdState) const
Definition automation.h:31