Advertisement
mikalmo

Jinjaloop

Nov 9th, 2023
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. {% for day in range(1, 6) %}
  2. {%- set forecast_index = 1 + day - 1 -%}
  3. {%- set state = state_attr('weather.forecast_nilsen_goberg', 'forecast')[forecast_index].condition -%}
  4. Været for dag {{ day }}:
  5. {% if state == 'clear-night' %} Klar natt
  6. {% elif state == 'cloudy' %} Overskyet
  7. {% elif state == 'exceptional' %} Fantastisk
  8. {% elif state == 'fog' %} Tåke
  9. {% elif state == 'hail' %} Hagl
  10. {% elif state == 'lightning' %} Torden
  11. {% elif state == 'lightning-rainy' %} Torden, regn
  12. {% elif state == 'partlycloudy' %} Delvis overskyet
  13. {% elif state == 'pouring' %} Pøsregn
  14. {% elif state == 'rainy' %} Regn
  15. {% elif state == 'snowy' %} Snø
  16. {% elif state == 'snowy-rainy' %} Sludd
  17. {% elif state == 'sunny' %} Sol
  18. {% elif state == 'windy' %} Vind
  19. {% elif state == 'windy-variant' %} Vind
  20. {% else %} Vet ikke
  21. {% endif %}
  22. {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement