ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
deep_sleep_esp8266.cpp
Go to the documentation of this file.
1#ifdef USE_ESP8266
3
4#include <Esp.h>
5
6namespace esphome::deep_sleep {
7
8static const char *const TAG = "deep_sleep";
9
10optional<uint32_t> DeepSleepComponent::get_run_duration_() const { return this->run_duration_; }
11
13
14bool DeepSleepComponent::prepare_to_sleep_() { return true; }
15
17 ESP.deepSleep(this->sleep_duration_.value_or(0)); // NOLINT(readability-static-accessed-through-instance)
18}
19
20bool DeepSleepComponent::should_teardown_() { return true; }
21
22} // namespace esphome::deep_sleep
23#endif
optional< uint32_t > get_run_duration_() const