-
Notifications
You must be signed in to change notification settings - Fork 398
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
feat: Add Idle Shutdown Timer support #2332
feat: Add Idle Shutdown Timer support #2332
Conversation
Pull Request Test Coverage Report for Build 8694662023Details
💛 - Coveralls |
Thanks for the PR. I was wondering, did you consider this code on our development? I am specifically thinking of this cass RPi-Jukebox-RFID/src/jukebox/jukebox/multitimer.py Lines 90 to 93 in acf6ec0
|
7cc4f00
to
539ab46
Compare
@pabera Yes, I've seen the existing timer classes. However, I've had a hard time seeing how they could add benefits here. Two use cases come to mind:
I think the shutdown timer is kind of special in that it is a timer which is expected not to fire most of the time, because some activity would restart it. (I've now added inline documentation to cover the reasoning so far) Edit: If usage of those classes would be mandatory for the PR to be accepted, I could of course edit the code to use them. I would have more motivation to do so if I see the benefits, though. :) |
It's definitely not a must. I am aligned with your explanation. Yet I wanted to make sure we don't create competing functionality which in the end makes the system harder to understand because the rational behind it cannot be understood. |
For this feature to be complete, it would be nice to have function to get and manipulate the |
539ab46
to
4525ed8
Compare
In #1970 this feature was already requested. |
This adds an optional idle shutdown timer which can be enabled via timers.idle_shutdown.timeout_sec in the jukebox.yaml config. The system will shut down after the given number of seconds if no activity has been detected during that time. Activity is defined as: - music playing - active SSH sessions - changes in configs or audio content. Fixes: MiczFlor#1970
4525ed8
to
09e99cb
Compare
Will merge this to test the functionality in a RPI environment. |
… and GenericEndlessTimerClass timers
@hoffie To resolve this, I divided your Timer class into two separate classes: 1) IdleCheck ( This restructuring has allowed for a seamless integration of the Idle Shutdown Timer into the UI. However, I encountered an issue with the I'm eager to hear your thoughts on this refactor and would appreciate your help with testing. |
The checks work again, however there are two small flake8 errors, see https://github.com/MiczFlor/RPi-Jukebox-RFID/actions/runs/8815089690/job/24513166228?pr=2332 |
This adds an optional idle shutdown timer which can be enabled via
timers.idle_shutdown.timeout_sec
in the jukebox.yaml config.The system will shut down after the given number of seconds if no activity has been detected during that time. Activity is defined as:
I know that the definition in documentation/developers/status.md is a bit more ambitious than what this PR does, but it solves the actual need for me and might solve it for others, too. So maybe it can be merged now and extended later.