Skip to content

Commit

Permalink
feat(TeslaBleService): set timout
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuehnel committed Jun 16, 2024
1 parent 3d8a9e8 commit 167f056
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions TeslaSolarCharger/Server/Services/TeslaBleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ private async Task<DtoBleResult> SendCommandToBle(DtoBleRequest request)
using var client = new HttpClient();
try
{
//Default timeout of Tesla Command CLI is 21 seconds.
client.Timeout = TimeSpan.FromSeconds(22);
var response = await client.PostAsJsonAsync(url, request.Parameters).ConfigureAwait(false);
var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
if (!response.IsSuccessStatusCode)
Expand Down

0 comments on commit 167f056

Please sign in to comment.