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

New features added #5

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

New features added #5

wants to merge 8 commits into from

Conversation

novalore
Copy link

The module works again with the new API and I am using it on my mirror, but noticed that waiting times are not always very easy to read and keep in mind, so I added options to visualize actual arrival times.

Added other options too and documented them in the README.
PollInterval is particularly useful when testing without Api key or checking the CSS on the MagicMirror page.

Merge if you like it

Added configurable pollInterval
Added functions to calculate actual arrival time from waiting time and display it (or not) based on configuration (24h or 12h formats supported
Third option added to the if in getTimeDiv
@@ -22,10 +25,24 @@ Module.register("MMM-stib2", {
this.fetchColors()
.then(() => this.update())
.then(() => {
// Schedule updates
// Convert pollInterval to a number if it's a string representation of a number
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polInterval can be dangerous. To avoid issues I added validation here

slash.classList.add("fas", "fa-slash", "fa-stack-1x", "stib-time-icon");

icon.appendChild(bus);
icon.appendChild(slash);
} else {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot about this special case.
Restore this section if needed

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.

None yet

1 participant