ESPHome
2026.5.1
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::restart
{
7
8
static
const
char
*
const
TAG =
"restart.button"
;
9
10
void
RestartButton::press_action
() {
11
ESP_LOGI(TAG,
"Restarting device"
);
12
// Let MQTT settle a bit
13
delay
(100);
// NOLINT
14
App
.
safe_reboot
();
15
}
16
void
RestartButton::dump_config
() { LOG_BUTTON(
""
,
"Restart Button"
,
this
); }
17
18
}
// namespace esphome::restart
application.h
esphome::Application::safe_reboot
void safe_reboot()
Definition
application.cpp:270
esphome::restart::RestartButton::dump_config
void dump_config() override
Definition
restart_button.cpp:16
esphome::restart::RestartButton::press_action
void press_action() override
Definition
restart_button.cpp:10
hal.h
log.h
esphome::restart
Definition
restart_button.cpp:6
esphome::delay
void HOT delay(uint32_t ms)
Definition
hal.cpp:85
esphome::App
Application App
Global storage of Application pointer - only one Application can exist.
restart_button.h
Generated by
1.12.0