Improve formatting of weather report

This commit is contained in:
2023-06-02 14:20:09 -04:00
parent e686283884
commit 723d573ada

View File

@ -1,7 +1,7 @@
{% from 'time.jinja' import ct %}
{% set ct = ct() | int %}
{% macro weatherReport(type,method,time) %}
{% macro weatherInfo(type,method,time) %}
{% set time = time|default('day') %}
{% if method == 'text' %}
{% if type in ['current','full'] %}
@ -65,7 +65,6 @@
] | random }}
{% endif %}
{% endif %}
{% if type in ['current','full'] %}
{{ states('sensor.current_conditions_detail') }}
{% elif type == 'forecast' %}
@ -81,3 +80,7 @@
{% endif %}
{% endif %}
{% endmacro %}
{% macro weatherReport(type,method,time) %}
{{ weatherInfo(type,method,time) | replace('clear-night','clear') | replace('partlycloudy','partly cloudy') }}
{% endmacro %}