-
-
Notifications
You must be signed in to change notification settings - Fork 740
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
Renault: Provide a meaningful error when not paired #3668
Conversation
- log.ERROR.Println added to kamereonVehicles - no logic changes only a log messages is added It would also be possible to move this to the ==ACTIVE branch. But I don't know how the kamereon API will behave with other versions
- do not only log the not paired vehicle but create an error response the missconfigured / non-paired vehicle
- do not only log the not paired vehicle but create an error response the missconfigured / non-paired vehicle - do not check for role "MAIN_DRIVER" string, just check of role existence. The "ConnectedDriver.Role" is not documented at https://renault-api.readthedocs.io/en/latest/reference/kamereon.html#renault_api.kamereon.models.KamereonVehiclesLink but I can reproduce the behaviour. For the case the vehicle is paired the ConnectedDriver.Role attribute is there an has the "MAIN_DRIVER" value and if the vihicle is not paired the ConnectedDriver.Role attribute is not there, the API can be tested of empty string.
- remove not needed local var
- add test for vehicle/renault.go - use vehicle from account if no one is cofiggured on evcc or use a matching vehicle
@ickeundso Du vermischst wieder die Funktionen. |
Ich machs mal zu, gerne neuer Anlauf wenn Du Lust hast. |
- add test for vehicle/renault.go - use vehicle from account if no one is configured on evcc or use a matching vehicle - fix linter warn
Ich glaub wir müssen uns nur einigen wie es werden soll: entweder filtern wir alle unzugänglichen Fahrzeuge stillschweigend raus (so ist es heute). Oder wir geben alle Fahrzeuge zurück (es ist ja die vehicles Funktion) und lassen übergeordnet prüfen was davon zu verwenden ist. Auf die Art bleibt der Code sauber, Beides wäre möglich. |
Mein Vorschlag wäre #3706 (ich bekomms grad nicht in Deinen PR gepusht, irgendein Git-Problem). Wär das ok für Dich? |
So, jetzt ist es hier drin. Please check. |
@ickeundso passt die Funktion? Dann müssten nur noch die Tests entfernt werden oder auf den Typ umgebaut. |
HI @andig , haha, da kann ich sehr gut mit leben. Ist ja wesentlich weiter gedacht Deine Lösung. Ja die test könnte ich umbauen, entweder hier oder ich mach dafür nach Deinem master merge einen separaten PR auf und wir schieben die Test nach, das wäre dann zwar nicht ganz so wie man es macht, aber .... |
Genau. Dann schmeiss gerne den Test erstmal raus, wäre aber schön wenn Du probieren könntest ob es funktioniert- dafür fehlt mir das Fahrzeug... |
Fix #3535