With summer’s heat approaching, California’s plan for avoiding a repeat of last year’s blackouts hinges on a humble savior — the battery.

Giant versions of the same technology that powers smart phones and cars are being plugged into the state’s electrical grid at breakneck speed, with California set to add more battery capacity this year than all of China, according to BloombergNEF.

It will be the biggest test yet of whether batteries are reliable enough to sustain a grid largely powered by renewables. Last year, when the worst heat wave in a generation taxed California’s power system and plunged millions into darkness in the first rolling blackouts since the Enron crisis, many blamed the state’s aggressive clean-energy push and its reliance on solar power. Should a heat wave strike again this summer, it will be up to batteries save the day.