From 167f05660ae4f564f179e7eeb7a8ed1dec7a9385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20K=C3=BChnel?= Date: Sun, 16 Jun 2024 23:19:30 +0200 Subject: [PATCH] feat(TeslaBleService): set timout --- TeslaSolarCharger/Server/Services/TeslaBleService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TeslaSolarCharger/Server/Services/TeslaBleService.cs b/TeslaSolarCharger/Server/Services/TeslaBleService.cs index f80429459..89b48a17c 100644 --- a/TeslaSolarCharger/Server/Services/TeslaBleService.cs +++ b/TeslaSolarCharger/Server/Services/TeslaBleService.cs @@ -145,6 +145,8 @@ private async Task 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)