ESPHome
2026.11.0-dev
Loading...
Searching...
No Matches
esphome
components
restart
switch
restart_switch.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/switch/switch.h
"
5
6
namespace
esphome::restart
{
7
8
class
RestartSwitch
final :
public
switch_::Switch
,
public
Component
{
9
public
:
10
// User provided, not "= default": `new(p) RestartSwitch()` would zero-fill .bss that is already zero.
11
RestartSwitch
() {}
12
13
void
dump_config
()
override
;
14
15
protected
:
16
void
write_state
(
bool
state
)
override
;
17
};
18
19
}
// namespace esphome::restart
esphome::Component
Definition
component.h:147
esphome::restart::RestartSwitch
Definition
restart_switch.h:8
esphome::restart::RestartSwitch::write_state
void write_state(bool state) override
Definition
restart_switch.cpp:10
esphome::restart::RestartSwitch::RestartSwitch
RestartSwitch()
Definition
restart_switch.h:11
esphome::restart::RestartSwitch::dump_config
void dump_config() override
Definition
restart_switch.cpp:21
esphome::switch_::Switch
Base class for all switches.
Definition
switch.h:43
esphome::switch_::Switch::state
bool state
The current reported state of the binary sensor.
Definition
switch.h:60
component.h
esphome::restart
Definition
restart_button.cpp:6
switch.h
Generated by
1.12.0