Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Porsche Vehicle API #512

Merged
merged 4 commits into from Dec 8, 2020

Conversation

DerAndereAndi
Copy link
Contributor

@DerAndereAndi DerAndereAndi commented Dec 8, 2020

  • Added remaining range value without converting any metrics as it is assuming the metric is set to km and not miles
  • Added finding the VIN of the vehicle automatically if no VIN is provided

log.DEBUG.Printf("found vehicle: %v", v.vin)
}
}
v.chargerG = provider.NewCached(v.chargeState, cc.Cache).InterfaceGetter()

return v, nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Da fehlt das Handling von err != nil. Meist hab ichs so gelöst;

err := v.authFlow()

if err == nil && cc.VIN == "" {
	v.vin, err = findVehicle(v.vehicles(v.userID))
	if err == nil {
		log.DEBUG.Printf("found vehicle: %v", v.vin)
	}
}

v.API = kamereon.New(provider.NewCached(v.batteryAPI, cc.Cache).InterfaceGetter())

return v, err

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Der Fehler muss zurück

@DerAndereAndi
Copy link
Contributor Author

@andig could not obtain token in config_test.go als acceptable hinzufügen?

@andig
Copy link
Member

andig commented Dec 8, 2020

ja, absolut. eigentlich schön, dass der fehler jetzt beim init fliegt und nicht erst bei der benutzung ;)

@andig
Copy link
Member

andig commented Dec 8, 2020

Squash und rein?

@DerAndereAndi DerAndereAndi merged commit 348b3f9 into master Dec 8, 2020
@delete-merged-branch delete-merged-branch bot deleted the feature/porsche-vehicle-updates branch December 8, 2020 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants