From 44fe9bc48edd8f1212d534c9fd9b621da979b95d Mon Sep 17 00:00:00 2001 From: gak Date: Tue, 29 Aug 2023 12:32:19 +1000 Subject: [PATCH] fix: few fields missing for me --- src/energy.rs | 4 ++-- src/vehicles.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/energy.rs b/src/energy.rs index 37482e6..5c112f2 100644 --- a/src/energy.rs +++ b/src/energy.rs @@ -214,8 +214,8 @@ mod tests { assert_eq!(v.user_id, 2222291283912); assert_eq!(v.vehicle_id.0, 333331238921); assert_eq!(v.vin, "T234567890123456789"); - assert_eq!(v.display_name, "My Vehicle"); - assert_eq!(v.option_codes, "ASDF,SDFG,DFGH"); + assert_eq!(v.display_name.unwrap(), "My Vehicle"); + assert_eq!(v.option_codes.unwrap(), "ASDF,SDFG,DFGH"); assert_eq!(v.color, None); assert_eq!(v.access_type, "OWNER"); assert_eq!(v.tokens, vec!["asdf1234"]); diff --git a/src/vehicles.rs b/src/vehicles.rs index 6eaf90f..d52fb77 100644 --- a/src/vehicles.rs +++ b/src/vehicles.rs @@ -22,8 +22,8 @@ pub struct VehicleData { pub vehicle_id: ExternalVehicleId, pub user_id: i64, pub vin: String, - pub display_name: String, - pub option_codes: String, + pub display_name: Option, + pub option_codes: Option, /// gak: This was null for me, assuming String. pub color: Option, pub access_type: String, @@ -81,9 +81,9 @@ pub struct ChargeState { pub fast_charger_present: bool, pub fast_charger_type: String, pub ideal_battery_range: f64, - pub managed_charging_active: bool, + pub managed_charging_active: Option, pub managed_charging_start_time: Option, - pub managed_charging_user_canceled: bool, + pub managed_charging_user_canceled: Option, pub max_range_charge_counter: i64, pub minutes_to_full_charge: i64, pub not_enough_power_to_heat: Option,