SafeModeComponent provides a safe way to recover from repeated boot failures.
More...
#include <safe_mode.h>
|
void | write_rtc_ (uint32_t val) |
|
uint32_t | read_rtc_ () |
|
virtual void | call_loop () |
|
virtual void | call_setup () |
|
virtual void | call_dump_config () |
|
void | set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a unique name. More...
|
|
void | set_interval (uint32_t interval, std::function< void()> &&f) |
|
bool | cancel_interval (const std::string &name) |
| Cancel an interval function. More...
|
|
void | set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
| Set an retry function with a unique name. More...
|
|
void | set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
|
bool | cancel_retry (const std::string &name) |
| Cancel a retry function. More...
|
|
void | set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a unique name. More...
|
|
void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
|
bool | cancel_timeout (const std::string &name) |
| Cancel a timeout function. More...
|
|
void | defer (const std::string &name, std::function< void()> &&f) |
| Defer a callback to the next loop() call. More...
|
|
void | defer (std::function< void()> &&f) |
| Defer a callback to the next loop() call. More...
|
|
bool | cancel_defer (const std::string &name) |
| Cancel a defer callback using the specified name, name must not be empty. More...
|
|
SafeModeComponent provides a safe way to recover from repeated boot failures.
Definition at line 12 of file safe_mode.h.
◆ add_on_safe_mode_callback()
void esphome::safe_mode::SafeModeComponent::add_on_safe_mode_callback |
( |
std::function< void()> && |
callback | ) |
|
|
inline |
◆ clean_rtc()
void esphome::safe_mode::SafeModeComponent::clean_rtc |
( |
| ) |
|
◆ dump_config()
void esphome::safe_mode::SafeModeComponent::dump_config |
( |
| ) |
|
|
overridevirtual |
◆ get_safe_mode_pending()
bool esphome::safe_mode::SafeModeComponent::get_safe_mode_pending |
( |
| ) |
|
◆ get_setup_priority()
float esphome::safe_mode::SafeModeComponent::get_setup_priority |
( |
| ) |
const |
|
overridevirtual |
◆ loop()
void esphome::safe_mode::SafeModeComponent::loop |
( |
| ) |
|
|
overridevirtual |
◆ on_safe_shutdown()
void esphome::safe_mode::SafeModeComponent::on_safe_shutdown |
( |
| ) |
|
|
overridevirtual |
◆ read_rtc_()
uint32_t esphome::safe_mode::SafeModeComponent::read_rtc_ |
( |
| ) |
|
|
protected |
◆ set_safe_mode_pending()
void esphome::safe_mode::SafeModeComponent::set_safe_mode_pending |
( |
const bool & |
pending | ) |
|
Set to true if the next startup will enter safe mode.
Definition at line 47 of file safe_mode.cpp.
◆ should_enter_safe_mode()
bool esphome::safe_mode::SafeModeComponent::should_enter_safe_mode |
( |
uint8_t |
num_attempts, |
|
|
uint32_t |
enable_time, |
|
|
uint32_t |
boot_is_good_after |
|
) |
| |
◆ write_rtc_()
void esphome::safe_mode::SafeModeComponent::write_rtc_ |
( |
uint32_t |
val | ) |
|
|
protected |
◆ boot_successful_
bool esphome::safe_mode::SafeModeComponent::boot_successful_ {false} |
|
protected |
set to true after boot is considered successful
Definition at line 36 of file safe_mode.h.
◆ ENTER_SAFE_MODE_MAGIC
const uint32_t esphome::safe_mode::SafeModeComponent::ENTER_SAFE_MODE_MAGIC |
|
staticprotected |
Initial value:
a magic number to indicate that safe mode should be entered on next boot
Definition at line 45 of file safe_mode.h.
◆ rtc_
◆ safe_mode_boot_is_good_after_
uint32_t esphome::safe_mode::SafeModeComponent::safe_mode_boot_is_good_after_ {60000} |
|
protected |
The amount of time after which the boot is considered successful.
Definition at line 37 of file safe_mode.h.
◆ safe_mode_callback_
CallbackManager<void()> esphome::safe_mode::SafeModeComponent::safe_mode_callback_ {} |
|
protected |
◆ safe_mode_enable_time_
uint32_t esphome::safe_mode::SafeModeComponent::safe_mode_enable_time_ {60000} |
|
protected |
The time safe mode should remain active for.
Definition at line 38 of file safe_mode.h.
◆ safe_mode_num_attempts_
uint8_t esphome::safe_mode::SafeModeComponent::safe_mode_num_attempts_ {0} |
|
protected |
◆ safe_mode_rtc_value_
uint32_t esphome::safe_mode::SafeModeComponent::safe_mode_rtc_value_ {0} |
|
protected |
◆ safe_mode_start_time_
uint32_t esphome::safe_mode::SafeModeComponent::safe_mode_start_time_ {0} |
|
protected |
stores when safe mode was enabled
Definition at line 40 of file safe_mode.h.
The documentation for this class was generated from the following files:
- /opt/build/esphome/esphome/components/safe_mode/safe_mode.h
- /opt/build/esphome/esphome/components/safe_mode/safe_mode.cpp