Skip to content

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.

VIDGuide added 2 commits July 16, 2021 12:21
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