-
Notifications
You must be signed in to change notification settings - Fork 34
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
Statistical driver information of today cannot be requested when specifying specific date #144
Comments
I would like to suggest that the I'm however unaware of the reason why this check was added. It could be that there was a valid reason for it. Could this also partially fix the 'known issue' that is included in the README.md? It would be nice if we could resolve that 'known issue'. :-) @DurgNomis-drol Do you know why the today-check is present in the |
MyT returns nothing if you set the |
I still have to further investigate and test this by implementing the proposed change and testing it with the actual MyT servers. There is however a strong suspicion that this problem is also breaking the latest unittests if they are performed on a Sunday (because the first day of an 'isoweek') or on a Monday (because the first day of a 'week'). Need a few days to test this correctly and implement the correct fix (if any). |
I tried to retrieve the statistical information from the current date, which is also the first day of the week.
It seems to indicate that there is also a 'to' parameter, that can be specified in the |
I have never been able to make this work, i have also tried many different combinations and it will always return that error when requesting data on the the first date of an given periode. |
@joro75 @DurgNomis-drol Hi there, I have a similar error coming from a different problem: While trying to retrieve data from a specific day (16th June 2022) with the Which also suggests there's a parameter Would you like me to open a separate bug report or is this the right place for it? EDIT: I can confirm there's indeed a "to" parameter, as I made it work. Let me know if you consider this part of this issue or a separate one so I can commit my edits here or somewhere else :) |
@martarho Yes it indeed seems that there must be a to parameter, but I have never found out how to use it. Please post all the info you have about the |
I'll open a PR then! |
We have recently released a beta version for the new API endpoints and will be focussing our work on this in the future. |
This behaviour should be fixed with Ex: pp.pprint(f"Summary for specific day: {await car.get_summary(from_date=date(2023, 8, 5), to_date=date(2023, 8, 5), summary_type=SummaryType.DAILY,)}") should now give you a ("Summary for specific day: [average_speed=18.231 countries=['DE'] "
'duration=0:11:39 distance=3.54 ev_duration=0:04:38 ev_distance=1.041 '
'from_date=2023-08-05 to_date=2023-08-05 fuel_consumed=0.098]') that also works if you use e.g |
Describe the bug
In the
get_driving_statistics
function it is possible to retrieve the specify a 'day'-interval with the 'from_date' of today. In that case no statistics are returned but error_code 2 is being returned.if however the same function is called with the same 'day'-interval, but with the default 'from_date' (None), the day statistics of today are being returned.
This seems to be related to the line 391 of client.py, where a check is done if the requested date is today, and then the actual retrieval is skipped.
To Reproduce
Expected behavior
I would expect that even if a specific date for today is passed, the statistical information of that day is being returned.
Additional context
A very related problem is present when no specific date is specified for the 'week'-interval, and it is requested on a Sunday. In that case no data is being returned, even though statistical information is present on the Toyota servers. This problem is also causing problems with some unittests if they are being performed on a Sunday :-(
The text was updated successfully, but these errors were encountered: