Commit graph

48 commits

Author SHA1 Message Date
gak 796c09c17a
fix: remove vehicles list (#13) 2024-01-24 10:25:41 +11:00
gak 85e3728a1d
fix: powerwall api new fields 2024-01-20 19:40:35 +11:00
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 eec64e3e7b
feat: support registered wall connectors 2023-11-06 11:59:14 +11:00
gak 20b02d8b86
wip(tesla_api_coverage): more tests 2023-10-24 12:40:44 +11:00
gak 0627ee2c16
fix!: Remove async_fn_in_trait feature. Ignore warning.
This is because the latest nightly doesn't require the feature and it
added a warning for public async traits and not sure how to properly
handle it yet.
2023-10-22 10:23:33 +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 a64a04e3d7
feat: rename and add api calls (energy_sites)
- rename api/cli energy_sites to products (to match the api)
- add energy_sites site_status
- add energy_sites live_status
- add energy_sites site_info
2023-09-05 13:48:16 +10:00
gak d29e842035
refactor: separate from_interactive_url to pub fn 2023-08-30 20:13:51 +10: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 5e40f2cf52
feat: slightly cleaner tracing output 2023-08-30 14:26:01 +10:00
gak 5c018e9f8d
refactor: request tweaks 2023-08-30 14:04:46 +10:00
gak 9fe18ab1b0
refactor: bring body into request() 2023-08-30 13:39:03 +10:00
gak ffe00e074b
refactor: less code duplication in requests 2023-08-30 13:29:11 +10:00
gak 900be5aa1f
feat: cli show json on POST and some errors 2023-08-29 16:13:43 +10:00
gak f1f2c2e566
doc: document calendar history a bit 2023-08-29 13:55:02 +10:00
gak 8881d0fa59
feat: cli only prints json, cli-pretty-json feature 2023-08-29 13:11:28 +10:00
gak 44fe9bc48e
fix: few fields missing for me 2023-08-29 12:32:19 +10:00
gak 9d020efa8c
chore: cleanups. nicer interactive message. 2023-08-29 12:16:07 +10:00
gak e4191c75f3
feat: verify state string in callback 2023-08-29 11:57:36 +10:00
gak db80e29d26
fix: charge_to_max_range was missing 2023-08-29 11:56:57 +10:00
gak 1c3a002a94
chore: clippy 2023-08-29 11:41:40 +10:00
gak e3c1044dd3
refactor: split up cli, more crate version updates 2023-08-29 11:33:03 +10:00
gak 635bd84384
refactor: cli to be a binary with cli feature 2023-08-29 10:49:04 +10:00
gak 009ae67734
fix: double url appended, chore: lint cleanups 2023-08-29 10:29:06 +10:00
gak 2bd682de6a
bug: #1 fix auth using pkce 2023-08-29 10:18:42 +10:00
gak 050b9da48a feature: Serializable Credentials for auth 2022-07-25 14:17:49 +10:00
gak e405ef83f8 refactor: merge Authentication + Api 2022-07-25 13:47:43 +10:00
gak ce3552cdc7 wip: powerwall_energy_history 2022-07-25 10:00:55 +10:00
gak 6e9888acfa fix: energy and power for calendar_history 2022-07-24 13:00:05 +10:00
gak b07c12d397 wip: calendar_history 2022-07-24 09:16:34 +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
gak 9cca1ca5bd wip: Add cli example. Change api macros. 2022-07-21 17:08:49 +10:00
gak 54108eb896 initial 2022-07-21 13:46:49 +10:00