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

Charge now duration #320

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

VIDGuide
Copy link

added support to show remaining duration of active Charge Now.
Shows Date/time, and minutes remaining, as well as the currently set amps.

Desktop:
image
Mobile:
image

@ngardiner
Copy link
Owner

This is great @VIDGuide, although I would move the presentation logic from getStatus to the JavaScript. Whilst we do use getStatus from the web front end, it's also a REST API call and could be used in another web template or in a separate app, and they would have to parse the text (eg Currently: ) to get the raw value.

@VIDGuide
Copy link
Author

Good point. I'll submit an update in a little bit.

Update Javascript to parse raw values into strings and format accordingly
@VIDGuide
Copy link
Author

PR updated now with changes. API now returns chargingAmps and chargingEnd as raw values (ints in both cases)
JS now processes and formats those into displays.

Note: One potential issue could be if the browser and server are in different timezones, the "minutes remaining" calculation may be incorrect. May need to look at returning the diff as a 3rd value in the JSON to solve that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants