Fix for dashboard/updates wrong charge count mapping, fixes adriankumpf/teslamate#991 #1147
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for dashboards/updates to apply number of charges and avg rated range to the correct update.
Previously the join would look for the data from the previous version by getting the data between the previous versions start date and the current one. Changed this to instead look for data between the start date of the version and the next version (or now if current version).
Before:
There are no charges on the first version I had on my car, even though Teslamate correctly reports the version as being installed for 1 week before an update. The range increase is also shown for 2020.48.12.1, while I actually got that one on the 2020.48.12 update according to my update logs.
After:
This one shows the correct amount of charges both on the first version, and also the version I updated to this morning. While also showing the correct range increase.