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

View file

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

View file

@ -278,6 +278,13 @@ impl TeslaInterface {
api.refresh().await?; api.refresh().await?;
let last_refresh = Instant::now(); let last_refresh = Instant::now();
info!("Refreshed auth key"); 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 let vehicle = api
.products() .products()
.await? .await?