ESPHome
2026.3.0-dev
Loading...
Searching...
No Matches
esphome
components
restart
button
restart_button.cpp
Go to the documentation of this file.
1
#include "
restart_button.h
"
2
#include "
esphome/core/application.h
"
3
#include "
esphome/core/hal.h
"
4
#include "
esphome/core/log.h
"
5
6
namespace
esphome
{
7
namespace
restart {
8
9
static
const
char
*
const
TAG =
"restart.button"
;
10
11
void
RestartButton::press_action
() {
12
ESP_LOGI(TAG,
"Restarting device"
);
13
// Let MQTT settle a bit
14
delay
(100);
// NOLINT
15
App
.
safe_reboot
();
16
}
17
void
RestartButton::dump_config
() { LOG_BUTTON(
""
,
"Restart Button"
,
this
); }
18
19
}
// namespace restart
20
}
// namespace esphome
application.h
esphome::Application::safe_reboot
void safe_reboot()
Definition
application.cpp:273
esphome::restart::RestartButton::dump_config
void dump_config() override
Definition
restart_button.cpp:17
esphome::restart::RestartButton::press_action
void press_action() override
Definition
restart_button.cpp:11
hal.h
log.h
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
esphome::delay
void HOT delay(uint32_t ms)
Definition
core.cpp:27
esphome::App
Application App
Global storage of Application pointer - only one Application can exist.
restart_button.h
Generated by
1.12.0