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

38 lines
2.8 KiB
YAML
Executable File

>
{# Twitter Self Promos #}
{%- macro getRandomPromo() -%}
{{- [
"Want to know how to add USPS Notifications to #homeassistant? Check out https://www.youtube.com/watch?v=TjVeoAKn-r0 ",
"You can watch videos on turning your home into a smart home using #homeassistant at https://www.youtube.com/channel/UCipZJ6748kd8TbelSxcvcVg ",
"You can bring a little Disney #imagineering into your home using #homeassistant. Check out this video -> https://www.youtube.com/watch?v=Tm9ZXtk5P-s #homemadedisney ",
"Anchorage House's Automation was built under the guiding principles of The Three Laws of Home Automation -> https://slacker-labs.com/2020/04/02/the-three-laws-of-home-automation/ ",
"Do you use Zigbee2Mqtt in #homeassistant? Your zigbee devices may have a firmware update waiting and you might be able to leverage the OTA Update process. Checkout https://slacker-labs.com/2020/05/29/zigbee2mqtt-and-ota-device-firmware-updates/ ",
"Want to use Cloudflare to manage your #homeassistant SSL cert? I left a short write up over at https://slacker-labs.com/2020/04/17/swapping-out-duckdns-for-cloudflare/",
"Tired of renewing Lets Encrypt certs in #homeassistant? Migrate to Cloudflare for your SSL cert and they last almost forever. I show you how at https://slacker-labs.com/2020/04/17/swapping-out-duckdns-for-cloudflare/ ",
"I created dog mode for when I dont want to disarm my #homeassistant security system just to let the dog out -> https://slacker-labs.com/2020/04/14/where-we-are-going-we-need-dog-mode/ ",
"Do you forget to disarm your security system in the middle of the night? #homeassistant can solve that. https://slacker-labs.com/2020/04/14/where-we-are-going-we-need-dog-mode/ ",
"I built a security system using #homeassistant and you can too. Start the two part series at https://slacker-labs.com/2020/04/10/how-i-secured-my-home-using-home-assistant-part-one/ ",
"My #homeassistant security system is so good at recognizing threats it disarms itself. Learn how at https://slacker-labs.com/2020/04/10/how-i-secured-my-home-using-home-assistant-part-one/",
"Want to know how I migrated from Hassbian to #homeassistant? Now you can at https://slacker-labs.com/2020/04/05/migrating-from-hassbian-to-hassio/"
] | random -}}
{%- endmacro -%}
{%- macro getTags() -%}
#homeautomation
{%- 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() -%}
{{ getRandomPromo() }}
{{ getTags() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}