Fix tesla build errors
Some checks failed
Build / Build (push) Failing after 2m55s
Build / Publish :latest (push) Has been skipped
Build / Publish :release (push) Has been skipped
Build / Release (push) Has been skipped

This commit is contained in:
andig 2021-02-02 16:19:19 +01:00
parent 46d227b92b
commit f5ca4430aa
2 changed files with 4 additions and 2 deletions

View file

@ -18,7 +18,8 @@ func TestVehicles(t *testing.T) {
"Missing required parameter", // Renault "Missing required parameter", // Renault
"error connecting: Network Error", "error connecting: Network Error",
"unexpected status: 401", "unexpected status: 401",
"could not obtain token", // Porsche "could not obtain token", // Porsche
"login failed: 400 Bad Request", // Tesla
} }
for _, tmpl := range test.ConfigTemplates("vehicle") { for _, tmpl := range test.ConfigTemplates("vehicle") {

View file

@ -2,6 +2,7 @@ package vehicle
import ( import (
"errors" "errors"
"fmt"
"net/http" "net/http"
"strings" "strings"
"time" "time"
@ -58,7 +59,7 @@ func NewTeslaFromConfig(other map[string]interface{}) (api.Vehicle, error) {
Password: cc.Password, Password: cc.Password,
}) })
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("login failed: %w", err)
} }
vehicles, err := client.Vehicles() vehicles, err := client.Vehicles()