ESPHome
2026.6.0-dev
Loading...
Searching...
No Matches
esphome
components
ethernet
automation.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/defines.h
"
4
#ifdef USE_ETHERNET
5
#include "
ethernet_component.h
"
6
7
namespace
esphome::ethernet
{
8
9
template
<
typename
... Ts>
class
EthernetConnectedCondition
:
public
Condition
<Ts...> {
10
public
:
11
bool
check
(
const
Ts &...
x
)
override
{
return
global_eth_component
->
is_connected
(); }
12
};
13
14
template
<
typename
... Ts>
class
EthernetEnabledCondition
:
public
Condition
<Ts...> {
15
public
:
16
bool
check
(
const
Ts &...
x
)
override
{
return
global_eth_component
->
is_enabled
(); }
17
};
18
19
template
<
typename
... Ts>
class
EthernetEnableAction
:
public
Action
<Ts...> {
20
public
:
21
void
play
(
const
Ts &...
x
)
override
{
global_eth_component
->
enable
(); }
22
};
23
24
template
<
typename
... Ts>
class
EthernetDisableAction
:
public
Action
<Ts...> {
25
public
:
26
void
play
(
const
Ts &...
x
)
override
{
global_eth_component
->
disable
(); }
27
};
28
29
}
// namespace esphome::ethernet
30
#endif
esphome::Action
Definition
automation.h:487
esphome::Condition
Base class for all automation conditions.
Definition
automation.h:438
esphome::ethernet::EthernetComponent::enable
void enable()
Definition
ethernet_component_esp32.cpp:395
esphome::ethernet::EthernetComponent::disable
void disable()
Definition
ethernet_component_esp32.cpp:416
esphome::ethernet::EthernetComponent::is_connected
bool is_connected()
Definition
ethernet_component.h:125
esphome::ethernet::EthernetComponent::is_enabled
bool is_enabled()
Definition
ethernet_component.h:136
esphome::ethernet::EthernetConnectedCondition
Definition
automation.h:9
esphome::ethernet::EthernetConnectedCondition::check
bool check(const Ts &...x) override
Definition
automation.h:11
esphome::ethernet::EthernetDisableAction
Definition
automation.h:24
esphome::ethernet::EthernetDisableAction::play
void play(const Ts &...x) override
Definition
automation.h:26
esphome::ethernet::EthernetEnableAction
Definition
automation.h:19
esphome::ethernet::EthernetEnableAction::play
void play(const Ts &...x) override
Definition
automation.h:21
esphome::ethernet::EthernetEnabledCondition
Definition
automation.h:14
esphome::ethernet::EthernetEnabledCondition::check
bool check(const Ts &...x) override
Definition
automation.h:16
defines.h
ethernet_component.h
esphome::ethernet
Definition
automation.h:7
esphome::ethernet::global_eth_component
EthernetComponent * global_eth_component
Definition
ethernet_component.cpp:9
x
uint16_t x
Definition
tt21100.cpp:5
Generated by
1.12.0