Commit graph

24 commits

Author SHA1 Message Date
gak 6facc27d8b
change!: vehicle_data now accepts a struct instead of VehicleId
To support "endpoints", e.g. requesting GPS.

From https://developer.tesla.com/docs/fleet-api#vehicle_data

String of URL-encoded, semicolon-separated values. Can be many of 'charge_state',
'climate_state', 'closures_state', 'drive_state', 'gui_settings', 'location_data',
'vehicle_config', 'vehicle_state', 'vehicle_data_combo'.

Before:

let vehicle_data = api.vehicle_data(&vehicle_id).await.unwrap();

After:

let get_vehicle_data = GetVehicleData::new(vehicles_id);
let vehicle_data = api.vehicle_data(&get_vehicle_data).await.unwrap();

Or with a endpoints:

let get_vehicle_data = GetVehicleData::new_with_endpoints(123u64, vec![Endpoint::ChargeState, Endpoint::ClimateState]);
let vehicle_data = api.vehicle_data(&get_vehicle_data).await.unwrap();

CLI:

You can still use vehicle-data without endpoints, but you won't get
location data. To fetch location_data:

teslatte api vehicle 123 vehicle-data location_data
2023-11-11 11:07:24 +11:00
gak 35f2ac6d26
fix: vehicle api changes as of "api_version 67"
add: VehicleData:
- cached_data
- command_signing
- release_notes_supported

add: ClimateState:
- auto_steering_wheel_heat
- cop_activation_temperature,
- steering_wheel_heat_level

DriveState now Optional:
- gps_as_of
- heading
- latitude
- longitude
- native_latitude
- native_location_supported
- native_longitude
- native_type

Drivestate add:
- active_route_traffic_minutes_delay

GuiSettings add:
- gui_tirepressure_units

VehicleConfig add:
- cop_user_set_temp_supported
- webcam_selfie_supported

VehicleState add:
- media_info: MediaInfo
- tpms_hard_warning_fl
- tpms_hard_warning_fr
- tpms_hard_warning_rl
- tpms_hard_warning_rr
- tpms_rcp_front_value
- tpms_rcp_rear_value
- tpms_last_seen_pressure_time_fl
- tpms_last_seen_pressure_time_fr
- tpms_last_seen_pressure_time_rl
- tpms_last_seen_pressure_time_rr
- tpms_soft_warning_fl
- tpms_soft_warning_fr
- tpms_soft_warning_rl
- tpms_soft_warning_rr

MediaInfo add:
- audio_volume
- audio_volume_increment
- audio_volume_max
2023-11-11 09:38:44 +11:00
gak 8c059769ee
refactor!: Rename Api to OwnerApi. Remove ResponseData<T>. Add VehicleApi trait.
Significant refactor to progress towards different API access that Tesla
has introduced. See issues #6 and #7.

Removed `ResponseData` because it wasn't very ergonomic, forcing the user
to deref or call data(). Also it had specific fields for JSON output
which was only used for the CLI, so I introduced a field
`print_responses` in OwnerApi that the CLI can use.
2023-10-22 09:17:32 +11:00
gak a8b58e1157
refactor: Api -> OwnerApi 2023-10-20 12:18:38 +11:00
gak 2cb7e678d7
fix: RequestData GET -> Get 2023-10-20 07:18:01 +11:00
Richard Ulrich 3d583f7e0b
adding commands for doors and hvac
making inside_temp optional
2023-10-19 19:51:20 +02:00
gak 041deeb3a6
refactor: RequestData private, GET->Get etc. Docs. 2023-10-10 13:45:31 +11:00
Richard Ulrich 6577e4cc65
Making more fields optional. Adding more test data in separate files 2023-10-09 22:53:41 +02:00
Richard Ulrich cbb8da633b
Adapted to the values I get for my Model S 2023-09-19 21:52:00 +02:00
gak 0057ae3be2
feat: honk and flash 2023-08-30 16:19:19 +10:00
gak 8b96ecf3bc
feat: set_scheduled_departure 2023-08-30 16:15:17 +10:00
gak cb8df6019a
feat: added set_scheduled_charging 2023-08-30 15:46:16 +10:00
gak 844583a6b1
refactor: reuse POST request structs for cli 2023-08-30 15:27:17 +10:00
gak 68b835124f
feat: added vehicle charge related apis 2023-08-30 15:14:33 +10:00
gak 78ed8a9477
fix: #2 tesla removed this endpoint 2023-08-30 14:39:12 +10:00
gak 5c018e9f8d
refactor: request tweaks 2023-08-30 14:04:46 +10:00
gak 900be5aa1f
feat: cli show json on POST and some errors 2023-08-29 16:13:43 +10:00
gak 44fe9bc48e
fix: few fields missing for me 2023-08-29 12:32:19 +10:00
gak db80e29d26
fix: charge_to_max_range was missing 2023-08-29 11:56:57 +10:00
gak 009ae67734
fix: double url appended, chore: lint cleanups 2023-08-29 10:29:06 +10:00
gak ce3552cdc7 wip: powerwall_energy_history 2022-07-25 10:00:55 +10:00
gak 9392dd5910 wip: new macro for struct arg 2022-07-23 15:08:53 +10:00
gak 8b7410729e wip: energy/powerwall api 2022-07-21 21:00:45 +10:00
gak 6214bf1b5f wip: Refactor vehicle api. cli. 2022-07-21 18:00:41 +10:00
Renamed from src/vehicle_state.rs (Browse further)