mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Implement allow_deep_sleep (#3282)
This commit is contained in:
		| @@ -160,6 +160,7 @@ void DeepSleepComponent::begin_sleep(bool manual) { | |||||||
| } | } | ||||||
| float DeepSleepComponent::get_setup_priority() const { return setup_priority::LATE; } | float DeepSleepComponent::get_setup_priority() const { return setup_priority::LATE; } | ||||||
| void DeepSleepComponent::prevent_deep_sleep() { this->prevent_ = true; } | void DeepSleepComponent::prevent_deep_sleep() { this->prevent_ = true; } | ||||||
|  | void DeepSleepComponent::allow_deep_sleep() { this->prevent_ = false; } | ||||||
|  |  | ||||||
| }  // namespace deep_sleep | }  // namespace deep_sleep | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|   | |||||||
| @@ -96,6 +96,7 @@ class DeepSleepComponent : public Component { | |||||||
|   void begin_sleep(bool manual = false); |   void begin_sleep(bool manual = false); | ||||||
|  |  | ||||||
|   void prevent_deep_sleep(); |   void prevent_deep_sleep(); | ||||||
|  |   void allow_deep_sleep(); | ||||||
|  |  | ||||||
|  protected: |  protected: | ||||||
|   // Returns nullopt if no run duration is set. Otherwise, returns the run |   // Returns nullopt if no run duration is set. Otherwise, returns the run | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user