Inky Frame - Deep Sleep explanation

Can I also check my understanding: when a wake is triggered (be it via the RTC or a button press), the board effectively restarts and main.py is re-run from scratch? So if we want to store any state across wakes, that has to be written to the SD card?

“Wake” and “sleep” are totally wrong terms. In fact you (and Pimoroni) should call it what it is: “power on” and “power off”.

The Inky has a very efficient way of minimizing current draw: it turns power off. Power on is triggered by a button or by the RTC. Just triggering is not enough, because the “on-state” has to be actively maintained, either by keeping on pressing or by the program that is running on the Pico-W. That is the reason why you have to press long enough until the Pico-W takes over.

On power on the main.py restarts from scratch. If you want to store anything across restarts, you need to either save it on SD card or in so called non-volatile RAM. The Pico-W has some (it is actually part of the flash) and the RTC also has one byte. Does not sound much but I use it to store two status-bits, enough for my use-case. Since the RTC is always powered, that byte is not lost until you detach the battery.