state¶
Dashboard state kept in RTC memory, which survives deep sleep.
- {“readings”: {…}, “online”: bool, “fetched”: start of the last fetch (s),
“header”: header dict (see
header)}
Kept in RTC memory rather than flash, since it is written on every wake
and needs no copy across power loss. rtc is machine.RTC() on the board,
a fake in tests.
Attributes¶
Functions¶
Module Contents¶
- state.MAX_SIZE = 2048¶
- state.save(rtc, state)¶
Store
stateas JSON in RTC memory.- Raises:
ValueError – If it does not fit into MAX_SIZE bytes.
- state.load(rtc)¶
The saved state, or None after power loss or if it is unreadable.