Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listen_state should take into account entity's last_changed for immediate triggers #2186

Open
1 task done
Ten0 opened this issue Dec 27, 2024 · 0 comments
Open
1 task done
Labels
enhancement New feature or request

Comments

@Ten0
Copy link

Ten0 commented Dec 27, 2024

Is there an existing feature request for this?

  • I have searched the existing issues

Your feature request

Currently, for immediate listen_states, AppDaemon will wait at least the specified duration after AppDaemon's start (or trigger creation) before running the trigger, even if we can know that we can actually wait for less time and still be sure that the state we are listening for has not changed for longer than that time.

To solve this, when registering a listen_state, we could look at entity's last_changed that comes back from HomeAssistant's API when choosing how long to actually wait for.
This would make such triggers survive AppDaemon reboots/reloads much better, as it would mean that such triggers could typically recover their "I've already waited for this long" state.

@Ten0 Ten0 added the enhancement New feature or request label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant