Feature Refresh EV Vehicle Statuses #110
Open
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.
I noticed refreshing statuses would not refresh EV statuses when running the refresh action. I have been "hacking" this via toggling my charger that I can also control in home assistant because the vehicle sends an update when charging state changes automatically. This solution is probably not a great method and probably not great for the health of battery / charger.
I took a look and there is a refresh battery button in the app so I looked into it and created this solution. I also noticed the app gets EV Status afterwards and will call the refresh afterwards differently depending on the generation.
With that all in mind, the changes I have added in here will refresh the battery info when the other statuses are refreshed or the action is called. To reduce API requests and errors, it will only if the car is an EV and will handle it the same way the app does with clicking the refresh button on the battery screen no matter the generation.
I also wanted to note I didn't really change much in init.py, but since the project lacks standard formatting, I assume this is happening because I did this on linux and the encoding or new lines are different.