Add default value for active installations (#18666)

This commit is contained in:
Joakim Sørensen 2021-07-30 11:07:58 +02:00 committed by GitHub
parent 4d3d8ba472
commit 0f03e6e96c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
{% assign percentage = 100.0 | times: site.data.analytics_data.integrations[page.ha_domain] | divided_by: site.data.analytics_data.reports_integrations | round: 1 %}
{% assign active_installations = site.data.analytics_data.integrations[page.ha_domain] | default: 0 %}
{% assign percentage = 100.0 | times: active_installations | divided_by: site.data.analytics_data.reports_integrations | round: 1 %}
<section class="aside-module grid__item one-whole lap-one-half">
<div class='brand-logo-container section'>
{%- if page.logo -%}
@ -17,7 +18,7 @@
and it's used by <a title="Open analytics.home-assistant.io" href="https://analytics.home-assistant.io/#integrations" target="_blank" rel="noopener">
{% if percentage < 1 %}
{{ site.data.analytics_data.integrations[page.ha_domain] }}</a> active installations.
{{ active_installations }}</a> active installations.
{% else %}
{{ percentage | remove: ".0" }}%</a> of the active installations.
{% endif %}