Renault: HTTP-Session im SoC-Abruf wiederverwenden, Kilometerstand optional behandeln - #3849
Open
seaspotter wants to merge 1 commit into
Open
Renault: HTTP-Session im SoC-Abruf wiederverwenden, Kilometerstand optional behandeln#3849seaspotter wants to merge 1 commit into
seaspotter wants to merge 1 commit into
Conversation
…ckpit odometer req.get_http_session() created a fresh session (and cookie jar) for every one of the 7 requests in fetch_soc(), breaking Renault's Gigya/Kamereon login chain for some accounts and causing SoC reads to fail entirely. Reuse a single session for the whole flow instead. Also guard the cockpit odometer lookup: some vehicles don't report mileage, and odometer is already optional on CarState, so a missing/failing cockpit response should no longer take down the SoC/range read with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bisher wurde für jeden der 7 Requests im Login-/Abrufablauf (Gigya-Login, Kamereon-Daten) eine neue Session erzeugt, wodurch Cookies nicht über den Ablauf hinweg erhalten blieben und der SoC-Abruf bei manchen Accounts komplett fehlschlug. Jetzt wird eine einzige Session für den gesamten Ablauf verwendet.
Zusätzlich wird der Kilometerstand (Cockpit-Daten) jetzt mit try/except abgefangen, da nicht jedes Fahrzeug diesen Wert liefert – ein Fehlschlag dort verhindert nicht mehr den Abruf von SoC und Reichweite.
Fixt: #3409 (comment)