Energy companies are working to adapt as they confront record-setting temperatures, floods and windstorms.