infra/roles/hass-core/files/macros/weather.jinja

6 lines
334 B
Django/Jinja

{% macro precip(weather_entity_id) %}
{# https://developers.home-assistant.io/docs/core/entity/weather/#recommended-values-for-state-and-condition #}
{% set conditions = ["exceptional", "hail", "lightning", "lighting-rainy", "pouring", "rainy", "snowy", "snowy-rainy"] %}
{{ states(weather_entity_id) in conditions }}
{% endmacro %}