Forum Archive

Keeping the display on

amjoconn95

Thanks for Pythonista, it is a sweet app.

I wrote a count down timer and it works great but after 6 or 7 minutes the iPad turns off the display. Is there a way programatically to tell the iPad not to sleep until the program is done? Possibly a hack using the libraries available to us?

Thanks again!

ccc

First make sure that Settings / General / Auto-Lock is set to the longest time.

If changing that setting is not sufficient for your purposes then you can look at sending yourself a Notification but I am unsure if this will help or not. Search this forum for 'Notifications' for a sample app called 'Quick Reminders.py' as a starting point. Let us know if you solve it.

ccc

It Works!!! See noDoze.py below...

https://gist.github.com/cclauss/6383054

amjoconn95

Thanks! Increasing the Auto-Lock help with my situation. I haven't fully tested the noDoze.py code yet, but I will keep working on it and hopefully I can post the result.

ccc

This looks like a far better solution...

console.set_idle_timer_disabled(flag)

Disable or enable the idle timer (which puts the device to sleep after a certain period of inactivity).