Fix tesla build errors
This commit is contained in:
parent
46d227b92b
commit
f5ca4430aa
2 changed files with 4 additions and 2 deletions
|
|
@ -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") {
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue