home-assistant-configuration/config/templates/twitter_promos.yaml

55 lines
2.1 KiB
YAML
Raw Normal View History

>
{# Twitter Promos #}
2020-04-10 16:41:46 +00:00
{%- macro getRandomIntro() -%}
{{- [
"Do you want your house to be a #smarthome? ",
"Your house can be a #smarthome too. ",
"Transform your home into a #smarthome. ",
"You get a #smarthome and you get a smarthome and you get a smarthome. ",
"Looking to automate your house? ",
"Want to get into Home Automation? "
] | random -}}
{%- endmacro -%}
{%- macro getRandomLead() -%}
{{- [
"All you need is #homeassistant, and these config files ->",
"Just grab #homeassistant and checkout ",
"Just grab #homeassistant and for inspiration checkout ",
"It is easy. Install #homeassistant, and add some config files like ",
"You can't go wrong with #homeassistant. For an example of what you can do checkout "
2020-04-10 16:41:46 +00:00
] | random -}}
{%- endmacro -%}
{%- macro getRandomPromo() -%}
{{- [
2020-04-10 16:41:46 +00:00
"https://github.com/CCOSTAN/Home-AssistantConfig#logo cc: @ccostan ",
"https://github.com/skalavala/mysmarthome ",
"https://github.com/arsaboo/homeassistant-config ",
"https://github.com/Vasiley/Home-Assistant-Main ",
"https://github.com/JamesMcCarthy79/Home-Assistant-Config ",
"https://github.com/bruhautomation/BRUH3-Home-Assistant-Configuration cc: @BRUHautomation ",
"https://github.com/isabellaalstrom/home-assistant-config cc: @teachingbirds ",
"https://github.com/JuanMTech/Home_Assistant_files cc: @JuanMTech ",
] | random -}}
{%- endmacro -%}
{%- macro getTags() -%}
#homeautomation #youcandoit #givingback
{%- endmacro -%}
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
{%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%}
{{ item | trim }} {% endfor -%}
{%- endmacro -%}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
2020-04-10 16:41:46 +00:00
{{ getRandomIntro() }}
{{ getRandomLead() }}
{{ getRandomPromo() }}
{{ getTags() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}