Added saving battery levels to file.