For one of my projects I use the SparkFun ESP8266 board with an additional LiPo battery in cases power supply goes down.
Now I would like to communicate the power loss - or the fact that the board is running on battery power via WiFi.
Is there a way to find out (in code) when the board switches from mains power to battery and back?