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

feat: Support setting a sleep timer #99

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aaronleopold
Copy link

@aaronleopold aaronleopold commented Feb 19, 2025

Resolves #98

Opening as a draft because I am not a Swift dev, so I likely used bad patterns. However, the timer is functional in its current state. Happy to iterate as needed to get it to better Swift standards!

As a side note, I imagine we could pull some of this in order to also add this functionality to rasmuslos/ShelfPlayer#193

Without timer set Screenshot 2025-02-19 at 12 17 36 PM
With timer set Screenshot 2025-02-19 at 12 17 43 PM

Comment on lines +100 to +111
commandCenter.enableLanguageOptionCommand.isEnabled = true
commandCenter.enableLanguageOptionCommand.addTarget { [unowned self] event in
// TODO: get a value somehow?
setSleepTimer(minutes: 30)
return .success
}

commandCenter.disableLanguageOptionCommand.isEnabled = true
commandCenter.disableLanguageOptionCommand.addTarget { [unowned self] event in
cancelSleepTimer()
return .success
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these are actually needed, left it in just in case I should have something here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] Sleep timer
1 participant