Skip to content

Commit

Permalink
fix api versions for australia
Browse files Browse the repository at this point in the history
  • Loading branch information
bitnimble committed Jul 29, 2023
1 parent 5ba231d commit 3940e52
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/vehicles/australia.vehicle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/control/engine`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/control/engine`, {
body: {
action: 'start',
hvacType: 0,
Expand All @@ -90,7 +90,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/control/engine`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/control/engine`, {
body: {
action: 'stop',
hvacType: 0,
Expand All @@ -114,7 +114,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/control/door`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/control/door`, {
body: {
action: 'close',
deviceId: this.controller.session.deviceId,
Expand All @@ -135,7 +135,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/control/door`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/control/door`, {
body: {
action: 'open',
deviceId: this.controller.session.deviceId,
Expand All @@ -158,7 +158,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/control/windowcurtain`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/control/windowcurtain`, {
body: config,
})
);
Expand All @@ -184,7 +184,7 @@ export default class AustraliaVehicle extends Vehicle {
: await http.get(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/status`)
);
const locationResponse = this.updateRates(
await http.get(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/location/park`)
await http.get(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/location/park`)
);
const odometer = await this.odometer();
// TODO: make odometer in `FullVehicleStatus` nullable
Expand Down Expand Up @@ -216,7 +216,7 @@ export default class AustraliaVehicle extends Vehicle {
try {
const cacheString = statusConfig.refresh ? '' : '/latest';
const response = this.updateRates(
await http.get(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/status${cacheString}`)
await http.get(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/status${cacheString}`)
);
const vehicleStatus = response.body.resMsg;

Expand Down Expand Up @@ -288,7 +288,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/monthlyreport`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/monthlyreport`, {
body: {
setRptMonth: toMonthDate({
year: new Date().getFullYear(),
Expand All @@ -312,7 +312,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.get(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/location/park`)
await http.get(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/location/park`)
);

const data = response.body.resMsg?.gpsDetail;
Expand All @@ -338,7 +338,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/control/charge`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/control/charge`, {
body: {
action: 'start',
deviceId: this.controller.session.deviceId,
Expand All @@ -362,7 +362,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/control/charge`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/control/charge`, {
body: {
action: 'stop',
deviceId: this.controller.session.deviceId,
Expand Down Expand Up @@ -390,7 +390,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/monthlyreport`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/monthlyreport`, {
body: {
setRptMonth: toMonthDate(month),
},
Expand Down Expand Up @@ -576,7 +576,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
const response = this.updateRates(
await http.get(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/charge/target`)
await http.get(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/charge/target`)
);
const rawData = response.body.resMsg?.targetSOClist;
if (rawData && Array.isArray(rawData)) {
Expand Down Expand Up @@ -608,7 +608,7 @@ export default class AustraliaVehicle extends Vehicle {
}
try {
this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/charge/target`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/charge/target`, {
body: {
targetSOClist: [
{ plugType: EVChargeModeTypes.FAST, targetSOClevel: limits.fast },
Expand All @@ -631,7 +631,7 @@ export default class AustraliaVehicle extends Vehicle {
const http = await this.controller.getVehicleHttpService();
try {
this.updateRates(
await http.post(`/api/v1/spa/vehicles/${this.vehicleConfig.id}/location/routes`, {
await http.post(`/api/v2/spa/vehicles/${this.vehicleConfig.id}/location/routes`, {
body: {
deviceID: this.controller.session.deviceId,
poiInfoList: poiInformations,
Expand Down

0 comments on commit 3940e52

Please sign in to comment.