Skip to content

Commit

Permalink
feat: Sweeden Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeftor committed Sep 11, 2023
1 parent bd272df commit 06f253b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion blueprints/automation/awtrix_weatherflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ blueprint:
selector:
boolean:
default: True
use_moon_sunny_night:
name: Swap Sunny + Night for the Moon
description: >-
Some weather integrations may not correctly implement the `clear-night` weather state. In that case you can use
this option to automatically swap out the moon for if you have night + sunny
selector:
boolean:
default: True

#----------------------------------------
# Sunrise Sunset Times :)
#----------------------------------------
Expand Down Expand Up @@ -729,6 +738,7 @@ variables:
icon_clear_night: !input icon_clear_night
use_moon_clear_night: !input use_moon_clear_night
use_moon_sunny_night: !input use_moon_sunny_night
icon_cloudy: !input icon_cloudy
icon_exceptional: !input icon_exceptional
icon_fog: !input icon_fog
Expand Down Expand Up @@ -783,6 +793,8 @@ variables:
icon: >
{%- if ((weather == 'clear_night') and use_moon_clear_night) %}
{{clear_night_dict[moon_phase]}}
{%- elif (sun_next_event == 'sunrise') and use_moon_sunny_night and (weather == 'sunny') -%}
{%- else %}
{{ icon_dict[weather] }}
{%- endif %}
Expand Down Expand Up @@ -815,7 +827,13 @@ variables:
{%- endif %}
{%- endmacro %}
{{iif(weather == 'clear-night' and use_moon_clear_night, draw_moon(moon_phase,0,0), draw_moon(moon_phase,23,0))}}
{%- if weather == 'clear-night' and use_moon_clear_night -%}
{{draw_moon(moon_phase,0,0)}}
{%- elif weather == 'sunny' and use_moon_sunny_night -%}
{{draw_moon(moon_phase,0,0)}}
{%- else -%}
{{draw_moon(moon_phase,23,0)}}
{%- endif -%}
payload: >
{%- macro interpolate(dictionary, x) -%}
Expand Down

0 comments on commit 06f253b

Please sign in to comment.