ESPHome
2022.12.8
esphome
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
restart_button.h
hal.h
esphome::restart::RestartButton::press_action
void press_action() override
Definition:
restart_button.cpp:11
esphome::restart::RestartButton::dump_config
void dump_config() override
Definition:
restart_button.cpp:17
esphome::App
Application App
Global storage of Application pointer - only one Application can exist.
Definition:
application.cpp:155
esphome
Definition:
a4988.cpp:4
log.h
esphome::delay
void IRAM_ATTR HOT delay(uint32_t ms)
Definition:
core.cpp:27
esphome::Application::safe_reboot
void safe_reboot()
Definition:
application.cpp:133
Generated by
1.8.13