fix api interface saving etc
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 2m12s

This commit is contained in:
Alex Janka 2024-05-25 09:34:53 +10:00
parent a762ccbcdc
commit 40817a7419
3 changed files with 10 additions and 3 deletions

4
Cargo.lock generated
View file

@ -2849,7 +2849,7 @@ dependencies = [
[[package]]
name = "tesla-charge-controller"
version = "1.3.2"
version = "1.3.3"
dependencies = [
"chrono",
"clap 4.5.4",
@ -2886,7 +2886,7 @@ dependencies = [
[[package]]
name = "teslatte"
version = "0.1.15"
source = "git+https://git.alexjanka.com/alex/teslatte#ef26ce4697412b0fbfed64c01836eee613ffccf5"
source = "git+https://git.alexjanka.com/alex/teslatte#490a50e24ca875e5eb26efc40c12229d5d2e1659"
dependencies = [
"chrono",
"clap 4.5.4",

View file

@ -1,6 +1,6 @@
[package]
name = "tesla-charge-controller"
version = "1.3.2"
version = "1.3.3"
edition = "2021"
license = "MITNFA"
description = "Controls Tesla charge rate based on solar charge data"

View file

@ -278,6 +278,13 @@ impl TeslaInterface {
api.refresh().await?;
let last_refresh = Instant::now();
info!("Refreshed auth key");
AuthInfo {
access_token: api.access_token.clone(),
refresh_token: api.refresh_token.clone(),
}
.save(Some(&auth_path))
.map_err(tesla_common::SaveError::from)?;
info!("Saved auth key");
let vehicle = api
.products()
.await?