Temperature-controlled energy storage