-
-
Notifications
You must be signed in to change notification settings - Fork 720
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
Ford: async soc refresh #1001
Ford: async soc refresh #1001
Conversation
implement repeated call of vehicle API if EVCC needs to wait for API
err = fmt.Errorf("refresh failed: status %d", res.Status) | ||
// if status attribute in JSON response is 200, update is complete, otherwise server is still | ||
// waiting for vehicle and the request needs to be repeated | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v.refreshId muss zurückgesetzt werden wenn err != nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das ist ne gute Frage. Könnte bei der nächsten Iteration ja klappen (Netzwerkproblem)? Aktuell würde das weiter passieren bis nachgelagert ErrTimeout kommt. Was meinst Du?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guter Punkt, dann muss aber die Bedingung für den Timeout geändert werden (Zeile 206).
if res, err = v.refreshResult(); err != nil && time.Since(v.refreshTime) > fordRefreshTimeout {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
willst Du's Dir nochmal greifen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ich kann in dein Repo nicht pushen - für die eine Zeile rentiert sich nicht einen neuen Pull-Request zu öffnen (oder es gibt einen Trick, den ich nicht kenne)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eigentlich einfach
if err != nil && time.Since(v.refreshTime) > fordRefreshTimeout {
v.refreshId = ""
if errors.Is(err, api.ErrMustRetry) {
err = api.ErrTimeout
}
}
oder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auch nciht, aber jetzt hab ich das problem verstanden, mom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, neuer Versuch- denke es ist einfacher alle Logik an einem Platz zu haben. Jetzt gibts keine Kopfschmerzen mehr ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So ist es perfekt 👌
Ich würde sagen „das ist es“ (auf den PR bezogen). Ich zieh die letzte Version auf jeden Fall nochmal auf mein Produktivsystem zum Test, erwarte aber keine Fehler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top, dann rein damit!
2 Kommentare habe ich dagelassen, sieht sonst sehr gut aus! Ich werde morgen mal zum Testen einen Ladevorgang durchführen. |
replace #1000
/cc @MrJayC