ESPHome
2026.11.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::restart
{
7
8
ESPHOME_LOG_TAG
(TAG,
"restart.button"
);
9
10
void
restart_device
() {
11
ESP_LOGI(TAG,
"Restarting device"
);
12
// Let MQTT settle a bit
13
delay
(100);
// NOLINT
14
App
.
safe_reboot
();
15
}
16
17
}
// namespace esphome::restart
application.h
esphome::Application::safe_reboot
void safe_reboot()
Definition
application.cpp:299
hal.h
log.h
esphome::restart
Definition
restart_button.cpp:6
esphome::restart::ESPHOME_LOG_TAG
ESPHOME_LOG_TAG(TAG, "restart.button")
esphome::restart::restart_device
void restart_device()
Run by the restart button.
Definition
restart_button.cpp:10
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