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

55 lines
2.1 KiB
YAML
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

>
{# Twitter Promos #}
{%- 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 "
] | random -}}
{%- endmacro -%}
{%- macro getRandomPromo() -%}
{{- [
"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() -%}
{{ getRandomIntro() }}
{{ getRandomLead() }}
{{ getRandomPromo() }}
{{ getTags() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}