ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
factory_reset_button.cpp
Go to the documentation of this file.
2
4
5#ifdef USE_OPENTHREAD
7#endif
9#include "esphome/core/hal.h"
10#include "esphome/core/log.h"
11
13
14ESPHOME_LOG_TAG(TAG, "factory_reset.button");
15
16static void reset_and_reboot() {
19}
20
22 ESP_LOGI(TAG, "Resetting");
23 // Let MQTT settle a bit
24 delay(100); // NOLINT
25#ifdef USE_OPENTHREAD
26 openthread::global_openthread_component->on_factory_reset(reset_and_reboot);
27#else
28 reset_and_reboot();
29#endif
30}
31
32} // namespace esphome::factory_reset
void factory_reset_device()
Run by the factory reset button.
ESPHOME_LOG_TAG(TAG, "factory_reset.button")
OpenThreadComponent * global_openthread_component
ESPPreferences * global_preferences
void HOT delay(uint32_t ms)
Definition hal.cpp:85
Application App
Global storage of Application pointer - only one Application can exist.
bool reset()
Forget all unsaved changes and re-initialize the permanent preferences storage.
Definition preferences.h:41