// REST Client API variables
private final WebTarget teslaTarget;
WebTarget vehiclesTarget; // this cannot be marked final as it is used in the runnable
+ WebTarget productsTarget; // this cannot be marked final as it is used in the runnable
final WebTarget vehicleTarget;
final WebTarget dataRequestTarget;
final WebTarget commandTarget;
this.thingTypeMigrationService = thingTypeMigrationService;
this.vehiclesTarget = teslaTarget.path(API_VERSION).path(VEHICLES);
+ this.productsTarget = teslaTarget.path(API_VERSION).path(PRODUCTS);
this.vehicleTarget = vehiclesTarget.path(PATH_VEHICLE_ID);
this.dataRequestTarget = vehicleTarget.path(PATH_DATA_REQUEST).queryParam("endpoints",
"location_data;charge_state;climate_state;vehicle_state;gui_settings;vehicle_config");
if (authHeader != null) {
// get a list of vehicles
- Response response = vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE)
+ Response response = productsTarget.request(MediaType.APPLICATION_JSON_TYPE)
.header("Authorization", authHeader).get();
logger.debug("Querying the vehicle: Response: {}: {}", response.getStatus(),
if (authenticationResult.getStatus() == ThingStatus.ONLINE) {
// get a list of vehicles
- Response response = vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE)
+ Response response = productsTarget.request(MediaType.APPLICATION_JSON_TYPE)
.header("Authorization", "Bearer " + logonToken.access_token).get();
if (response != null && response.getStatus() == 200 && response.hasEntity()) {
if (authHeader != null) {
try {
// get a list of vehicles
- synchronized (account.vehiclesTarget) {
- Response response = account.vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE)
+ synchronized (account.productsTarget) {
+ Response response = account.productsTarget.request(MediaType.APPLICATION_JSON_TYPE)
.header("Authorization", authHeader).get();
logger.debug("Querying the vehicle, response : {}, {}", response.getStatus(),