ESPHome  2024.11.0
restart_button.cpp
Go to the documentation of this file.
1 #include "restart_button.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 
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 App
Global storage of Application pointer - only one Application can exist.
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void IRAM_ATTR HOT delay(uint32_t ms)
Definition: core.cpp:26