From 1613db053927767cbbf92f2fbf016d5fa8753043 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 28 Jun 2021 20:12:54 +0200 Subject: [PATCH] Show number of installation is use base <1% (#18336) Co-authored-by: Paulus Schoutsen --- source/_includes/asides/component_navigation.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/_includes/asides/component_navigation.html b/source/_includes/asides/component_navigation.html index 7c67fee83c2..de34932eff2 100644 --- a/source/_includes/asides/component_navigation.html +++ b/source/_includes/asides/component_navigation.html @@ -1,3 +1,4 @@ +{% assign percentage = 100.0 | times: site.data.analytics_data.integrations[page.ha_domain] | divided_by: site.data.analytics_data.reports_integrations | round: 1 %}
@@ -20,8 +21,13 @@
The {{ page.name | default: page.title }} integration was introduced in Home Assistant {{ page.ha_release | default: "unknown" }}, - and it's used by - {{ 100.0 | times: site.data.analytics_data.integrations[page.ha_domain] | divided_by: site.data.analytics_data.reports_integrations | round: 1 | remove: ".0" }}% of the active installations. + and it's used by + + {% if percentage < 1 %} + {{ site.data.analytics_data.integrations[page.ha_domain] }} active installations. + {% else %} + {{ percentage | remove: ".0" }}% of the active installations. + {% endif %} {%- if page.ha_iot_class %} Its IoT class is {{ page.ha_iot_class }}