ESPHome  2022.12.8
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.
Definition: a4988.cpp:4
void IRAM_ATTR HOT delay(uint32_t ms)
Definition: core.cpp:27