esphome / esphome/feature-requests

Add timeout for deep_sleep.prevent

Open
#1,653 3 comments 0 reactions 0 assignees View on GitHub
component: deep_sleep
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**
It would be useful to have an timeout option for deep_sleep.prevent action, so it would prevent deep sleep only for a given time.

**Please describe your use case for this integration and alternatives you've tried:**
The use case is quite simple: I want the touchscreen (and whole esp) to stay awake for x seconds after last touch, so every touch event invokes the deep_sleep.prevent. But in the current deep_sleep implementation it prevents sleeping until deep_sleep.enter is called.

**Additional context**
I've actually already implemented all the code required in local deep_sleep component (both python config, validation and cpp/h), tested it locally and it works quite well.

But wanted to consult the community / component maintainer if it is really needed and/or maybe there is some other solution in the current implemented I somehow missed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by examining the deep_sleep component's Python configuration and validation alongside its C++ headers and source, focusing on deep_sleep.prevent and deep_sleep.enter. Confirm how the requested timeout should interact with repeated touch events and existing sleep behavior, then verify that the configured timeout works in the local implementation without changing the current no-timeout behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.