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

Uptime average is not showing when value is 0 #149

Closed
h3llrais3r opened this issue Jan 31, 2023 · 1 comment · Fixed by #154
Closed

Uptime average is not showing when value is 0 #149

h3llrais3r opened this issue Jan 31, 2023 · 1 comment · Fixed by #154
Labels
bug Something isn't working

Comments

@h3llrais3r
Copy link

h3llrais3r commented Jan 31, 2023

When the uptime is 0, the average template is never rendered.

image

average_template: >-
  [[[
  let date = new Date(0);
  seconds = Math.trunc((configuration.hours_to_show * 3600) * variables.uptime / 100);
  date.setSeconds(seconds);
  return date.toISOString().substr(11, 8) + ' (' + variables.uptime.toFixed(2) + '%)';
  ]]]

Code indicates that it's only rendered when value > 0:
image

@h3llrais3r h3llrais3r changed the title Utime average is not showing when value is 0 Uptime average is not showing when value is 0 Jan 31, 2023
@dylandoamaral dylandoamaral added the bug Something isn't working label Mar 10, 2023
@dylandoamaral
Copy link
Owner

Thanks it will be available for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants