ESPHome 2025.5.0
Loading...
Searching...
No Matches
safe_mode_button.cpp
Go to the documentation of this file.
1#include "safe_mode_button.h"
2#include "esphome/core/hal.h"
3#include "esphome/core/log.h"
5
6namespace esphome {
7namespace safe_mode {
8
9static const char *const TAG = "safe_mode.button";
10
12 this->safe_mode_component_ = safe_mode_component;
13}
14
16 ESP_LOGI(TAG, "Restarting device in safe mode...");
18
19 // Let MQTT settle a bit
20 delay(100); // NOLINT
22}
23
24void SafeModeButton::dump_config() { LOG_BUTTON("", "Safe Mode Button", this); }
25
26} // namespace safe_mode
27} // namespace esphome
void set_safe_mode(SafeModeComponent *safe_mode_component)
SafeModeComponent provides a safe way to recover from repeated boot failures.
Definition safe_mode.h:12
void set_safe_mode_pending(const bool &pending)
Set to true if the next startup will enter safe mode.
Definition safe_mode.cpp:47
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
void IRAM_ATTR HOT delay(uint32_t ms)
Definition core.cpp:28
Application App
Global storage of Application pointer - only one Application can exist.