Handle config errors better

This commit is contained in:
Luke D Jones
2020-08-11 14:36:37 +12:00
parent ad114a1f1b
commit 760d5be8eb
3 changed files with 33 additions and 26 deletions

View File

@@ -86,7 +86,7 @@ impl CtrlCharge {
file.write_all(limit.to_string().as_bytes())
.unwrap_or_else(|err| error!("Could not write to {}, {:?}", BAT_CHARGE_PATH, err));
info!("Battery charge limit: {}", limit);
config.read();
config.bat_charge_limit = limit;
config.write();