-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[tesla] Adapt binding to changed API from Tesla backend #14922
Conversation
Signed-off-by: Kai Kreuzer <[email protected]>
Signed-off-by: Kai Kreuzer <[email protected]>
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.
Thanks for taking care of this!
There are some compiler and SAT warnings introduced, you could have a look at https://ci.openhab.org/job/PR-openHAB-Addons/15443/Static_20Code_20Analysis_20Report/summary_report.html#org.openhab.binding.tesla.internal.protocol.VehicleData.java for example.
For the particular DTO class, you can fix most of them by using the @SerializedName
annotation and camelCasing the variables. The missing @NonNullByDefault
can be ignored for now, or you could move all the classes to a dto
directory to have them excluded from the check.
Most of the compiler warnings are because of changed code lines that already lacked proper null handling, so you can choose to ignore them for now.
Otherwise LGTM!
@jlaur I intentionally created the new DTO in the same way as the others as I didn't want to introduce a mix of variable naming styles in the same package. |
That's sounds sensible. |
Probably stupid from my side, but when I install the 4.0.0 SNAPSHOT .jar file, I get a "ERROR:HANDLER" and "HANDLER_MISSING_ERROR" on the Tesla bridge. Should I and how should I install a new handler? |
@hlemmens I'd suggest to simply update your openHAB to the latest 4.0.0-SNAPSHOT instance - the fixed binding is then a part of it and you do not need to install it manually. |
Not sure if you need any feedback Kai, but I tested today and the fix works just fine on 4.0.0. |
@theater Thanks, feedback is always welcome! |
@kaikreuzer. Many thanks for the fix and the hint. I managed to install the 3.4.4 Snapshot.jar and it works. The old issue [Tesla] Binding going offline #14435 is popping up again. In the 3.4.2 version it was fixed with the commit thijslemmens@24b74c5. Can this fix be integrated as well? Is it already done in the 4.0.0 SNAPSHOT version? |
Any fix that was in 3.4.2 should also have been done in 4.0.0, since we always only backport fixes, but never only fix things on older releases. |
I’m afraid the issue with the access token renewal was not fixed in 3.4.2. . The commit I mentioned in previous comment has not been accepted and integrated as far as I know. |
@hlemmens - I don't see any pull requests from you, did you mean to create one? |
If you are referring to this "solution", I would say that it anyhow isn't something to merge, since recreating the http client all the time does not look like a proper way to fix it. |
This solution Is to my knowledge the only one that seems to work. Since I installed the fix for the changed Tesla API, every 8 hours I lose the connection with the car: Happy to see a better solution than the existing one. |
* Adapt binding to changed API from Tesla backend Signed-off-by: Kai Kreuzer <[email protected]> Signed-off-by: Thomas Burri <[email protected]>
* Adapt binding to changed API from Tesla backend Signed-off-by: Kai Kreuzer <[email protected]> Signed-off-by: Matt Myers <[email protected]>
* Adapt binding to changed API from Tesla backend Signed-off-by: Kai Kreuzer <[email protected]> Signed-off-by: Jørgen Austvik <[email protected]>
Fixes #14894
The Tesla API has removed most endpoints that the binding was using for querying vehicle data.
The only one left is an aggregated call to fetch all data at once.
This PR does the necessary changes.
In my tests, all seems to work well. If enough people report that it works for them as well, this would be a candidate to backport to 3.4.x.