awake

The loop of awake mode.

While the board is on external power it stays up, serves the web interface and keeps the display current without deep sleep.

Functions

run(now_s, on_external_power, poll, update_header, ...)

Loop until the board runs on battery again.

Module Contents

awake.run(now_s, on_external_power, poll, update_header, fetch_due, fetch, check_s=5)

Loop until the board runs on battery again.

now_s() returns the time in seconds, poll(timeout_s) serves web requests for that long. Every check_s seconds the power source is checked; data is fetched when fetch_due() says so, otherwise the header is updated once per minute.