1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

Allow specifying deep sleep wakup clock time (#3312)

This commit is contained in:
Jesse Hills
2022-04-13 12:55:26 +12:00
committed by GitHub
parent b622a8fa58
commit 8be704e591
5 changed files with 118 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
#include "deep_sleep_component.h"
#include "esphome/core/log.h"
#include <cinttypes>
#include "esphome/core/application.h"
#include "esphome/core/log.h"
#ifdef USE_ESP8266
#include <Esp.h>
@@ -101,6 +102,8 @@ void DeepSleepComponent::begin_sleep(bool manual) {
#endif
ESP_LOGI(TAG, "Beginning Deep Sleep");
if (this->sleep_duration_.has_value())
ESP_LOGI(TAG, "Sleeping for %" PRId64 "us", *this->sleep_duration_);
App.run_safe_shutdown_hooks();