예제 #1
0
 public async Task Start(string password = "")
 {
     if (string.IsNullOrWhiteSpace(password) && !string.IsNullOrWhiteSpace(Password) && Options.HasFlag(ConfigurationOptions.RemoteStartWithoutPassword))
     {
         password = Password;
     }
     if (string.IsNullOrWhiteSpace(password))
     {
         throw new ArgumentException("A password is required to start.", password);
     }
     await EnsureAwake();
     await Time("http start", async() =>
     {
         var url = $"{UrlBase}/api/1/vehicles/{VehicleId}/command/remote_start_drive?password={password}";
         await HttpHelper.HttpPostOAuth <JObject, string>(AccessToken, url, "");
     });
 }