Skip to content

Add power management to launcher #172

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

Merged
merged 4 commits into from
Aug 3, 2017
Merged

Add power management to launcher #172

merged 4 commits into from
Aug 3, 2017

Conversation

renzenicolai
Copy link
Member

No description provided.

Copy link

@raboof raboof left a comment

Choose a reason for hiding this comment

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

Code LGTM (but not merging myself since I didn't test it)

selected = options.selected_text()
options.destroy()
appglue.start_app(selected)
def run_it():
Copy link

Choose a reason for hiding this comment

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

I like handling the pushed check outside of this function, much neater 👍


ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0)
ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0)
def input_a(pressed):
Copy link

Choose a reason for hiding this comment

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

These generic input_x seem like unnecessary/confusing indirection to me, I'd personally prefer a small lambda when attaching the input handler. Might be a matter of taste, so OK.

# Power management
virtualtimers.activate(1000) # Start scheduler with 1 second ticks
pm.set_timeout(5*60*1000) # Set timeout to 5 minutes
pm.callback(pm_cb) # Go to splash instead of sleep
Copy link

Choose a reason for hiding this comment

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

would also be more readable as a lambda imho: pm.callback(lambda: appglue.home())

Copy link

Choose a reason for hiding this comment

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

(actually surprised your original approach pm.callback(appglue.home) didn't work, weird)

@annejan annejan merged commit 1cd5ed7 into master Aug 3, 2017
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy