Skip to content

Commit 10f8305

Browse files
committed
use new acquirevehicle endpoint
fixes #35
1 parent 8efaf52 commit 10f8305

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

libgwmapi.test/GwmApiClientTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Text.Json.Serialization;
44
using libgwmapi.DTO.UserAuth;
55
using libgwmapi.DTO.Vehicle;
6+
using Microsoft.Extensions.Logging.Abstractions;
67
using Xunit.Abstractions;
78

89
namespace libgwmapi.test;
@@ -94,7 +95,7 @@ public async Task CanGetUserBaseInfo()
9495
public async Task CanAcquireVehicles()
9596
{
9697
var client = GetAuthenticatedClient();
97-
var vehicles = await client.AquireVehiclesAsync(CancellationToken.None);
98+
var vehicles = await client.AcquireVehiclesAsync(CancellationToken.None);
9899
Assert.NotNull(vehicles);
99100
Assert.NotEmpty(vehicles);
100101
var vehicle = vehicles[0];
@@ -232,7 +233,7 @@ private GwmApiClient GetClient()
232233
store.Add(cert);
233234
}
234235
}
235-
return new GwmApiClient(new HttpClient(), new HttpClient(httpHandler));
236+
return new GwmApiClient(new HttpClient(), new HttpClient(httpHandler), new NullLoggerFactory());
236237
}
237238

238239
private GwmApiClient GetAuthenticatedClient()

libgwmapi/GwmApiClient.Vehicle.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ namespace libgwmapi;
44

55
public partial class GwmApiClient
66
{
7-
public Task<Vehicle[]> AquireVehiclesAsync(CancellationToken cancellationToken)
7+
public Task<Vehicle[]> AcquireVehiclesAsync(CancellationToken cancellationToken)
88
{
9-
return GetAppAsync<Vehicle[]>("vehicle/acquireVehicles", cancellationToken);
9+
return GetAppAsync<Vehicle[]>("globalapp/vehicle/acquireVehicles", cancellationToken);
1010
}
1111

1212
public Task<VehicleBasicsInfo> GetVehicleBasicsInfoAsync(string vin, CancellationToken cancellationToken)

ora2mqtt/RunCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private async Task RefreshTokenAsync(GwmApiClient client, Ora2MqttOptions option
114114

115115
private async Task PublishStatusAsync(IMqttClient mqtt, GwmApiClient gwm, CancellationToken cancellationToken)
116116
{
117-
var vehicles = await gwm.AquireVehiclesAsync(cancellationToken);
117+
var vehicles = await gwm.AcquireVehiclesAsync(cancellationToken);
118118
foreach (var vehicle in vehicles)
119119
{
120120
var status = await gwm.GetLastVehicleStatusAsync(vehicle.Vin, cancellationToken);

0 commit comments

Comments
 (0)