Skip to content
New issue

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

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

Already on GitHub? # to your account

Computer still sleeps after battery depletion #3

Open
johnkary opened this issue Aug 10, 2010 · 0 comments
Open

Computer still sleeps after battery depletion #3

johnkary opened this issue Aug 10, 2010 · 0 comments

Comments

@johnkary
Copy link
Owner

If you set a sleep timer and the battery depletes before the timer reaches 0, the timer will resume when power is restored, and go to sleep when it reaches 0.

  1. Current time is 8:00am
  2. Invoke sleep in 30 minutes: gotosleep 1800
  3. Battery depletes after 10 minutes (8:10am)
  4. Computer is plugged into wall and restored power (10:00am)
  5. Script continues executing and goes into sleep state (10:20am)

This is in error, as the intended sleep time was 8:30am, but due to power loss, sleep state was at 10:20am.

Could fix by storing current UNIX time at instantiation and comparing for accuracy when time to invoke sleep. If invoke sleep time > actual sleep time, do not execute.

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

No branches or pull requests

1 participant