ESPHome  2024.12.2
factory_reset_button.cpp
Go to the documentation of this file.
1 #include "factory_reset_button.h"
2 #include "esphome/core/hal.h"
3 #include "esphome/core/log.h"
5 
6 namespace esphome {
7 namespace factory_reset {
8 
9 static const char *const TAG = "factory_reset.button";
10 
11 void FactoryResetButton::dump_config() { LOG_BUTTON("", "Factory Reset Button", this); }
13  ESP_LOGI(TAG, "Resetting to factory defaults...");
14  // Let MQTT settle a bit
15  delay(100); // NOLINT
17  App.safe_reboot();
18 }
19 
20 } // namespace factory_reset
21 } // namespace esphome
ESPPreferences * global_preferences
virtual bool reset()=0
Forget all unsaved changes and re-initialize the permanent preferences storage.
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