Show number of installation is use base <1% (#18336)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Franck Nijhof 2021-06-28 20:12:54 +02:00 committed by GitHub
parent f27c5c7732
commit 1613db0539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 %}
<section class="aside-module grid__item one-whole lap-one-half">
<div class='brand-logo-container section'>
@ -20,8 +21,13 @@
<div class='section'>
The {{ page.name | default: page.title }} integration was introduced in Home Assistant {{ page.ha_release | default: "unknown" }},
and it's used by <a title="Open analytics.home-assistant.io" href="https://analytics.home-assistant.io" target="_blank" rel="noopener">
{{ 100.0 | times: site.data.analytics_data.integrations[page.ha_domain] | divided_by: site.data.analytics_data.reports_integrations | round: 1 | remove: ".0" }}%</a> of the active installations.
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.
{% else %}
{{ percentage | remove: ".0" }}%</a> of the active installations.
{% endif %}
{%- if page.ha_iot_class %}
Its IoT class is <a href='/blog/2016/02/12/classifying-the-internet-of-things/#classifiers'>{{ page.ha_iot_class }}</a>