That's what a UPS and a backup generator were for, even before PV and industrial-scale batteries became a thing.