Porsche: fix e-mobility vehicle API routes and add login error handling (#1552)
Change required as Porsche backend was updated
This commit is contained in:
parent
43938a6230
commit
ccf83bb310
2 changed files with 5 additions and 2 deletions
|
|
@ -168,6 +168,9 @@ func (v *Identity) fetchToken(emobility bool) (tokenResponse, error) {
|
|||
}
|
||||
|
||||
authCode := query.Get("code")
|
||||
if authCode == "" {
|
||||
return pr, errors.New("no auth code")
|
||||
}
|
||||
|
||||
codeVerifier := CodeVerifier.CodeChallengePlain()
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ func (v *EMobilityProvider) request(uri string) (*http.Request, error) {
|
|||
// Status implements the vehicle status response
|
||||
func (v *EMobilityProvider) status(vin string) (interface{}, error) {
|
||||
if v.carModel == "" {
|
||||
uri := fmt.Sprintf("https://api.porsche.com/service-vehicle/vcs/capabilities/%s", vin)
|
||||
uri := fmt.Sprintf("https://api.porsche.com/e-mobility/vcs/capabilities/%s", vin)
|
||||
req, err := v.request(uri)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
@ -128,7 +128,7 @@ func (v *EMobilityProvider) status(vin string) (interface{}, error) {
|
|||
v.carModel = cr.CarModel
|
||||
}
|
||||
|
||||
uri := fmt.Sprintf("https://api.porsche.com/service-vehicle/de/de_DE/e-mobility/%s/%s?timezone=Europe/Berlin", v.carModel, vin)
|
||||
uri := fmt.Sprintf("https://api.porsche.com/e-mobility/de/de_DE/%s/%s?timezone=Europe/Berlin", v.carModel, vin)
|
||||
req, err := v.request(uri)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue