Package de.chiflux.tesla
Interface TeslaApi
- All Known Implementing Classes:
TeslaApiService,TeslaLiveApi
public interface TeslaApi
A thin wrapper around the Tesla API functionality supporting charging.
-
Method Summary
Modifier and TypeMethodDescriptiongetFullVehicleData(String id_s) Full vehicle data consists of charge state, drive state, vehicle config vehicle state and general information.static TeslaApiGet the Live API.All vehicles associated with the accountvoidRefresh the access token.setChargeLimit(String id_s, int chargeLimit) Set the charge limitstartCharge(String id_s) Start chargingstopCharge(String id_s) Stop chargingWake up the vehicle
-
Method Details
-
startCharge
Start charging- Parameters:
id_s- id of the vehicle- Returns:
- true if successful
-
stopCharge
Stop charging- Parameters:
id_s- id of the vehicle- Returns:
- true if successful
-
setChargeLimit
Set the charge limit- Parameters:
id_s- id of the vehiclechargeLimit- charge limit in percent- Returns:
- true if successful
-
wakeUp
Wake up the vehicle- Parameters:
id_s- id of the vehicle- Returns:
- true if successful
-
getFullVehicleData
Full vehicle data consists of charge state, drive state, vehicle config vehicle state and general information. Should implement a grace period if the vehicle is parked and locked to give the vehicle a change to sleep.- Parameters:
id_s- id of the vehicle- Returns:
- Full vehicle data or null
-
getVehicles
VehiclesResponse getVehicles()All vehicles associated with the account- Returns:
- All vehicles associated with the account or null
-
refreshToken
void refreshToken()Refresh the access token. -
getLiveApi
Get the Live API.- Returns:
- the Live API
-