From a350280662bfca096ea153903bdc3dcb2652f415 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Thu, 18 Jan 2024 16:52:49 +1100 Subject: [PATCH] cop&hvac enums --- src/vehicles.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/vehicles.rs b/src/vehicles.rs index e6d3159..4537938 100644 --- a/src/vehicles.rs +++ b/src/vehicles.rs @@ -267,13 +267,13 @@ pub struct ClimateState { pub auto_seat_climate_right: Option, pub battery_heater: bool, pub battery_heater_no_power: Option, - pub cabin_overheat_protection: String, + pub cabin_overheat_protection: CabinOverheatProtection, pub cabin_overheat_protection_actively_cooling: Option, pub climate_keeper_mode: String, pub defrost_mode: i64, pub driver_temp_setting: f64, pub fan_status: i64, - pub hvac_auto_request: String, + pub hvac_auto_request: HvacAutoRequest, pub inside_temp: Option, pub is_auto_conditioning_on: Option, pub is_climate_on: bool, @@ -303,6 +303,23 @@ pub struct ClimateState { pub steering_wheel_heat_level: Option, } +#[derive(Debug, Clone, Copy, Display, Deserialize, Serialize, PartialEq)] +pub enum CabinOverheatProtection { + Off, + On, + FanOnly, + #[serde(other)] + Unknown, +} + +#[derive(Debug, Clone, Copy, Display, Deserialize, Serialize, PartialEq)] +pub enum HvacAutoRequest { + Override, + On, + #[serde(other)] + Unknown, +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DriveState { /// From https://developer.tesla.com/docs/fleet-api#vehicle_data