-
Notifications
You must be signed in to change notification settings - Fork 36
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
WIP: Lexus Work #316
base: master
Are you sure you want to change the base?
WIP: Lexus Work #316
Conversation
After modifing to
|
Now my local time is after midnight, and when I tried again, I got this error for the Trips:
|
I think I understand this one, probably something to do with different time zones and not being able to request a "future" date. Will need looking into. |
This seems odd. Have you un-commented any lines. Line 79 is a comment line that should be |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #316 +/- ##
==========================================
- Coverage 70.35% 70.09% -0.26%
==========================================
Files 32 32
Lines 1511 1518 +7
==========================================
+ Hits 1063 1064 +1
- Misses 448 454 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@CM000n what's the thinking for adding the brand to each of the endpoint calls? I don't think it can change once you are connected as the vehicles you get back will only be of the specific brand. Is this not something we could put on the initialiser of the API class? |
Good point @GitOldGrumpy. I thought this was also required in the headers of the respective API calls? If we really only need it for the initial call of the vehicle, the whole thing could of course be simplified. |
Its needed for all calls to any endpoint but only needs to be set the once so it could be set when the API class is constructed as opposed to on each API call? This simplifies all the endpoint calls. There is one downside if a user has both Toyota's and Lexi then they will need too construct two API classes one for each brand. This will work as the first will login and the second will use the cached credentials. I think this is still preferable to having to specifying the brand in each API endpoint call as for all but this case you will always being passing the same value. |
That gives me an idea. The current way of caching (we store it as |
Yes you're correct if they have different email addresses across the apps then they will get different tokens. In my test case I was using the same details across both. |
Yes, sorry, I think I un-commented it by mistake. Now it works with no error. |
I'm really excited about how we want to design it. 😊 Maybe we should write it down/record it? My idea would be that a user does not have to specify the brand, but we use the Do you already have an idea of how we want to deal with multi-accounting and caching? In the issues of the Home Assistant integration there are also issues from people who have authorization problems when the lib tries to create a cache folder + file in the home directory of the process user. |
My thoughts around brands:
My thoughts are credential caching:
It seems to me that it is easier to keep the API single branded which we are told, although easier isn't always correct. |
You're right, it's usually better to make the information explicit rather than implicit. After thinking about it again I think most people would expect the same behaviour as when using two different apps. With regard to Home Assitant, it should already be possible to specify several accounts. For each account, all associated vehicles should then actually be created as a device with their respective entities (sensors). Unfortunately, I haven't been able to test it yet, as I only have one vehicle myself and writing tests for Home Assistant custom components is a PITA To be honest, I don't quite understand how you want to use the specified brand once when constructing the API class, instead of adding it to the endpoint calls. But I'm happy to be persuaded. 😊
I don't think that makes any difference or makes the situation worse. 😉 If anyone at Toyota takes a closer look, we are already conspicuous. Currently, the Home Assistant integration queries the API every 5 minutes. I don't think the apps do that with such regularity.
As written under point 1, you are probably right. People would expect similar behaviour here as with different apps.
Wouldn't it be easiest to create a cache file with a name based on the user's email address? This would provide a clear distinction. Or is it possible to log in to Lexus and Toyota with the same e-mail address and then get different accounts?
That would be a possible emergency solution
To be honest, I don't know. The diverse installation options of HA make it difficult to determine how the respective user system is currently behaving.
👍🏻 |
guys, i'd like to support, e.g. with testing. i have lexus rx. feel free to come back to me |
Is one of you CafeAlpha on reddit? If not, it might be interesting to know what integration he uses, because it seems to work with his Lexus: |
Unfortunately he must be in America as the IS500 is not available in Europe... |
Arg, you're right. And the APIs have nothing in common, correct? |
Wouldn't it be simpler (for the developers) and clearer (for the end user) to have two integrations? If you have a car of each brand, you install both integrations...
Could you add a bit of randomness? Check every 3 to 7 minutes during the day, more during the night or something? |
Absolutely right the API's are different even if the features are pretty much the same |
I'm gonna patiently wait until you guys have a working solution for Lexus in Europe, then |
@CM000n and @ellvisss branch for working through getting a Lexus vehicle to work.
Currently contains all fixes we have found and a fix for the first pydantic error.
If we run and post the log files on errors, unless of course you can see the fix, then fix away.