The West’s recent heatwaves put California power users in the dark but showed how flexible demand response can keep the lights on.