9static const uint32_t TEARDOWN_TIMEOUT_DEEP_SLEEP_MS = 5000;
22 if (run_duration.has_value()) {
23 ESP_LOGI(TAG,
"Scheduling in %" PRIu32
" ms", *run_duration);
26 ESP_LOGD(TAG,
"Not scheduling; no run duration configured");
31 ESP_LOGCONFIG(TAG,
"Deep sleep:");
34 ESP_LOGCONFIG(TAG,
" Sleep Duration: %" PRIu32
" ms",
duration);
37 ESP_LOGCONFIG(TAG,
" Run Duration: %" PRIu32
" ms", *this->
run_duration_);
57 ESP_LOGI(TAG,
"Beginning sleep");
void teardown_components(uint32_t timeout_ms)
Teardown all components with a timeout.
void run_safe_shutdown_hooks()
void run_powerdown_hooks()
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
void disable_loop()
Disable this component's loop.
void dump_config() override
optional< uint64_t > sleep_duration_
optional< uint32_t > get_run_duration_() const
bool next_enter_deep_sleep_
void begin_sleep(bool manual=false)
Helper to enter deep sleep mode.
optional< uint32_t > run_duration_
void dump_config_platform_()
float get_setup_priority() const override
ESPHOME_LOG_TAG(TAG, "deep_sleep")
bool global_has_deep_sleep
constexpr float LATE
For components that should be initialized at the very end of the setup process.
Application App
Global storage of Application pointer - only one Application can exist.