Skip to content
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

Add weekly & yearly summaries #265

Merged
merged 161 commits into from
Jan 2, 2024

Conversation

GitOldGrumpy
Copy link
Collaborator

Implements the two missing parts of summaries.

  • There are two new lint errors that I don't understand. If someone could explain what I've missed.
  • If anyone has a car older than a year could they check if they can receive data from over 12 months ago.

Finally, anyone think we need a helper function, where you can ask for THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR, LAST_YEAR or is it just me that uses this functionality?

GitOldGrumpy and others added 30 commits November 17, 2023 22:57
No statistics. Possible but needs changing. Will cause exceptions.
No trips. Possible but needs changing. Will cause exceptions.
No "setting" of data. Is possible need to work out endpoints.
No HVAC. Is possible need to work out endpoint.
Tests will fail.
Doesn't deal with regresh token.
Depracated endpoints still there but fail.

May other things are still missing.
Trips, Statistics & HVAC still missing.
All "getter" functions are synchronous.
All "setter" functions are asynchronous. HOWEVER none of them work, something is missing.
Re-worked they way endpoints are retrieved and added capability checking.
Can retrieve all notifications. Seems no way to limit how little/many are returned. Added flag for only unread notifications.
…and another copy of fuel levels, odometer and range. Thanks @CM000n for testing)

Updated logging function so (hopefully) identifiable information is censored. TODO debug logging functions.
Addressed some review comments.
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

Attention: 69 lines in your changes are missing coverage. Please review.

Comparison is base (e12475e) 75.33% compared to head (b4eee5c) 72.46%.
Report is 1 commits behind head on master.

Files Patch % Lines
mytoyota/models/vehicle.py 14.81% 46 Missing ⚠️
mytoyota/models/endpoints/trips.py 14.81% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #265      +/-   ##
==========================================
- Coverage   75.33%   72.46%   -2.87%     
==========================================
  Files          27       28       +1     
  Lines        1277     1351      +74     
==========================================
+ Hits          962      979      +17     
- Misses        315      372      +57     
Flag Coverage Δ
unittests 72.46% <20.68%> (-2.87%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CM000n
Copy link
Collaborator

CM000n commented Dec 27, 2023

Finally, anyone think we need a helper function, where you can ask for THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR, LAST_YEAR or is it just me that uses this functionality?

I also think that this could be extremely helpful. 👍🏻 Especially in view of the statistics sensors for the Home Assistant integration.
But we can add it in a seperate PR.

@CM000n CM000n changed the title Add weekly yearly summaries Add weekly & yearly summaries Dec 27, 2023
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
mytoyota/models/endpoints/trips.py Outdated Show resolved Hide resolved
mytoyota/models/endpoints/trips.py Show resolved Hide resolved
mytoyota/models/endpoints/trips.py Show resolved Hide resolved
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
CM000n
CM000n previously approved these changes Jan 2, 2024
mytoyota/models/vehicle.py Outdated Show resolved Hide resolved
@CM000n
Copy link
Collaborator

CM000n commented Jan 2, 2024

LGTM now 🎉
There is only one small issue left with what I think is a misplaced comment.
After that you can actually merge. 😊

@GitOldGrumpy
Copy link
Collaborator Author

Removing the comment has removed the merge approval. If you want to approve and then merge. Thanks.

@CM000n CM000n merged commit b22cac7 into DurgNomis-drol:master Jan 2, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants